* This should fix presence issues.
parent
52491d4fca
commit
61e2254be2
|
@ -87,6 +87,8 @@ namespace OpenSim.Grid.MessagingServer
|
|||
{
|
||||
if (!m_presences.Contains(userpresence.agentData.AgentID))
|
||||
m_presences.Add(userpresence.agentData.AgentID, userpresence);
|
||||
else
|
||||
m_presences[userpresence.agentData.AgentID] = userpresence;
|
||||
}
|
||||
|
||||
List<FriendListItem> uFriendList = userpresence.friendData;
|
||||
|
@ -132,18 +134,24 @@ namespace OpenSim.Grid.MessagingServer
|
|||
UserAgentData p2Handle = m_userManager.GetUserAgentData(userpresence.agentData.AgentID);
|
||||
if (p2Handle != null)
|
||||
{
|
||||
|
||||
if (userpresence.lookupUserRegionYN)
|
||||
{
|
||||
userpresence.regionData.regionHandle = p2Handle.Handle;
|
||||
PresenceInformer friendlistupdater = new PresenceInformer();
|
||||
friendlistupdater.presence1 = friendpresence;
|
||||
//friendlistupdater.gridserverurl = m_cfg.GridServerURL;
|
||||
//friendlistupdater.gridserversendkey = m_cfg.GridSendKey;
|
||||
//friendlistupdater.gridserverrecvkey = m_cfg.GridRecvKey;
|
||||
friendlistupdater.presence2 = userpresence;
|
||||
friendlistupdater.OnGetRegionData += GetRegionInfo;
|
||||
friendlistupdater.OnDone += PresenceUpdateDone;
|
||||
WaitCallback cb = new WaitCallback(friendlistupdater.go);
|
||||
ThreadPool.QueueUserWorkItem(cb);
|
||||
}
|
||||
else
|
||||
{
|
||||
userpresence.lookupUserRegionYN = true;
|
||||
}
|
||||
PresenceInformer friendlistupdater = new PresenceInformer();
|
||||
friendlistupdater.presence1 = friendpresence;
|
||||
//friendlistupdater.gridserverurl = m_cfg.GridServerURL;
|
||||
//friendlistupdater.gridserversendkey = m_cfg.GridSendKey;
|
||||
//friendlistupdater.gridserverrecvkey = m_cfg.GridRecvKey;
|
||||
friendlistupdater.presence2 = userpresence;
|
||||
friendlistupdater.OnGetRegionData += GetRegionInfo;
|
||||
friendlistupdater.OnDone += PresenceUpdateDone;
|
||||
WaitCallback cb = new WaitCallback(friendlistupdater.go);
|
||||
ThreadPool.QueueUserWorkItem(cb);
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -462,6 +470,7 @@ namespace OpenSim.Grid.MessagingServer
|
|||
RegionProfileData riData = GetRegionInfo(regionHandle);
|
||||
up.regionData = riData;
|
||||
up.OnlineYN = true;
|
||||
up.lookupUserRegionYN = false;
|
||||
ProcessFriendListSubscriptions(up);
|
||||
|
||||
return new XmlRpcResponse();
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace OpenSim.Grid.MessagingServer
|
|||
SendParams.Add(PresenceParams);
|
||||
|
||||
|
||||
m_log.Info("[PRESENCE]: Informing " + whichRegion.regionName + " at " + whichRegion.httpServerURI);
|
||||
m_log.InfoFormat("[PRESENCE]: Informing {0}@{1} at {2} about {3}", TalkingAbout.agentData.firstname + " " + TalkingAbout.agentData.lastname, whichRegion.regionName, whichRegion.httpServerURI, UserToUpdate.agentData.firstname + " " + UserToUpdate.agentData.lastname);
|
||||
// Send
|
||||
XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams);
|
||||
try
|
||||
|
|
|
@ -40,7 +40,8 @@ namespace OpenSim.Grid.MessagingServer
|
|||
public string httpURI = String.Empty;
|
||||
public List<FriendListItem> friendData = new List<FriendListItem> ();
|
||||
public List<LLUUID> subscriptionData = new List<LLUUID>();
|
||||
public bool OnlineYN = false;
|
||||
public bool OnlineYN = true;
|
||||
public bool lookupUserRegionYN = true;
|
||||
|
||||
public UserPresenceData()
|
||||
{
|
||||
|
|
|
@ -5981,6 +5981,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
onpb[i] = onpbl;
|
||||
}
|
||||
onp.AgentBlock = onpb;
|
||||
onp.Header.Reliable = true;
|
||||
OutPacket(onp, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -5995,6 +5996,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
offpb[i] = onpbl;
|
||||
}
|
||||
offp.AgentBlock = offpb;
|
||||
offp.Header.Reliable = true;
|
||||
OutPacket(offp, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
|
|
@ -93,8 +93,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
|
|||
|
||||
public XmlRpcResponse processPresenceUpdate(XmlRpcRequest req)
|
||||
{
|
||||
m_log.Info("[FRIENDS]: Got Notification about a user! OMG");
|
||||
//m_log.Info("[FRIENDS]: Got Notification about a user! OMG");
|
||||
Hashtable requestData = (Hashtable)req.Params[0];
|
||||
|
||||
if (requestData.ContainsKey("agent_id") && requestData.ContainsKey("notify_id") && requestData.ContainsKey("status"))
|
||||
{
|
||||
LLUUID notifyAgentId = LLUUID.Zero;
|
||||
|
@ -107,7 +108,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
|
|||
Helpers.TryParse((string)requestData["notify_id"], out notifyAgentId);
|
||||
|
||||
Helpers.TryParse((string)requestData["agent_id"], out notifyAboutAgentId);
|
||||
|
||||
m_log.InfoFormat("[PRESENCE]: Got presence update for {0}, and we're telling {1}, with a status {2}", notifyAboutAgentId.ToString(), notifyAgentId.ToString(), notifyOnlineStatus.ToString());
|
||||
ScenePresence avatar = GetPresenceFromAgentID(notifyAgentId);
|
||||
if (avatar != null)
|
||||
{
|
||||
|
@ -161,6 +162,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
|
|||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PRESENCE]: Malformed XMLRPC Presence request");
|
||||
}
|
||||
return new XmlRpcResponse();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue