diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 39 |
3 files changed, 29 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 21c4a87..d47536a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2491,13 +2491,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2491 | /// </summary> | 2491 | /// </summary> |
2492 | /// <param name="client"></param> | 2492 | /// <param name="client"></param> |
2493 | /// <param name="type">The type of agent to add.</param> | 2493 | /// <param name="type">The type of agent to add.</param> |
2494 | public override void AddNewClient(IClientAPI client, PresenceType type) | 2494 | public override ISceneAgent AddNewClient(IClientAPI client, PresenceType type) |
2495 | { | 2495 | { |
2496 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); | 2496 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); |
2497 | bool vialogin = false; | 2497 | bool vialogin = false; |
2498 | 2498 | ||
2499 | if (aCircuit == null) // no good, didn't pass NewUserConnection successfully | 2499 | if (aCircuit == null) // no good, didn't pass NewUserConnection successfully |
2500 | return; | 2500 | return null; |
2501 | 2501 | ||
2502 | vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 || | 2502 | vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 || |
2503 | (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0; | 2503 | (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0; |
@@ -2552,16 +2552,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2552 | if (vialogin) | 2552 | if (vialogin) |
2553 | EventManager.TriggerOnClientLogin(client); | 2553 | EventManager.TriggerOnClientLogin(client); |
2554 | 2554 | ||
2555 | // Send all scene object to the new client | 2555 | return sp; |
2556 | Util.FireAndForget(delegate | ||
2557 | { | ||
2558 | EntityBase[] entities = Entities.GetEntities(); | ||
2559 | foreach(EntityBase e in entities) | ||
2560 | { | ||
2561 | if (e != null && e is SceneObjectGroup) | ||
2562 | ((SceneObjectGroup)e).SendFullUpdateToClient(client); | ||
2563 | } | ||
2564 | }); | ||
2565 | } | 2556 | } |
2566 | 2557 | ||
2567 | /// <summary> | 2558 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index a633c72..da15491 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
175 | 175 | ||
176 | #region Add/Remove Agent/Avatar | 176 | #region Add/Remove Agent/Avatar |
177 | 177 | ||
178 | public abstract void AddNewClient(IClientAPI client, PresenceType type); | 178 | public abstract ISceneAgent AddNewClient(IClientAPI client, PresenceType type); |
179 | public abstract void RemoveClient(UUID agentID, bool closeChildAgents); | 179 | public abstract void RemoveClient(UUID agentID, bool closeChildAgents); |
180 | 180 | ||
181 | public bool TryGetScenePresence(UUID agentID, out object scenePresence) | 181 | public bool TryGetScenePresence(UUID agentID, out object scenePresence) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5b9438b..8e55996 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -782,15 +782,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
782 | 782 | ||
783 | AdjustKnownSeeds(); | 783 | AdjustKnownSeeds(); |
784 | 784 | ||
785 | // we created a new ScenePresence (a new child agent) in a fresh region. | ||
786 | // Request info about all the (root) agents in this region | ||
787 | // Note: This won't send data *to* other clients in that region (children don't send) | ||
788 | |||
789 | // MIC: This gets called again in CompleteMovement | ||
790 | // SendInitialFullUpdateToAllClients(); | ||
791 | SendOtherAgentsAvatarDataToMe(); | ||
792 | SendOtherAgentsAppearanceToMe(); | ||
793 | |||
794 | RegisterToEvents(); | 785 | RegisterToEvents(); |
795 | SetDirectionVectors(); | 786 | SetDirectionVectors(); |
796 | 787 | ||
@@ -1191,9 +1182,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1191 | { | 1182 | { |
1192 | // DateTime startTime = DateTime.Now; | 1183 | // DateTime startTime = DateTime.Now; |
1193 | 1184 | ||
1194 | m_log.DebugFormat( | 1185 | // m_log.DebugFormat( |
1195 | "[SCENE PRESENCE]: Completing movement of {0} into region {1}", | 1186 | // "[SCENE PRESENCE]: Completing movement of {0} into region {1}", |
1196 | client.Name, Scene.RegionInfo.RegionName); | 1187 | // client.Name, Scene.RegionInfo.RegionName); |
1197 | 1188 | ||
1198 | Vector3 look = Velocity; | 1189 | Vector3 look = Velocity; |
1199 | if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) | 1190 | if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) |
@@ -1225,7 +1216,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1225 | //m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); | 1216 | //m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); |
1226 | 1217 | ||
1227 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | 1218 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); |
1228 | SendInitialData(); | 1219 | ValidateAndSendAppearanceAndAgentData(); |
1229 | 1220 | ||
1230 | // Create child agents in neighbouring regions | 1221 | // Create child agents in neighbouring regions |
1231 | if (openChildAgents && !IsChildAgent) | 1222 | if (openChildAgents && !IsChildAgent) |
@@ -2512,11 +2503,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
2512 | ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); | 2503 | ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); |
2513 | } | 2504 | } |
2514 | 2505 | ||
2506 | public void SendInitialDataToMe() | ||
2507 | { | ||
2508 | // we created a new ScenePresence (a new child agent) in a fresh region. | ||
2509 | // Request info about all the (root) agents in this region | ||
2510 | // Note: This won't send data *to* other clients in that region (children don't send) | ||
2511 | SendOtherAgentsAvatarDataToMe(); | ||
2512 | SendOtherAgentsAppearanceToMe(); | ||
2513 | |||
2514 | // Send all scene object to the new client | ||
2515 | Util.FireAndForget(delegate | ||
2516 | { | ||
2517 | EntityBase[] entities = Scene.Entities.GetEntities(); | ||
2518 | foreach(EntityBase e in entities) | ||
2519 | { | ||
2520 | if (e != null && e is SceneObjectGroup) | ||
2521 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); | ||
2522 | } | ||
2523 | }); | ||
2524 | } | ||
2525 | |||
2515 | /// <summary> | 2526 | /// <summary> |
2516 | /// Do everything required once a client completes its movement into a region and becomes | 2527 | /// Do everything required once a client completes its movement into a region and becomes |
2517 | /// a root agent. | 2528 | /// a root agent. |
2518 | /// </summary> | 2529 | /// </summary> |
2519 | private void SendInitialData() | 2530 | private void ValidateAndSendAppearanceAndAgentData() |
2520 | { | 2531 | { |
2521 | //m_log.DebugFormat("[SCENE PRESENCE] SendInitialData: {0} ({1})", Name, UUID); | 2532 | //m_log.DebugFormat("[SCENE PRESENCE] SendInitialData: {0} ({1})", Name, UUID); |
2522 | // Moved this into CompleteMovement to ensure that Appearance is initialized before | 2533 | // Moved this into CompleteMovement to ensure that Appearance is initialized before |