From 61e2254be21b80b5b3934aa5a6e401b858b7fd8e Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 3 Jun 2008 07:12:09 +0000 Subject: * This should fix presence issues. --- OpenSim/Grid/MessagingServer/MessageService.cs | 31 +++++++++++++++--------- OpenSim/Grid/MessagingServer/PresenceInformer.cs | 4 +-- OpenSim/Grid/MessagingServer/UserPresenceData.cs | 3 ++- 3 files changed, 24 insertions(+), 14 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index 59fef7e..0abb89d 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs @@ -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 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(); diff --git a/OpenSim/Grid/MessagingServer/PresenceInformer.cs b/OpenSim/Grid/MessagingServer/PresenceInformer.cs index 050d88a..3e35f20 100644 --- a/OpenSim/Grid/MessagingServer/PresenceInformer.cs +++ b/OpenSim/Grid/MessagingServer/PresenceInformer.cs @@ -111,8 +111,8 @@ namespace OpenSim.Grid.MessagingServer ArrayList SendParams = new ArrayList(); 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 diff --git a/OpenSim/Grid/MessagingServer/UserPresenceData.cs b/OpenSim/Grid/MessagingServer/UserPresenceData.cs index 74a6032..3c5002c 100644 --- a/OpenSim/Grid/MessagingServer/UserPresenceData.cs +++ b/OpenSim/Grid/MessagingServer/UserPresenceData.cs @@ -40,7 +40,8 @@ namespace OpenSim.Grid.MessagingServer public string httpURI = String.Empty; public List friendData = new List (); public List subscriptionData = new List(); - public bool OnlineYN = false; + public bool OnlineYN = true; + public bool lookupUserRegionYN = true; public UserPresenceData() { -- cgit v1.1