aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2008-06-03 07:12:09 +0000
committerTeravus Ovares2008-06-03 07:12:09 +0000
commit61e2254be21b80b5b3934aa5a6e401b858b7fd8e (patch)
treee459093e30558837cec249349dfdc2e01d2c0972
parent* It's probably safe to remove the 'Warning Duplicate packet detected Packet ... (diff)
downloadopensim-SC_OLD-61e2254be21b80b5b3934aa5a6e401b858b7fd8e.zip
opensim-SC_OLD-61e2254be21b80b5b3934aa5a6e401b858b7fd8e.tar.gz
opensim-SC_OLD-61e2254be21b80b5b3934aa5a6e401b858b7fd8e.tar.bz2
opensim-SC_OLD-61e2254be21b80b5b3934aa5a6e401b858b7fd8e.tar.xz
* This should fix presence issues.
-rw-r--r--OpenSim/Grid/MessagingServer/MessageService.cs31
-rw-r--r--OpenSim/Grid/MessagingServer/PresenceInformer.cs4
-rw-r--r--OpenSim/Grid/MessagingServer/UserPresenceData.cs3
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs9
5 files changed, 33 insertions, 16 deletions
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
87 { 87 {
88 if (!m_presences.Contains(userpresence.agentData.AgentID)) 88 if (!m_presences.Contains(userpresence.agentData.AgentID))
89 m_presences.Add(userpresence.agentData.AgentID, userpresence); 89 m_presences.Add(userpresence.agentData.AgentID, userpresence);
90 else
91 m_presences[userpresence.agentData.AgentID] = userpresence;
90 } 92 }
91 93
92 List<FriendListItem> uFriendList = userpresence.friendData; 94 List<FriendListItem> uFriendList = userpresence.friendData;
@@ -132,18 +134,24 @@ namespace OpenSim.Grid.MessagingServer
132 UserAgentData p2Handle = m_userManager.GetUserAgentData(userpresence.agentData.AgentID); 134 UserAgentData p2Handle = m_userManager.GetUserAgentData(userpresence.agentData.AgentID);
133 if (p2Handle != null) 135 if (p2Handle != null)
134 { 136 {
135 137 if (userpresence.lookupUserRegionYN)
138 {
136 userpresence.regionData.regionHandle = p2Handle.Handle; 139 userpresence.regionData.regionHandle = p2Handle.Handle;
137 PresenceInformer friendlistupdater = new PresenceInformer(); 140 }
138 friendlistupdater.presence1 = friendpresence; 141 else
139 //friendlistupdater.gridserverurl = m_cfg.GridServerURL; 142 {
140 //friendlistupdater.gridserversendkey = m_cfg.GridSendKey; 143 userpresence.lookupUserRegionYN = true;
141 //friendlistupdater.gridserverrecvkey = m_cfg.GridRecvKey; 144 }
142 friendlistupdater.presence2 = userpresence; 145 PresenceInformer friendlistupdater = new PresenceInformer();
143 friendlistupdater.OnGetRegionData += GetRegionInfo; 146 friendlistupdater.presence1 = friendpresence;
144 friendlistupdater.OnDone += PresenceUpdateDone; 147 //friendlistupdater.gridserverurl = m_cfg.GridServerURL;
145 WaitCallback cb = new WaitCallback(friendlistupdater.go); 148 //friendlistupdater.gridserversendkey = m_cfg.GridSendKey;
146 ThreadPool.QueueUserWorkItem(cb); 149 //friendlistupdater.gridserverrecvkey = m_cfg.GridRecvKey;
150 friendlistupdater.presence2 = userpresence;
151 friendlistupdater.OnGetRegionData += GetRegionInfo;
152 friendlistupdater.OnDone += PresenceUpdateDone;
153 WaitCallback cb = new WaitCallback(friendlistupdater.go);
154 ThreadPool.QueueUserWorkItem(cb);
147 155
148 } 156 }
149 else 157 else
@@ -462,6 +470,7 @@ namespace OpenSim.Grid.MessagingServer
462 RegionProfileData riData = GetRegionInfo(regionHandle); 470 RegionProfileData riData = GetRegionInfo(regionHandle);
463 up.regionData = riData; 471 up.regionData = riData;
464 up.OnlineYN = true; 472 up.OnlineYN = true;
473 up.lookupUserRegionYN = false;
465 ProcessFriendListSubscriptions(up); 474 ProcessFriendListSubscriptions(up);
466 475
467 return new XmlRpcResponse(); 476 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
111 ArrayList SendParams = new ArrayList(); 111 ArrayList SendParams = new ArrayList();
112 SendParams.Add(PresenceParams); 112 SendParams.Add(PresenceParams);
113 113
114 114
115 m_log.Info("[PRESENCE]: Informing " + whichRegion.regionName + " at " + whichRegion.httpServerURI); 115 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);
116 // Send 116 // Send
117 XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams); 117 XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams);
118 try 118 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
40 public string httpURI = String.Empty; 40 public string httpURI = String.Empty;
41 public List<FriendListItem> friendData = new List<FriendListItem> (); 41 public List<FriendListItem> friendData = new List<FriendListItem> ();
42 public List<LLUUID> subscriptionData = new List<LLUUID>(); 42 public List<LLUUID> subscriptionData = new List<LLUUID>();
43 public bool OnlineYN = false; 43 public bool OnlineYN = true;
44 public bool lookupUserRegionYN = true;
44 45
45 public UserPresenceData() 46 public UserPresenceData()
46 { 47 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index b7f1d90..0ef7f26 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -5981,6 +5981,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5981 onpb[i] = onpbl; 5981 onpb[i] = onpbl;
5982 } 5982 }
5983 onp.AgentBlock = onpb; 5983 onp.AgentBlock = onpb;
5984 onp.Header.Reliable = true;
5984 OutPacket(onp, ThrottleOutPacketType.Task); 5985 OutPacket(onp, ThrottleOutPacketType.Task);
5985 } 5986 }
5986 5987
@@ -5995,6 +5996,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5995 offpb[i] = onpbl; 5996 offpb[i] = onpbl;
5996 } 5997 }
5997 offp.AgentBlock = offpb; 5998 offp.AgentBlock = offpb;
5999 offp.Header.Reliable = true;
5998 OutPacket(offp, ThrottleOutPacketType.Task); 6000 OutPacket(offp, ThrottleOutPacketType.Task);
5999 } 6001 }
6000 6002
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
index 92c808b..0762291 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
@@ -93,8 +93,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
93 93
94 public XmlRpcResponse processPresenceUpdate(XmlRpcRequest req) 94 public XmlRpcResponse processPresenceUpdate(XmlRpcRequest req)
95 { 95 {
96 m_log.Info("[FRIENDS]: Got Notification about a user! OMG"); 96 //m_log.Info("[FRIENDS]: Got Notification about a user! OMG");
97 Hashtable requestData = (Hashtable)req.Params[0]; 97 Hashtable requestData = (Hashtable)req.Params[0];
98
98 if (requestData.ContainsKey("agent_id") && requestData.ContainsKey("notify_id") && requestData.ContainsKey("status")) 99 if (requestData.ContainsKey("agent_id") && requestData.ContainsKey("notify_id") && requestData.ContainsKey("status"))
99 { 100 {
100 LLUUID notifyAgentId = LLUUID.Zero; 101 LLUUID notifyAgentId = LLUUID.Zero;
@@ -107,7 +108,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
107 Helpers.TryParse((string)requestData["notify_id"], out notifyAgentId); 108 Helpers.TryParse((string)requestData["notify_id"], out notifyAgentId);
108 109
109 Helpers.TryParse((string)requestData["agent_id"], out notifyAboutAgentId); 110 Helpers.TryParse((string)requestData["agent_id"], out notifyAboutAgentId);
110 111 m_log.InfoFormat("[PRESENCE]: Got presence update for {0}, and we're telling {1}, with a status {2}", notifyAboutAgentId.ToString(), notifyAgentId.ToString(), notifyOnlineStatus.ToString());
111 ScenePresence avatar = GetPresenceFromAgentID(notifyAgentId); 112 ScenePresence avatar = GetPresenceFromAgentID(notifyAgentId);
112 if (avatar != null) 113 if (avatar != null)
113 { 114 {
@@ -161,6 +162,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
161 } 162 }
162 163
163 } 164 }
165 else
166 {
167 m_log.Warn("[PRESENCE]: Malformed XMLRPC Presence request");
168 }
164 return new XmlRpcResponse(); 169 return new XmlRpcResponse();
165 } 170 }
166 171