diff options
author | Justin Clark-Casey (justincc) | 2014-08-15 21:34:58 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-08-15 21:47:34 +0100 |
commit | 91e1aaa5d41c29fa17609c69ca8bc2a8017dc161 (patch) | |
tree | 32ff0f7767c9090052261da81b9903063c0d5838 /OpenSim/Region/Framework/Scenes | |
parent | Added RestrictEmail to make llEmail only send to avatars email address if true. (diff) | |
download | opensim-SC_OLD-91e1aaa5d41c29fa17609c69ca8bc2a8017dc161.zip opensim-SC_OLD-91e1aaa5d41c29fa17609c69ca8bc2a8017dc161.tar.gz opensim-SC_OLD-91e1aaa5d41c29fa17609c69ca8bc2a8017dc161.tar.bz2 opensim-SC_OLD-91e1aaa5d41c29fa17609c69ca8bc2a8017dc161.tar.xz |
On teleport to a region that already has a child agent established (e.g. a neighbour) don't resend all the initial avatar and object data again.
This is unnecessary since it has been received (and data continues to be received) in the existing child connection.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 75 |
1 files changed, 43 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9ea0269..272fa16 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -287,6 +287,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
287 | } | 287 | } |
288 | 288 | ||
289 | /// <summary> | 289 | /// <summary> |
290 | /// Set if initial data about the scene (avatars, objects) has been sent to the ControllingClient. | ||
291 | /// </summary> | ||
292 | public bool SentInitialDataToClient { get; private set; } | ||
293 | |||
294 | /// <summary> | ||
290 | /// Copy of the script states while the agent is in transit. This state may | 295 | /// Copy of the script states while the agent is in transit. This state may |
291 | /// need to be placed back in case of transfer fail. | 296 | /// need to be placed back in case of transfer fail. |
292 | /// </summary> | 297 | /// </summary> |
@@ -1256,7 +1261,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1256 | } | 1261 | } |
1257 | } | 1262 | } |
1258 | 1263 | ||
1259 | SendAvatarDataToAllAgents(); | 1264 | SendAvatarDataToAllClients(); |
1260 | 1265 | ||
1261 | // send the animations of the other presences to me | 1266 | // send the animations of the other presences to me |
1262 | m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) | 1267 | m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) |
@@ -1296,7 +1301,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1296 | m_log.DebugFormat("[SCENE PRESENCE]: Forcing viewers to update the avatar name for " + Name); | 1301 | m_log.DebugFormat("[SCENE PRESENCE]: Forcing viewers to update the avatar name for " + Name); |
1297 | 1302 | ||
1298 | UseFakeGroupTitle = true; | 1303 | UseFakeGroupTitle = true; |
1299 | SendAvatarDataToAllAgents(false); | 1304 | SendAvatarDataToAllClients(false); |
1300 | 1305 | ||
1301 | Util.FireAndForget(o => | 1306 | Util.FireAndForget(o => |
1302 | { | 1307 | { |
@@ -1307,7 +1312,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1307 | Thread.Sleep(5000); | 1312 | Thread.Sleep(5000); |
1308 | 1313 | ||
1309 | UseFakeGroupTitle = false; | 1314 | UseFakeGroupTitle = false; |
1310 | SendAvatarDataToAllAgents(false); | 1315 | SendAvatarDataToAllClients(false); |
1311 | }); | 1316 | }); |
1312 | } | 1317 | } |
1313 | 1318 | ||
@@ -1742,9 +1747,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1742 | // Tell the client that we're totally ready | 1747 | // Tell the client that we're totally ready |
1743 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | 1748 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); |
1744 | 1749 | ||
1745 | // Remember in HandleUseCircuitCode, we delayed this to here | 1750 | // Child agents send initial data up in LLUDPServer.HandleUseCircuitCode() |
1746 | if (m_teleportFlags > 0) | 1751 | if (!SentInitialDataToClient) |
1747 | SendInitialDataToMe(); | 1752 | SendInitialDataToClient(); |
1748 | 1753 | ||
1749 | // m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); | 1754 | // m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); |
1750 | 1755 | ||
@@ -2652,7 +2657,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2652 | 2657 | ||
2653 | if (satOnObject) | 2658 | if (satOnObject) |
2654 | { | 2659 | { |
2655 | SendAvatarDataToAllAgents(); | 2660 | SendAvatarDataToAllClients(); |
2656 | m_requestedSitTargetID = 0; | 2661 | m_requestedSitTargetID = 0; |
2657 | 2662 | ||
2658 | part.RemoveSittingAvatar(this); | 2663 | part.RemoveSittingAvatar(this); |
@@ -2947,7 +2952,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2947 | Animator.TrySetMovementAnimation("SIT_GROUND"); | 2952 | Animator.TrySetMovementAnimation("SIT_GROUND"); |
2948 | else | 2953 | else |
2949 | Animator.TrySetMovementAnimation("SIT"); | 2954 | Animator.TrySetMovementAnimation("SIT"); |
2950 | SendAvatarDataToAllAgents(); | 2955 | SendAvatarDataToAllClients(); |
2951 | 2956 | ||
2952 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | 2957 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); |
2953 | } | 2958 | } |
@@ -3062,7 +3067,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3062 | sitAnimation = part.SitAnimation; | 3067 | sitAnimation = part.SitAnimation; |
3063 | } | 3068 | } |
3064 | Animator.TrySetMovementAnimation(sitAnimation); | 3069 | Animator.TrySetMovementAnimation(sitAnimation); |
3065 | SendAvatarDataToAllAgents(); | 3070 | SendAvatarDataToAllClients(); |
3066 | TriggerScenePresenceUpdated(); | 3071 | TriggerScenePresenceUpdated(); |
3067 | } | 3072 | } |
3068 | } | 3073 | } |
@@ -3185,7 +3190,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3185 | // grab the latest PhysicsActor velocity, whereas m_velocity is often | 3190 | // grab the latest PhysicsActor velocity, whereas m_velocity is often |
3186 | // storing a requested force instead of an actual traveling velocity | 3191 | // storing a requested force instead of an actual traveling velocity |
3187 | if (Appearance.AvatarSize != m_lastSize && !IsLoggingIn) | 3192 | if (Appearance.AvatarSize != m_lastSize && !IsLoggingIn) |
3188 | SendAvatarDataToAllAgents(); | 3193 | SendAvatarDataToAllClients(); |
3189 | 3194 | ||
3190 | // Allow any updates for sitting avatars to that llSetPrimitiveLinkParams() can work for very | 3195 | // Allow any updates for sitting avatars to that llSetPrimitiveLinkParams() can work for very |
3191 | // small increments (e.g. sit position adjusters). An alternative may be to eliminate the tolerance | 3196 | // small increments (e.g. sit position adjusters). An alternative may be to eliminate the tolerance |
@@ -3339,16 +3344,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
3339 | ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); | 3344 | ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); |
3340 | } | 3345 | } |
3341 | 3346 | ||
3342 | public void SendInitialDataToMe() | 3347 | public void SendInitialDataToClient() |
3343 | { | 3348 | { |
3349 | SentInitialDataToClient = true; | ||
3350 | |||
3344 | // Send all scene object to the new client | 3351 | // Send all scene object to the new client |
3345 | Util.RunThreadNoTimeout(delegate | 3352 | Util.RunThreadNoTimeout(delegate |
3346 | { | 3353 | { |
3354 | m_log.DebugFormat( | ||
3355 | "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", | ||
3356 | IsChildAgent ? "child" : "root", Name, Scene.Name, m_teleportFlags); | ||
3357 | |||
3347 | // we created a new ScenePresence (a new child agent) in a fresh region. | 3358 | // we created a new ScenePresence (a new child agent) in a fresh region. |
3348 | // Request info about all the (root) agents in this region | 3359 | // Request info about all the (root) agents in this region |
3349 | // Note: This won't send data *to* other clients in that region (children don't send) | 3360 | // Note: This won't send data *to* other clients in that region (children don't send) |
3350 | SendOtherAgentsAvatarDataToMe(); | 3361 | SendOtherAgentsAvatarDataToClient(); |
3351 | SendOtherAgentsAppearanceToMe(); | 3362 | SendOtherAgentsAppearanceToClient(); |
3352 | 3363 | ||
3353 | EntityBase[] entities = Scene.Entities.GetEntities(); | 3364 | EntityBase[] entities = Scene.Entities.GetEntities(); |
3354 | foreach (EntityBase e in entities) | 3365 | foreach (EntityBase e in entities) |
@@ -3357,7 +3368,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3357 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); | 3368 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); |
3358 | } | 3369 | } |
3359 | 3370 | ||
3360 | }, "SendInitialDataToMe", null); | 3371 | }, "SendInitialDataToClient", null); |
3361 | } | 3372 | } |
3362 | 3373 | ||
3363 | /// <summary> | 3374 | /// <summary> |
@@ -3390,10 +3401,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3390 | // getting other avatars information was initiated elsewhere immediately after the child circuit connected... don't do it | 3401 | // getting other avatars information was initiated elsewhere immediately after the child circuit connected... don't do it |
3391 | // again here... this comes after the cached appearance check because the avatars | 3402 | // again here... this comes after the cached appearance check because the avatars |
3392 | // appearance goes into the avatar update packet | 3403 | // appearance goes into the avatar update packet |
3393 | SendAvatarDataToAllAgents(); | 3404 | SendAvatarDataToAllClients(); |
3394 | 3405 | ||
3395 | // This invocation always shows up in the viewer logs as an error. Is it needed? | 3406 | // This invocation always shows up in the viewer logs as an error. Is it needed? |
3396 | SendAppearanceToAgent(this); | 3407 | SendAppearanceToClient(this); |
3397 | 3408 | ||
3398 | // If we are using the the cached appearance then send it out to everyone | 3409 | // If we are using the the cached appearance then send it out to everyone |
3399 | if (cachedappearance) | 3410 | if (cachedappearance) |
@@ -3403,20 +3414,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
3403 | // If the avatars baked textures are all in the cache, then we have a | 3414 | // If the avatars baked textures are all in the cache, then we have a |
3404 | // complete appearance... send it out, if not, then we'll send it when | 3415 | // complete appearance... send it out, if not, then we'll send it when |
3405 | // the avatar finishes updating its appearance | 3416 | // the avatar finishes updating its appearance |
3406 | SendAppearanceToAllOtherAgents(); | 3417 | SendAppearanceToAllOtherClients(); |
3407 | } | 3418 | } |
3408 | } | 3419 | } |
3409 | 3420 | ||
3410 | public void SendAvatarDataToAllAgents() | 3421 | public void SendAvatarDataToAllClients() |
3411 | { | 3422 | { |
3412 | SendAvatarDataToAllAgents(true); | 3423 | SendAvatarDataToAllClients(true); |
3413 | } | 3424 | } |
3414 | 3425 | ||
3415 | /// <summary> | 3426 | /// <summary> |
3416 | /// Send this agent's avatar data to all other root and child agents in the scene | 3427 | /// Send this agent's avatar data to all other root and child agents in the scene |
3417 | /// This agent must be root. This avatar will receive its own update. | 3428 | /// This agent must be root. This avatar will receive its own update. |
3418 | /// </summary> | 3429 | /// </summary> |
3419 | public void SendAvatarDataToAllAgents(bool full) | 3430 | public void SendAvatarDataToAllClients(bool full) |
3420 | { | 3431 | { |
3421 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAllAgents: {0} ({1})", Name, UUID); | 3432 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAllAgents: {0} ({1})", Name, UUID); |
3422 | // only send update from root agents to other clients; children are only "listening posts" | 3433 | // only send update from root agents to other clients; children are only "listening posts" |
@@ -3435,7 +3446,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3435 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 3446 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
3436 | { | 3447 | { |
3437 | if (full) | 3448 | if (full) |
3438 | SendAvatarDataToAgent(scenePresence); | 3449 | SendAvatarDataToClient(scenePresence); |
3439 | else | 3450 | else |
3440 | scenePresence.ControllingClient.SendAvatarDataImmediate(this); | 3451 | scenePresence.ControllingClient.SendAvatarDataImmediate(this); |
3441 | count++; | 3452 | count++; |
@@ -3448,7 +3459,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3448 | /// Send avatar data for all other root agents to this agent, this agent | 3459 | /// Send avatar data for all other root agents to this agent, this agent |
3449 | /// can be either a child or root | 3460 | /// can be either a child or root |
3450 | /// </summary> | 3461 | /// </summary> |
3451 | public void SendOtherAgentsAvatarDataToMe() | 3462 | public void SendOtherAgentsAvatarDataToClient() |
3452 | { | 3463 | { |
3453 | int count = 0; | 3464 | int count = 0; |
3454 | m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) | 3465 | m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) |
@@ -3457,7 +3468,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3457 | if (scenePresence.UUID == UUID) | 3468 | if (scenePresence.UUID == UUID) |
3458 | return; | 3469 | return; |
3459 | 3470 | ||
3460 | scenePresence.SendAvatarDataToAgent(this); | 3471 | scenePresence.SendAvatarDataToClient(this); |
3461 | count++; | 3472 | count++; |
3462 | }); | 3473 | }); |
3463 | 3474 | ||
@@ -3468,9 +3479,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3468 | /// Send avatar data to an agent. | 3479 | /// Send avatar data to an agent. |
3469 | /// </summary> | 3480 | /// </summary> |
3470 | /// <param name="avatar"></param> | 3481 | /// <param name="avatar"></param> |
3471 | public void SendAvatarDataToAgent(ScenePresence avatar) | 3482 | public void SendAvatarDataToClient(ScenePresence avatar) |
3472 | { | 3483 | { |
3473 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); | 3484 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToClient from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); |
3474 | 3485 | ||
3475 | avatar.ControllingClient.SendAvatarDataImmediate(this); | 3486 | avatar.ControllingClient.SendAvatarDataImmediate(this); |
3476 | Animator.SendAnimPackToClient(avatar.ControllingClient); | 3487 | Animator.SendAnimPackToClient(avatar.ControllingClient); |
@@ -3480,9 +3491,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3480 | /// Send this agent's appearance to all other root and child agents in the scene | 3491 | /// Send this agent's appearance to all other root and child agents in the scene |
3481 | /// This agent must be root. | 3492 | /// This agent must be root. |
3482 | /// </summary> | 3493 | /// </summary> |
3483 | public void SendAppearanceToAllOtherAgents() | 3494 | public void SendAppearanceToAllOtherClients() |
3484 | { | 3495 | { |
3485 | // m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID); | 3496 | // m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherClients: {0} {1}", Name, UUID); |
3486 | 3497 | ||
3487 | // only send update from root agents to other clients; children are only "listening posts" | 3498 | // only send update from root agents to other clients; children are only "listening posts" |
3488 | if (IsChildAgent) | 3499 | if (IsChildAgent) |
@@ -3501,7 +3512,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3501 | if (scenePresence.UUID == UUID) | 3512 | if (scenePresence.UUID == UUID) |
3502 | return; | 3513 | return; |
3503 | 3514 | ||
3504 | SendAppearanceToAgent(scenePresence); | 3515 | SendAppearanceToClient(scenePresence); |
3505 | count++; | 3516 | count++; |
3506 | }); | 3517 | }); |
3507 | 3518 | ||
@@ -3512,9 +3523,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3512 | /// Send appearance from all other root agents to this agent. this agent | 3523 | /// Send appearance from all other root agents to this agent. this agent |
3513 | /// can be either root or child | 3524 | /// can be either root or child |
3514 | /// </summary> | 3525 | /// </summary> |
3515 | public void SendOtherAgentsAppearanceToMe() | 3526 | public void SendOtherAgentsAppearanceToClient() |
3516 | { | 3527 | { |
3517 | // m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID); | 3528 | // m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToClient {0} {1}", Name, UUID); |
3518 | 3529 | ||
3519 | int count = 0; | 3530 | int count = 0; |
3520 | m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) | 3531 | m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) |
@@ -3523,7 +3534,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3523 | if (scenePresence.UUID == UUID) | 3534 | if (scenePresence.UUID == UUID) |
3524 | return; | 3535 | return; |
3525 | 3536 | ||
3526 | scenePresence.SendAppearanceToAgent(this); | 3537 | scenePresence.SendAppearanceToClient(this); |
3527 | count++; | 3538 | count++; |
3528 | }); | 3539 | }); |
3529 | 3540 | ||
@@ -3534,7 +3545,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3534 | /// Send appearance data to an agent. | 3545 | /// Send appearance data to an agent. |
3535 | /// </summary> | 3546 | /// </summary> |
3536 | /// <param name="avatar"></param> | 3547 | /// <param name="avatar"></param> |
3537 | public void SendAppearanceToAgent(ScenePresence avatar) | 3548 | public void SendAppearanceToClient(ScenePresence avatar) |
3538 | { | 3549 | { |
3539 | // m_log.DebugFormat( | 3550 | // m_log.DebugFormat( |
3540 | // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); | 3551 | // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); |