Adding root agent position messages to the message server
parent
7aa32ac6e0
commit
e082f10884
|
@ -130,11 +130,19 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
|
|||
return;
|
||||
|
||||
m_RootAgents.Remove(client.AgentId);
|
||||
|
||||
NotifyMessageServerOfAgentLeaving(client.AgentId, scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
public void OnSetRootAgentScene(UUID agentID, Scene scene)
|
||||
{
|
||||
if (m_RootAgents.ContainsKey(agentID))
|
||||
{
|
||||
if (m_RootAgents[agentID] == scene)
|
||||
return;
|
||||
}
|
||||
m_RootAgents[agentID] = scene;
|
||||
NotifyMessageServerOfAgentLocation(agentID, scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
private void NotifyMessageServerOfStartup(Scene scene)
|
||||
|
@ -168,5 +176,39 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
|
|||
m_log.ErrorFormat("[PRESENCE] Failed to notify message server of region shutdown for region {0}", scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
private void NotifyMessageServerOfAgentLocation(UUID agentID, string region)
|
||||
{
|
||||
Hashtable xmlrpcdata = new Hashtable();
|
||||
xmlrpcdata["AgentID"] = agentID.ToString();
|
||||
xmlrpcdata["RegionName"] = region;
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(xmlrpcdata);
|
||||
XmlRpcRequest LocationRequest = new XmlRpcRequest("agent_location", SendParams);
|
||||
XmlRpcResponse resp = LocationRequest.Send(m_Scenes[0].CommsManager.NetworkServersInfo.MessagingURL, 5000);
|
||||
|
||||
Hashtable responseData = (Hashtable)resp.Value;
|
||||
if ((!responseData.ContainsKey("success")) || (string)responseData["success"] != "TRUE")
|
||||
{
|
||||
m_log.ErrorFormat("[PRESENCE] Failed to notify message server of agent location for {0}", agentID.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void NotifyMessageServerOfAgentLeaving(UUID agentID, string region)
|
||||
{
|
||||
Hashtable xmlrpcdata = new Hashtable();
|
||||
xmlrpcdata["AgentID"] = agentID.ToString();
|
||||
xmlrpcdata["RegionName"] = region;
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(xmlrpcdata);
|
||||
XmlRpcRequest LeavingRequest = new XmlRpcRequest("agent_leaving", SendParams);
|
||||
XmlRpcResponse resp = LeavingRequest.Send(m_Scenes[0].CommsManager.NetworkServersInfo.MessagingURL, 5000);
|
||||
|
||||
Hashtable responseData = (Hashtable)resp.Value;
|
||||
if ((!responseData.ContainsKey("success")) || (string)responseData["success"] != "TRUE")
|
||||
{
|
||||
m_log.ErrorFormat("[PRESENCE] Failed to notify message server of agent leaving for {0}", agentID.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue