aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs20
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs67
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs61
-rw-r--r--OpenSim/Services/HypergridService/HGFriendsService.cs301
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs10
-rw-r--r--OpenSim/Services/Interfaces/IHypergridServices.cs13
6 files changed, 460 insertions, 12 deletions
diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
index eea9853..3fd0c53 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
@@ -43,8 +43,18 @@ namespace OpenSim.Services.Connectors.Friends
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 protected virtual string ServicePath()
47 {
48 return "friends";
49 }
50
46 public bool FriendshipOffered(GridRegion region, UUID userID, UUID friendID, string message) 51 public bool FriendshipOffered(GridRegion region, UUID userID, UUID friendID, string message)
47 { 52 {
53 return FriendshipOffered(region, userID, friendID, message, String.Empty);
54 }
55
56 public virtual bool FriendshipOffered(GridRegion region, UUID userID, UUID friendID, string message, string userName)
57 {
48 Dictionary<string, object> sendData = new Dictionary<string, object>(); 58 Dictionary<string, object> sendData = new Dictionary<string, object>();
49 //sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); 59 //sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
50 //sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString(); 60 //sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
@@ -53,9 +63,10 @@ namespace OpenSim.Services.Connectors.Friends
53 sendData["FromID"] = userID.ToString(); 63 sendData["FromID"] = userID.ToString();
54 sendData["ToID"] = friendID.ToString(); 64 sendData["ToID"] = friendID.ToString();
55 sendData["Message"] = message; 65 sendData["Message"] = message;
66 if (userName != String.Empty)
67 sendData["FromName"] = userName;
56 68
57 return Call(region, sendData); 69 return Call(region, sendData);
58
59 } 70 }
60 71
61 public bool FriendshipApproved(GridRegion region, UUID userID, string userName, UUID friendID) 72 public bool FriendshipApproved(GridRegion region, UUID userID, string userName, UUID friendID)
@@ -138,8 +149,11 @@ namespace OpenSim.Services.Connectors.Friends
138 if (region == null) 149 if (region == null)
139 return false; 150 return false;
140 151
141 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: region: {0}", region.ExternalHostName + ":" + region.HttpPort); 152 string path = ServicePath();
142 string uri = "http://" + region.ExternalHostName + ":" + region.HttpPort + "/friends"; 153 if (!region.ServerURI.EndsWith("/"))
154 path = "/" + path;
155 string uri = region.ServerURI + path;
156 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri);
143 157
144 try 158 try
145 { 159 {
diff --git a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
index af4b0da..e3f3260 100644
--- a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
@@ -40,7 +40,7 @@ using OpenMetaverse;
40 40
41namespace OpenSim.Services.Connectors.Hypergrid 41namespace OpenSim.Services.Connectors.Hypergrid
42{ 42{
43 public class HGFriendsServicesConnector 43 public class HGFriendsServicesConnector : FriendsSimConnector
44 { 44 {
45 private static readonly ILog m_log = 45 private static readonly ILog m_log =
46 LogManager.GetLogger( 46 LogManager.GetLogger(
@@ -66,6 +66,11 @@ namespace OpenSim.Services.Connectors.Hypergrid
66 m_SessionID = sessionID; 66 m_SessionID = sessionID;
67 } 67 }
68 68
69 protected override string ServicePath()
70 {
71 return "hgfriends";
72 }
73
69 #region IFriendsService 74 #region IFriendsService
70 75
71 public uint GetFriendPerms(UUID PrincipalID, UUID friendID) 76 public uint GetFriendPerms(UUID PrincipalID, UUID friendID)
@@ -187,23 +192,69 @@ namespace OpenSim.Services.Connectors.Hypergrid
187 { 192 {
188 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 193 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
189 194
190 if ((replyData != null) && replyData.ContainsKey("Result") && (replyData["Result"] != null)) 195 if (replyData.ContainsKey("RESULT"))
191 { 196 {
192 bool success = false; 197 if (replyData["RESULT"].ToString().ToLower() == "true")
193 Boolean.TryParse(replyData["Result"].ToString(), out success); 198 return true;
194 return success; 199 else
200 return false;
195 } 201 }
196 else 202 else
197 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Delete {0} {1} received null response", 203 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: reply data does not contain result field");
198 PrincipalID, Friend); 204
199 } 205 }
200 else 206 else
201 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: DeleteFriend received null reply"); 207 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: received empty reply");
202 208
203 return false; 209 return false;
204 210
205 } 211 }
206 212
213 public bool ValidateFriendshipOffered(UUID fromID, UUID toID)
214 {
215 FriendInfo finfo = new FriendInfo();
216 finfo.PrincipalID = fromID;
217 finfo.Friend = toID.ToString();
218
219 Dictionary<string, object> sendData = finfo.ToKeyValuePairs();
220
221 sendData["METHOD"] = "validate_friendship_offered";
222
223 string reply = string.Empty;
224 string uri = m_ServerURI + "/hgfriends";
225 try
226 {
227 reply = SynchronousRestFormsRequester.MakeRequest("POST",
228 uri,
229 ServerUtils.BuildQueryString(sendData));
230 }
231 catch (Exception e)
232 {
233 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
234 return false;
235 }
236
237 if (reply != string.Empty)
238 {
239 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
240
241 if (replyData.ContainsKey("RESULT"))
242 {
243 if (replyData["RESULT"].ToString().ToLower() == "true")
244 return true;
245 else
246 return false;
247 }
248 else
249 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: reply data does not contain result field");
250
251 }
252 else
253 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: received empty reply");
254
255 return false;
256
257 }
207 #endregion 258 #endregion
208 } 259 }
209} \ No newline at end of file 260} \ No newline at end of file
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 5b27cf6..bf86035 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -789,13 +789,72 @@ namespace OpenSim.Services.Connectors.Hypergrid
789 } 789 }
790 catch 790 catch
791 { 791 {
792 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on LocateUser response."); 792 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetUUI response.");
793// reason = "Exception: " + e.Message; 793// reason = "Exception: " + e.Message;
794 } 794 }
795 795
796 return uui; 796 return uui;
797 } 797 }
798 798
799 public UUID GetUUID(String first, String last)
800 {
801 Hashtable hash = new Hashtable();
802 hash["first"] = first;
803 hash["last"] = last;
804
805 IList paramList = new ArrayList();
806 paramList.Add(hash);
807
808 XmlRpcRequest request = new XmlRpcRequest("get_uuid", paramList);
809 // string reason = string.Empty;
810
811 // Send and get reply
812 UUID uuid = UUID.Zero;
813 XmlRpcResponse response = null;
814 try
815 {
816 response = request.Send(m_ServerURL, 10000);
817 }
818 catch
819 {
820 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUUID", m_ServerURL);
821 // reason = "Exception: " + e.Message;
822 return uuid;
823 }
824
825 if (response.IsFault)
826 {
827 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetUUID returned an error: {1}", m_ServerURL, response.FaultString);
828 // reason = "XMLRPC Fault";
829 return uuid;
830 }
831
832 hash = (Hashtable)response.Value;
833 //foreach (Object o in hash)
834 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
835 try
836 {
837 if (hash == null)
838 {
839 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUUDI Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
840 // reason = "Internal error 1";
841 return uuid;
842 }
843
844 // Here's the actual response
845 if (hash.ContainsKey("UUID"))
846 UUID.TryParse(hash["UUID"].ToString(), out uuid);
847
848 }
849 catch
850 {
851 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on UUID response.");
852 // reason = "Exception: " + e.Message;
853 }
854
855 return uuid;
856 }
857
799 private bool GetBoolResponse(XmlRpcRequest request, out string reason) 858 private bool GetBoolResponse(XmlRpcRequest request, out string reason)
800 { 859 {
801 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); 860 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);
diff --git a/OpenSim/Services/HypergridService/HGFriendsService.cs b/OpenSim/Services/HypergridService/HGFriendsService.cs
new file mode 100644
index 0000000..19ee3e2
--- /dev/null
+++ b/OpenSim/Services/HypergridService/HGFriendsService.cs
@@ -0,0 +1,301 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Net;
31using System.Reflection;
32
33using OpenSim.Framework;
34using OpenSim.Services.Connectors.Friends;
35using OpenSim.Services.Connectors.Hypergrid;
36using OpenSim.Services.Interfaces;
37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
38using OpenSim.Server.Base;
39using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
40
41using OpenMetaverse;
42using log4net;
43using Nini.Config;
44
45namespace OpenSim.Services.HypergridService
46{
47 /// <summary>
48 /// W2W social networking
49 /// </summary>
50 public class HGFriendsService : IHGFriendsService
51 {
52 private static readonly ILog m_log =
53 LogManager.GetLogger(
54 MethodBase.GetCurrentMethod().DeclaringType);
55
56 static bool m_Initialized = false;
57
58 protected static IGridUserService m_GridUserService;
59 protected static IGridService m_GridService;
60 protected static IGatekeeperService m_GatekeeperService;
61 protected static IFriendsService m_FriendsService;
62 protected static IPresenceService m_PresenceService;
63 protected static IUserAccountService m_UserAccountService;
64 protected static IFriendsSimConnector m_FriendsLocalSimConnector; // standalone, points to HGFriendsModule
65 protected static FriendsSimConnector m_FriendsSimConnector; // grid
66
67 private static string m_ConfigName = "HGFriendsService";
68
69 public HGFriendsService(IConfigSource config, String configName, IFriendsSimConnector localSimConn)
70 {
71 if (m_FriendsLocalSimConnector == null)
72 m_FriendsLocalSimConnector = localSimConn;
73
74 if (!m_Initialized)
75 {
76 m_Initialized = true;
77
78 if (configName != String.Empty)
79 m_ConfigName = configName;
80
81 Object[] args = new Object[] { config };
82
83 IConfig serverConfig = config.Configs[m_ConfigName];
84 if (serverConfig == null)
85 throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
86
87 string theService = serverConfig.GetString("FriendsService", string.Empty);
88 if (theService == String.Empty)
89 throw new Exception("No FriendsService in config file " + m_ConfigName);
90 m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(theService, args);
91
92 theService = serverConfig.GetString("UserAccountService", string.Empty);
93 if (theService == String.Empty)
94 throw new Exception("No UserAccountService in " + m_ConfigName);
95 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(theService, args);
96
97 theService = serverConfig.GetString("GridService", string.Empty);
98 if (theService == String.Empty)
99 throw new Exception("No GridService in " + m_ConfigName);
100 m_GridService = ServerUtils.LoadPlugin<IGridService>(theService, args);
101
102 theService = serverConfig.GetString("PresenceService", string.Empty);
103 if (theService == String.Empty)
104 throw new Exception("No PresenceService in " + m_ConfigName);
105 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(theService, args);
106
107 m_FriendsSimConnector = new FriendsSimConnector();
108
109 m_log.DebugFormat("[HGFRIENDS SERVICE]: Starting...");
110
111 }
112 }
113
114 #region IHGFriendsService
115
116 public int GetFriendPerms(UUID userID, UUID friendID)
117 {
118 FriendInfo[] friendsInfo = m_FriendsService.GetFriends(userID);
119 foreach (FriendInfo finfo in friendsInfo)
120 {
121 if (finfo.Friend.StartsWith(friendID.ToString()))
122 return finfo.TheirFlags;
123 }
124 return -1;
125 }
126
127 public bool NewFriendship(FriendInfo friend, bool verified)
128 {
129 UUID friendID;
130 string tmp = string.Empty, url = String.Empty, first = String.Empty, last = String.Empty;
131 if (!Util.ParseUniversalUserIdentifier(friend.Friend, out friendID, out url, out first, out last, out tmp))
132 return false;
133
134 m_log.DebugFormat("[HGFRIENDS SERVICE]: New friendship {0} {1} ({2})", friend.PrincipalID, friend.Friend, verified);
135
136 // Does the friendship already exist?
137 FriendInfo[] finfos = m_FriendsService.GetFriends(friend.PrincipalID);
138 foreach (FriendInfo finfo in finfos)
139 {
140 if (finfo.Friend.StartsWith(friendID.ToString()))
141 return false;
142 }
143 // Verified user session. But the user needs to confirm friendship when he gets home
144 if (verified)
145 return m_FriendsService.StoreFriend(friend.PrincipalID.ToString(), friend.Friend, 0);
146
147 // Does the reverted friendship exist? meaning that this user initiated the request
148 finfos = m_FriendsService.GetFriends(friendID);
149 bool userInitiatedOffer = false;
150 foreach (FriendInfo finfo in finfos)
151 {
152 if (friend.Friend.StartsWith(finfo.PrincipalID.ToString()) && finfo.Friend.StartsWith(friend.PrincipalID.ToString()) && finfo.TheirFlags == -1)
153 {
154 userInitiatedOffer = true;
155 // Let's delete the existing friendship relations that was stored
156 m_FriendsService.Delete(friendID, finfo.Friend);
157 break;
158 }
159 }
160
161 if (userInitiatedOffer)
162 {
163 m_FriendsService.StoreFriend(friend.PrincipalID.ToString(), friend.Friend, 1);
164 m_FriendsService.StoreFriend(friend.Friend, friend.PrincipalID.ToString(), 1);
165 // notify the user
166 ForwardToSim("ApproveFriendshipRequest", friendID, Util.UniversalName(first, last, url), "", friend.PrincipalID, "");
167 return true;
168 }
169 return false;
170 }
171
172 public bool DeleteFriendship(FriendInfo friend, string secret)
173 {
174 FriendInfo[] finfos = m_FriendsService.GetFriends(friend.PrincipalID);
175 foreach (FriendInfo finfo in finfos)
176 {
177 // We check the secret here. Or if the friendship request was initiated here, and was declined
178 if (finfo.Friend.StartsWith(friend.Friend) && finfo.Friend.EndsWith(secret))
179 {
180 m_log.DebugFormat("[HGFRIENDS SERVICE]: Delete friendship {0} {1}", friend.PrincipalID, friend.Friend);
181 m_FriendsService.Delete(friend.PrincipalID, finfo.Friend);
182 m_FriendsService.Delete(finfo.Friend, friend.PrincipalID.ToString());
183
184 return true;
185 }
186 }
187
188 return false;
189 }
190
191 public bool FriendshipOffered(UUID fromID, string fromName, UUID toID, string message)
192 {
193 UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, toID);
194 if (account == null)
195 return false;
196
197 // OK, we have that user here.
198 // So let's send back the call, but start a thread to continue
199 // with the verification and the actual action.
200
201 Util.FireAndForget(delegate { ProcessFriendshipOffered(fromID, fromName, toID, message); });
202
203 return true;
204 }
205
206 public bool ValidateFriendshipOffered(UUID fromID, UUID toID)
207 {
208 FriendInfo[] finfos = m_FriendsService.GetFriends(toID.ToString());
209 foreach (FriendInfo fi in finfos)
210 {
211 if (fi.Friend.StartsWith(fromID.ToString()) && fi.TheirFlags == -1)
212 return true;
213 }
214 return false;
215 }
216
217 #endregion IHGFriendsService
218
219 #region Aux
220
221 private void ProcessFriendshipOffered(UUID fromID, String fromName, UUID toID, String message)
222 {
223 // Great, it's a genuine request. Let's proceed.
224 // But now we need to confirm that the requester is who he says he is
225 // before we act on the friendship request.
226
227 if (!fromName.Contains("@"))
228 return;
229
230 string[] parts = fromName.Split(new char[] {'@'});
231 if (parts.Length != 2)
232 return;
233
234 string uriStr = "http://" + parts[1];
235 try
236 {
237 new Uri(uriStr);
238 }
239 catch (UriFormatException)
240 {
241 return;
242 }
243
244 UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr);
245 Dictionary<string, object> servers = uasConn.GetServerURLs(fromID);
246 if (!servers.ContainsKey("FriendsServerURI"))
247 return;
248
249 HGFriendsServicesConnector friendsConn = new HGFriendsServicesConnector(servers["FriendsServerURI"].ToString());
250 if (!friendsConn.ValidateFriendshipOffered(fromID, toID))
251 {
252 m_log.WarnFormat("[HGFRIENDS SERVICE]: Friendship request from {0} to {1} is invalid. Impersonations?", fromID, toID);
253 return;
254 }
255
256 string fromUUI = Util.UniversalIdentifier(fromID, parts[0], "@" + parts[1], uriStr);
257 // OK, we're good!
258 ForwardToSim("FriendshipOffered", fromID, fromName, fromUUI, toID, message);
259 }
260
261 private bool ForwardToSim(string op, UUID fromID, string name, String fromUUI, UUID toID, string message)
262 {
263 PresenceInfo session = null;
264 GridRegion region = null;
265 PresenceInfo[] sessions = m_PresenceService.GetAgents(new string[] { toID.ToString() });
266 if (sessions != null && sessions.Length > 0)
267 session = sessions[0];
268 if (session != null)
269 region = m_GridService.GetRegionByUUID(UUID.Zero, session.RegionID);
270
271 switch (op)
272 {
273 case "FriendshipOffered":
274 // Let's store backwards
275 string secret = UUID.Random().ToString().Substring(0, 8);
276 m_FriendsService.StoreFriend(toID.ToString(), fromUUI + ";" + secret, 0);
277 if (m_FriendsLocalSimConnector != null) // standalone
278 {
279 GridInstantMessage im = new GridInstantMessage(null, fromID, name, toID,
280 (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero);
281 // !! HACK
282 im.imSessionID = im.fromAgentID;
283 return m_FriendsLocalSimConnector.LocalFriendshipOffered(toID, im);
284 }
285 else if (region != null) // grid
286 return m_FriendsSimConnector.FriendshipOffered(region, fromID, toID, message, name);
287 break;
288 case "ApproveFriendshipRequest":
289 if (m_FriendsLocalSimConnector != null) // standalone
290 return m_FriendsLocalSimConnector.LocalFriendshipApproved(fromID, name, toID);
291 else if (region != null) //grid
292 return m_FriendsSimConnector.FriendshipApproved(region, fromID, name, toID);
293 break;
294 }
295
296 return false;
297 }
298
299 #endregion Aux
300 }
301}
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index f681df4..5eca801 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -566,6 +566,16 @@ namespace OpenSim.Services.HypergridService
566 566
567 return string.Empty; 567 return string.Empty;
568 } 568 }
569
570 public UUID GetUUID(String first, String last)
571 {
572 // Let's see if it's a local user
573 UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, first, last);
574 if (account != null)
575 return account.PrincipalID;
576 else
577 return UUID.Zero;
578 }
569 } 579 }
570 580
571 class TravelingAgentInfo 581 class TravelingAgentInfo
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs
index 5b293ac..f48b8a9 100644
--- a/OpenSim/Services/Interfaces/IHypergridServices.cs
+++ b/OpenSim/Services/Interfaces/IHypergridServices.cs
@@ -62,6 +62,8 @@ namespace OpenSim.Services.Interfaces
62 // on behalf of the userID 62 // on behalf of the userID
63 string GetUUI(UUID userID, UUID targetUserID); 63 string GetUUI(UUID userID, UUID targetUserID);
64 64
65 UUID GetUUID(String first, String last);
66
65 // Returns the local friends online 67 // Returns the local friends online
66 List<UUID> StatusNotification(List<string> friends, UUID userID, bool online); 68 List<UUID> StatusNotification(List<string> friends, UUID userID, bool online);
67 //List<UUID> GetOnlineFriends(UUID userID, List<string> friends); 69 //List<UUID> GetOnlineFriends(UUID userID, List<string> friends);
@@ -79,6 +81,17 @@ namespace OpenSim.Services.Interfaces
79 public interface IFriendsSimConnector 81 public interface IFriendsSimConnector
80 { 82 {
81 bool StatusNotify(UUID userID, UUID friendID, bool online); 83 bool StatusNotify(UUID userID, UUID friendID, bool online);
84 bool LocalFriendshipOffered(UUID toID, GridInstantMessage im);
85 bool LocalFriendshipApproved(UUID userID, string userName, UUID friendID);
86 }
87
88 public interface IHGFriendsService
89 {
90 int GetFriendPerms(UUID userID, UUID friendID);
91 bool NewFriendship(FriendInfo finfo, bool verified);
92 bool DeleteFriendship(FriendInfo finfo, string secret);
93 bool FriendshipOffered(UUID from, string fromName, UUID to, string message);
94 bool ValidateFriendshipOffered(UUID fromID, UUID toID);
82 } 95 }
83 96
84 public interface IInstantMessageSimConnector 97 public interface IInstantMessageSimConnector