aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs')
-rw-r--r--OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs23
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
index 64002e1..71c3c73 100644
--- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
@@ -82,6 +82,9 @@ namespace OpenSim.Server.Handlers.Friends
82 case "getfriends": 82 case "getfriends":
83 return GetFriends(request); 83 return GetFriends(request);
84 84
85 case "getfriends_string":
86 return GetFriendsString(request);
87
85 case "storefriend": 88 case "storefriend":
86 return StoreFriend(request); 89 return StoreFriend(request);
87 90
@@ -111,7 +114,25 @@ namespace OpenSim.Server.Handlers.Friends
111 m_log.WarnFormat("[FRIENDS HANDLER]: no principalID in request to get friends"); 114 m_log.WarnFormat("[FRIENDS HANDLER]: no principalID in request to get friends");
112 115
113 FriendInfo[] finfos = m_FriendsService.GetFriends(principalID); 116 FriendInfo[] finfos = m_FriendsService.GetFriends(principalID);
114 //m_log.DebugFormat("[FRIENDS HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count); 117
118 return PackageFriends(finfos);
119 }
120
121 byte[] GetFriendsString(Dictionary<string, object> request)
122 {
123 string principalID = string.Empty;
124 if (request.ContainsKey("PRINCIPALID"))
125 principalID = request["PRINCIPALID"].ToString();
126 else
127 m_log.WarnFormat("[FRIENDS HANDLER]: no principalID in request to get friends");
128
129 FriendInfo[] finfos = m_FriendsService.GetFriends(principalID);
130
131 return PackageFriends(finfos);
132 }
133
134 private byte[] PackageFriends(FriendInfo[] finfos)
135 {
115 136
116 Dictionary<string, object> result = new Dictionary<string, object>(); 137 Dictionary<string, object> result = new Dictionary<string, object>();
117 if ((finfos == null) || ((finfos != null) && (finfos.Length == 0))) 138 if ((finfos == null) || ((finfos != null) && (finfos.Length == 0)))