aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs31
1 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 774546c..990ef6e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1010,7 +1010,9 @@ namespace OpenSim.Region.Framework.Scenes
1010 // recorded, which stops the input from being processed. 1010 // recorded, which stops the input from being processed.
1011 MovementFlag = 0; 1011 MovementFlag = 0;
1012 1012
1013 m_scene.EventManager.TriggerOnMakeRootAgent(this); 1013 // DIVA NOTE: I moved TriggerOnMakeRootAgent out of here and into the end of
1014 // CompleteMovement. We don't want modules doing heavy computation before CompleteMovement
1015 // is over.
1014 } 1016 }
1015 1017
1016 public int GetStateSource() 1018 public int GetStateSource()
@@ -1327,10 +1329,15 @@ namespace OpenSim.Region.Framework.Scenes
1327 bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); 1329 bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
1328 MakeRootAgent(AbsolutePosition, flying); 1330 MakeRootAgent(AbsolutePosition, flying);
1329 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); 1331 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
1332 // Remember in HandleUseCircuitCode, we delayed this to here
1333 // This will also send the initial data to clients when TP to a neighboring region.
1334 // Not ideal, but until we know we're TP-ing from a neighboring region, there's not much we can do
1335 if (m_teleportFlags > 0)
1336 SendInitialDataToMe();
1330 1337
1331// m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); 1338// m_log.DebugFormat("[SCENE PRESENCE] Completed movement");
1332 1339
1333 if ((m_callbackURI != null) && !m_callbackURI.Equals("")) 1340 if (!string.IsNullOrEmpty(m_callbackURI))
1334 { 1341 {
1335 // We cannot sleep here since this would hold up the inbound packet processing thread, as 1342 // We cannot sleep here since this would hold up the inbound packet processing thread, as
1336 // CompleteMovement() is executed synchronously. However, it might be better to delay the release 1343 // CompleteMovement() is executed synchronously. However, it might be better to delay the release
@@ -1358,9 +1365,6 @@ namespace OpenSim.Region.Framework.Scenes
1358 // Create child agents in neighbouring regions 1365 // Create child agents in neighbouring regions
1359 if (openChildAgents && !IsChildAgent) 1366 if (openChildAgents && !IsChildAgent)
1360 { 1367 {
1361 // Remember in HandleUseCircuitCode, we delayed this to here
1362 SendInitialDataToMe();
1363
1364 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); 1368 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
1365 if (m_agentTransfer != null) 1369 if (m_agentTransfer != null)
1366 Util.FireAndForget(delegate { m_agentTransfer.EnableChildAgents(this); }); 1370 Util.FireAndForget(delegate { m_agentTransfer.EnableChildAgents(this); });
@@ -1382,6 +1386,11 @@ namespace OpenSim.Region.Framework.Scenes
1382// m_log.DebugFormat( 1386// m_log.DebugFormat(
1383// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", 1387// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
1384// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); 1388// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
1389
1390 // DIVA NOTE: moved this here from MakeRoot. We don't want modules making heavy
1391 // computations before CompleteMovement is over
1392 m_scene.EventManager.TriggerOnMakeRootAgent(this);
1393
1385 } 1394 }
1386 1395
1387 /// <summary> 1396 /// <summary>
@@ -2689,11 +2698,12 @@ namespace OpenSim.Region.Framework.Scenes
2689 SendOtherAgentsAppearanceToMe(); 2698 SendOtherAgentsAppearanceToMe();
2690 2699
2691 EntityBase[] entities = Scene.Entities.GetEntities(); 2700 EntityBase[] entities = Scene.Entities.GetEntities();
2692 foreach(EntityBase e in entities) 2701 foreach (EntityBase e in entities)
2693 { 2702 {
2694 if (e != null && e is SceneObjectGroup) 2703 if (e != null && e is SceneObjectGroup)
2695 ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); 2704 ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient);
2696 } 2705 }
2706
2697 }); 2707 });
2698 } 2708 }
2699 2709
@@ -2917,7 +2927,7 @@ namespace OpenSim.Region.Framework.Scenes
2917 cadu.Velocity = Velocity; 2927 cadu.Velocity = Velocity;
2918 2928
2919 AgentPosition agentpos = new AgentPosition(); 2929 AgentPosition agentpos = new AgentPosition();
2920 agentpos.CopyFrom(cadu); 2930 agentpos.CopyFrom(cadu, ControllingClient.SessionId);
2921 2931
2922 // Let's get this out of the update loop 2932 // Let's get this out of the update loop
2923 Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); }); 2933 Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); });
@@ -3155,7 +3165,11 @@ namespace OpenSim.Region.Framework.Scenes
3155 { 3165 {
3156 m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents"); 3166 m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents");
3157 3167
3158 m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, byebyeRegions); 3168 AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(UUID);
3169 string auth = string.Empty;
3170 if (acd != null)
3171 auth = acd.SessionID.ToString();
3172 m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, auth, byebyeRegions);
3159 } 3173 }
3160 3174
3161 foreach (ulong handle in byebyeRegions) 3175 foreach (ulong handle in byebyeRegions)
@@ -3252,6 +3266,7 @@ namespace OpenSim.Region.Framework.Scenes
3252 3266
3253 cAgent.AgentID = UUID; 3267 cAgent.AgentID = UUID;
3254 cAgent.RegionID = Scene.RegionInfo.RegionID; 3268 cAgent.RegionID = Scene.RegionInfo.RegionID;
3269 cAgent.SessionID = ControllingClient.SessionId;
3255 3270
3256 cAgent.Position = AbsolutePosition; 3271 cAgent.Position = AbsolutePosition;
3257 cAgent.Velocity = m_velocity; 3272 cAgent.Velocity = m_velocity;