diff options
author | Justin Clark-Casey (justincc) | 2011-12-08 18:34:23 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-12-08 18:34:23 +0000 |
commit | f61e54892f2284b6f89bacf3069467c05b2eea11 (patch) | |
tree | 87cb0933707a8e02f920910c7669273232021470 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Simplify Scene.AddNewClient() (diff) | |
download | opensim-SC_OLD-f61e54892f2284b6f89bacf3069467c05b2eea11.zip opensim-SC_OLD-f61e54892f2284b6f89bacf3069467c05b2eea11.tar.gz opensim-SC_OLD-f61e54892f2284b6f89bacf3069467c05b2eea11.tar.bz2 opensim-SC_OLD-f61e54892f2284b6f89bacf3069467c05b2eea11.tar.xz |
On a new client circuit, send the initial reply ack to let the client know it's live before sending other data.
This means that avatar/appearance data of other avatars and scene objects for a client will be sent after the ack rather than possibly before.
This may stop some avatars appearing grey on login.
This introduces a new OpenSim.Framework.ISceneAgent to accompany the existing OpenSim.Framework.ISceneObject and ISceneEntity
This allows IClientAPI to handle this as it can't reference OpenSim.Region.Framework.Interfaces
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 39 |
1 files changed, 25 insertions, 14 deletions
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 |