* This should fix presence issues.

0.6.0-stable
Teravus Ovares 2008-06-03 07:12:09 +00:00
parent 52491d4fca
commit 61e2254be2
5 changed files with 33 additions and 16 deletions

View File

@ -87,6 +87,8 @@ namespace OpenSim.Grid.MessagingServer
{ {
if (!m_presences.Contains(userpresence.agentData.AgentID)) if (!m_presences.Contains(userpresence.agentData.AgentID))
m_presences.Add(userpresence.agentData.AgentID, userpresence); m_presences.Add(userpresence.agentData.AgentID, userpresence);
else
m_presences[userpresence.agentData.AgentID] = userpresence;
} }
List<FriendListItem> uFriendList = userpresence.friendData; List<FriendListItem> uFriendList = userpresence.friendData;
@ -132,18 +134,24 @@ namespace OpenSim.Grid.MessagingServer
UserAgentData p2Handle = m_userManager.GetUserAgentData(userpresence.agentData.AgentID); UserAgentData p2Handle = m_userManager.GetUserAgentData(userpresence.agentData.AgentID);
if (p2Handle != null) if (p2Handle != null)
{ {
if (userpresence.lookupUserRegionYN)
{
userpresence.regionData.regionHandle = p2Handle.Handle; userpresence.regionData.regionHandle = p2Handle.Handle;
PresenceInformer friendlistupdater = new PresenceInformer(); }
friendlistupdater.presence1 = friendpresence; else
//friendlistupdater.gridserverurl = m_cfg.GridServerURL; {
//friendlistupdater.gridserversendkey = m_cfg.GridSendKey; userpresence.lookupUserRegionYN = true;
//friendlistupdater.gridserverrecvkey = m_cfg.GridRecvKey; }
friendlistupdater.presence2 = userpresence; PresenceInformer friendlistupdater = new PresenceInformer();
friendlistupdater.OnGetRegionData += GetRegionInfo; friendlistupdater.presence1 = friendpresence;
friendlistupdater.OnDone += PresenceUpdateDone; //friendlistupdater.gridserverurl = m_cfg.GridServerURL;
WaitCallback cb = new WaitCallback(friendlistupdater.go); //friendlistupdater.gridserversendkey = m_cfg.GridSendKey;
ThreadPool.QueueUserWorkItem(cb); //friendlistupdater.gridserverrecvkey = m_cfg.GridRecvKey;
friendlistupdater.presence2 = userpresence;
friendlistupdater.OnGetRegionData += GetRegionInfo;
friendlistupdater.OnDone += PresenceUpdateDone;
WaitCallback cb = new WaitCallback(friendlistupdater.go);
ThreadPool.QueueUserWorkItem(cb);
} }
else else
@ -462,6 +470,7 @@ namespace OpenSim.Grid.MessagingServer
RegionProfileData riData = GetRegionInfo(regionHandle); RegionProfileData riData = GetRegionInfo(regionHandle);
up.regionData = riData; up.regionData = riData;
up.OnlineYN = true; up.OnlineYN = true;
up.lookupUserRegionYN = false;
ProcessFriendListSubscriptions(up); ProcessFriendListSubscriptions(up);
return new XmlRpcResponse(); return new XmlRpcResponse();

View File

@ -112,7 +112,7 @@ namespace OpenSim.Grid.MessagingServer
SendParams.Add(PresenceParams); 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 // Send
XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams); XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams);
try try

View File

@ -40,7 +40,8 @@ namespace OpenSim.Grid.MessagingServer
public string httpURI = String.Empty; public string httpURI = String.Empty;
public List<FriendListItem> friendData = new List<FriendListItem> (); public List<FriendListItem> friendData = new List<FriendListItem> ();
public List<LLUUID> subscriptionData = new List<LLUUID>(); public List<LLUUID> subscriptionData = new List<LLUUID>();
public bool OnlineYN = false; public bool OnlineYN = true;
public bool lookupUserRegionYN = true;
public UserPresenceData() public UserPresenceData()
{ {

View File

@ -5981,6 +5981,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
onpb[i] = onpbl; onpb[i] = onpbl;
} }
onp.AgentBlock = onpb; onp.AgentBlock = onpb;
onp.Header.Reliable = true;
OutPacket(onp, ThrottleOutPacketType.Task); OutPacket(onp, ThrottleOutPacketType.Task);
} }
@ -5995,6 +5996,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
offpb[i] = onpbl; offpb[i] = onpbl;
} }
offp.AgentBlock = offpb; offp.AgentBlock = offpb;
offp.Header.Reliable = true;
OutPacket(offp, ThrottleOutPacketType.Task); OutPacket(offp, ThrottleOutPacketType.Task);
} }

View File

@ -93,8 +93,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
public XmlRpcResponse processPresenceUpdate(XmlRpcRequest req) 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]; Hashtable requestData = (Hashtable)req.Params[0];
if (requestData.ContainsKey("agent_id") && requestData.ContainsKey("notify_id") && requestData.ContainsKey("status")) if (requestData.ContainsKey("agent_id") && requestData.ContainsKey("notify_id") && requestData.ContainsKey("status"))
{ {
LLUUID notifyAgentId = LLUUID.Zero; 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["notify_id"], out notifyAgentId);
Helpers.TryParse((string)requestData["agent_id"], out notifyAboutAgentId); 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); ScenePresence avatar = GetPresenceFromAgentID(notifyAgentId);
if (avatar != null) 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(); return new XmlRpcResponse();
} }