mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
HG Friends: reroute the status notifications to the HGFriends service, so that they can scale better. They were previously being handled by the UAS; that is still there, but it's now obsolete and will be removed in a future release.
This commit is contained in:
@@ -255,6 +255,58 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online)
|
||||
{
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
List<UUID> friendsOnline = new List<UUID>();
|
||||
|
||||
sendData["METHOD"] = "statusnotification";
|
||||
sendData["userID"] = userID.ToString();
|
||||
sendData["online"] = online.ToString();
|
||||
int i = 0;
|
||||
foreach (string s in friends)
|
||||
{
|
||||
sendData["friend_" + i.ToString()] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
string reply = string.Empty;
|
||||
string uri = m_ServerURI + "/hgfriends";
|
||||
try
|
||||
{
|
||||
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
||||
uri,
|
||||
ServerUtils.BuildQueryString(sendData));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
|
||||
return friendsOnline;
|
||||
}
|
||||
|
||||
if (reply != string.Empty)
|
||||
{
|
||||
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||
|
||||
// Here is the actual response
|
||||
foreach (string key in replyData.Keys)
|
||||
{
|
||||
if (key.StartsWith("friend_") && replyData[key] != null)
|
||||
{
|
||||
UUID uuid;
|
||||
if (UUID.TryParse(replyData[key].ToString(), out uuid))
|
||||
friendsOnline.Add(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Received empty reply from remote StatusNotify");
|
||||
|
||||
return friendsOnline;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -417,6 +417,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
GetBoolResponse(request, out reason);
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online)
|
||||
{
|
||||
Hashtable hash = new Hashtable();
|
||||
|
||||
Reference in New Issue
Block a user