aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps
diff options
context:
space:
mode:
authorDiva Canto2013-07-25 23:44:58 -0700
committerDiva Canto2013-07-25 23:44:58 -0700
commit878ce1e6b2b96043052015732286141f5b71310b (patch)
tree62586d92078480f05d47b25aaf5c460310c12cfe /OpenSim/Region/ClientStack/Linden/Caps
parentReturn Simulator/0.1 (V1) entity transfer behaviour to waiting only 2 seconds... (diff)
downloadopensim-SC_OLD-878ce1e6b2b96043052015732286141f5b71310b.zip
opensim-SC_OLD-878ce1e6b2b96043052015732286141f5b71310b.tar.gz
opensim-SC_OLD-878ce1e6b2b96043052015732286141f5b71310b.tar.bz2
opensim-SC_OLD-878ce1e6b2b96043052015732286141f5b71310b.tar.xz
This should fix all issues with teleports. One should be able to TP as fast as needed. (Although sometimes Justin's state machine kicks in and doesn't let you) The EventQueues are a hairy mess, and it's very easy to mess things up. But it looks like this commit makes them work right. Here's what's going on:
- Child and root agents are only closed after 15 sec, maybe - If the user comes back, they aren't closed, and everything is reused - On the receiving side, clients and scene presences are reused if they already exist - Caps are always recreated (this is where I spent most of my time!). It turns out that, because the agents carry the seeds around, the seed gets the same URL, except for the root agent coming back to a far away region, which gets a new seed (because we don't know what was its seed in the departing region, and we can't send it back to the client when the agent returns there).
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs58
1 files changed, 14 insertions, 44 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index c5e28ad..d02496f 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -91,7 +91,6 @@ namespace OpenSim.Region.ClientStack.Linden
91 scene.RegisterModuleInterface<IEventQueue>(this); 91 scene.RegisterModuleInterface<IEventQueue>(this);
92 92
93 scene.EventManager.OnClientClosed += ClientClosed; 93 scene.EventManager.OnClientClosed += ClientClosed;
94 scene.EventManager.OnMakeChildAgent += MakeChildAgent;
95 scene.EventManager.OnRegisterCaps += OnRegisterCaps; 94 scene.EventManager.OnRegisterCaps += OnRegisterCaps;
96 95
97 MainConsole.Instance.Commands.AddCommand( 96 MainConsole.Instance.Commands.AddCommand(
@@ -120,7 +119,6 @@ namespace OpenSim.Region.ClientStack.Linden
120 return; 119 return;
121 120
122 scene.EventManager.OnClientClosed -= ClientClosed; 121 scene.EventManager.OnClientClosed -= ClientClosed;
123 scene.EventManager.OnMakeChildAgent -= MakeChildAgent;
124 scene.EventManager.OnRegisterCaps -= OnRegisterCaps; 122 scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
125 123
126 scene.UnregisterModuleInterface<IEventQueue>(this); 124 scene.UnregisterModuleInterface<IEventQueue>(this);
@@ -189,14 +187,12 @@ namespace OpenSim.Region.ClientStack.Linden
189 { 187 {
190 if (!queues.ContainsKey(agentId)) 188 if (!queues.ContainsKey(agentId))
191 { 189 {
192 /*
193 m_log.DebugFormat( 190 m_log.DebugFormat(
194 "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", 191 "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}",
195 agentId, m_scene.RegionInfo.RegionName); 192 agentId, m_scene.RegionInfo.RegionName);
196 */
197 queues[agentId] = new Queue<OSD>(); 193 queues[agentId] = new Queue<OSD>();
198 } 194 }
199 195
200 return queues[agentId]; 196 return queues[agentId];
201 } 197 }
202 } 198 }
@@ -228,8 +224,12 @@ namespace OpenSim.Region.ClientStack.Linden
228 { 224 {
229 Queue<OSD> queue = GetQueue(avatarID); 225 Queue<OSD> queue = GetQueue(avatarID);
230 if (queue != null) 226 if (queue != null)
227 {
231 lock (queue) 228 lock (queue)
232 queue.Enqueue(ev); 229 queue.Enqueue(ev);
230 }
231 else
232 m_log.WarnFormat("[EVENTQUEUE]: (Enqueue) No queue found for agent {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName);
233 } 233 }
234 catch (NullReferenceException e) 234 catch (NullReferenceException e)
235 { 235 {
@@ -244,7 +244,7 @@ namespace OpenSim.Region.ClientStack.Linden
244 244
245 private void ClientClosed(UUID agentID, Scene scene) 245 private void ClientClosed(UUID agentID, Scene scene)
246 { 246 {
247// m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); 247 //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
248 248
249 int count = 0; 249 int count = 0;
250 while (queues.ContainsKey(agentID) && queues[agentID].Count > 0 && count++ < 5) 250 while (queues.ContainsKey(agentID) && queues[agentID].Count > 0 && count++ < 5)
@@ -261,31 +261,6 @@ namespace OpenSim.Region.ClientStack.Linden
261 lock (m_AvatarQueueUUIDMapping) 261 lock (m_AvatarQueueUUIDMapping)
262 m_AvatarQueueUUIDMapping.Remove(agentID); 262 m_AvatarQueueUUIDMapping.Remove(agentID);
263 263
264// lock (m_AvatarQueueUUIDMapping)
265// {
266// foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys)
267// {
268//// m_log.DebugFormat("[EVENTQUEUE]: Found key {0} in m_AvatarQueueUUIDMapping while looking for {1}", ky, AgentID);
269// if (ky == agentID)
270// {
271// removeitems.Add(ky);
272// }
273// }
274//
275// foreach (UUID ky in removeitems)
276// {
277// UUID eventQueueGetUuid = m_AvatarQueueUUIDMapping[ky];
278// m_AvatarQueueUUIDMapping.Remove(ky);
279//
280// string eqgPath = GenerateEqgCapPath(eventQueueGetUuid);
281// MainServer.Instance.RemovePollServiceHTTPHandler("", eqgPath);
282//
283//// m_log.DebugFormat(
284//// "[EVENT QUEUE GET MODULE]: Removed EQG handler {0} for {1} in {2}",
285//// eqgPath, agentID, m_scene.RegionInfo.RegionName);
286// }
287// }
288
289 UUID searchval = UUID.Zero; 264 UUID searchval = UUID.Zero;
290 265
291 removeitems.Clear(); 266 removeitems.Clear();
@@ -305,19 +280,9 @@ namespace OpenSim.Region.ClientStack.Linden
305 foreach (UUID ky in removeitems) 280 foreach (UUID ky in removeitems)
306 m_QueueUUIDAvatarMapping.Remove(ky); 281 m_QueueUUIDAvatarMapping.Remove(ky);
307 } 282 }
308 }
309 283
310 private void MakeChildAgent(ScenePresence avatar) 284 // m_log.DebugFormat("[EVENTQUEUE]: Deleted queues for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
311 { 285
312 //m_log.DebugFormat("[EVENTQUEUE]: Make Child agent {0} in region {1}.", avatar.UUID, m_scene.RegionInfo.RegionName);
313 //lock (m_ids)
314 // {
315 //if (m_ids.ContainsKey(avatar.UUID))
316 //{
317 // close the event queue.
318 //m_ids[avatar.UUID] = -1;
319 //}
320 //}
321 } 286 }
322 287
323 /// <summary> 288 /// <summary>
@@ -417,7 +382,12 @@ namespace OpenSim.Region.ClientStack.Linden
417 if (DebugLevel >= 2) 382 if (DebugLevel >= 2)
418 m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName); 383 m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName);
419 384
420 Queue<OSD> queue = TryGetQueue(pAgentId); 385 Queue<OSD> queue = GetQueue(pAgentId);
386 if (queue == null)
387 {
388 return NoEvents(requestID, pAgentId);
389 }
390
421 OSD element; 391 OSD element;
422 lock (queue) 392 lock (queue)
423 { 393 {