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.cs33
1 files changed, 23 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 4ae0eb1..6e4ac98 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1151,9 +1151,9 @@ namespace OpenSim.Region.Framework.Scenes
1151 1151
1152 MovementFlag = 0; 1152 MovementFlag = 0;
1153 1153
1154 m_scene.EventManager.TriggerOnMakeRootAgent(this); 1154 // DIVA NOTE: I moved TriggerOnMakeRootAgent out of here and into the end of
1155 1155 // CompleteMovement. We don't want modules doing heavy computation before CompleteMovement
1156 m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; 1156 // is over.
1157 } 1157 }
1158 1158
1159 public int GetStateSource() 1159 public int GetStateSource()
@@ -1519,10 +1519,15 @@ namespace OpenSim.Region.Framework.Scenes
1519 bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); 1519 bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
1520 MakeRootAgent(AbsolutePosition, flying); 1520 MakeRootAgent(AbsolutePosition, flying);
1521 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); 1521 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
1522 // Remember in HandleUseCircuitCode, we delayed this to here
1523 // This will also send the initial data to clients when TP to a neighboring region.
1524 // Not ideal, but until we know we're TP-ing from a neighboring region, there's not much we can do
1525 if (m_teleportFlags > 0)
1526 SendInitialDataToMe();
1522 1527
1523// m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); 1528// m_log.DebugFormat("[SCENE PRESENCE] Completed movement");
1524 1529
1525 if ((m_callbackURI != null) && !m_callbackURI.Equals("")) 1530 if (!string.IsNullOrEmpty(m_callbackURI))
1526 { 1531 {
1527 // We cannot sleep here since this would hold up the inbound packet processing thread, as 1532 // We cannot sleep here since this would hold up the inbound packet processing thread, as
1528 // CompleteMovement() is executed synchronously. However, it might be better to delay the release 1533 // CompleteMovement() is executed synchronously. However, it might be better to delay the release
@@ -1550,9 +1555,6 @@ namespace OpenSim.Region.Framework.Scenes
1550 // Create child agents in neighbouring regions 1555 // Create child agents in neighbouring regions
1551 if (openChildAgents && !IsChildAgent) 1556 if (openChildAgents && !IsChildAgent)
1552 { 1557 {
1553 // Remember in HandleUseCircuitCode, we delayed this to here
1554 SendInitialDataToMe();
1555
1556 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); 1558 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
1557 if (m_agentTransfer != null) 1559 if (m_agentTransfer != null)
1558 m_agentTransfer.EnableChildAgents(this); 1560 m_agentTransfer.EnableChildAgents(this);
@@ -1575,6 +1577,11 @@ namespace OpenSim.Region.Framework.Scenes
1575// m_log.DebugFormat( 1577// m_log.DebugFormat(
1576// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", 1578// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
1577// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); 1579// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
1580
1581 // DIVA NOTE: moved this here from MakeRoot. We don't want modules making heavy
1582 // computations before CompleteMovement is over
1583 m_scene.EventManager.TriggerOnMakeRootAgent(this);
1584
1578 } 1585 }
1579 1586
1580 /// <summary> 1587 /// <summary>
@@ -2886,11 +2893,12 @@ namespace OpenSim.Region.Framework.Scenes
2886 SendOtherAgentsAppearanceToMe(); 2893 SendOtherAgentsAppearanceToMe();
2887 2894
2888 EntityBase[] entities = Scene.Entities.GetEntities(); 2895 EntityBase[] entities = Scene.Entities.GetEntities();
2889 foreach(EntityBase e in entities) 2896 foreach (EntityBase e in entities)
2890 { 2897 {
2891 if (e != null && e is SceneObjectGroup) 2898 if (e != null && e is SceneObjectGroup)
2892 ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); 2899 ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient);
2893 } 2900 }
2901
2894 }); 2902 });
2895 } 2903 }
2896 2904
@@ -3116,7 +3124,7 @@ namespace OpenSim.Region.Framework.Scenes
3116 cadu.Velocity = Velocity; 3124 cadu.Velocity = Velocity;
3117 3125
3118 AgentPosition agentpos = new AgentPosition(); 3126 AgentPosition agentpos = new AgentPosition();
3119 agentpos.CopyFrom(cadu); 3127 agentpos.CopyFrom(cadu, ControllingClient.SessionId);
3120 3128
3121 // Let's get this out of the update loop 3129 // Let's get this out of the update loop
3122 Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); }); 3130 Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); });
@@ -3355,7 +3363,11 @@ namespace OpenSim.Region.Framework.Scenes
3355 { 3363 {
3356 m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents"); 3364 m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents");
3357 3365
3358 m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, byebyeRegions); 3366 AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(UUID);
3367 string auth = string.Empty;
3368 if (acd != null)
3369 auth = acd.SessionID.ToString();
3370 m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, auth, byebyeRegions);
3359 } 3371 }
3360 3372
3361 foreach (ulong handle in byebyeRegions) 3373 foreach (ulong handle in byebyeRegions)
@@ -3456,6 +3468,7 @@ namespace OpenSim.Region.Framework.Scenes
3456 3468
3457 cAgent.AgentID = UUID; 3469 cAgent.AgentID = UUID;
3458 cAgent.RegionID = Scene.RegionInfo.RegionID; 3470 cAgent.RegionID = Scene.RegionInfo.RegionID;
3471 cAgent.SessionID = ControllingClient.SessionId;
3459 3472
3460 cAgent.Position = AbsolutePosition; 3473 cAgent.Position = AbsolutePosition;
3461 cAgent.Velocity = m_velocity; 3474 cAgent.Velocity = m_velocity;