diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
4 files changed, 42 insertions, 63 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 62b25d0..95cc6b7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -361,22 +361,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
361 | 361 | ||
362 | // If we're an NPC then skip all the item checks and manipulations since we don't have an | 362 | // If we're an NPC then skip all the item checks and manipulations since we don't have an |
363 | // inventory right now. | 363 | // inventory right now. |
364 | SceneObjectGroup objatt | 364 | RezSingleAttachmentFromInventoryInternal( |
365 | = RezSingleAttachmentFromInventoryInternal( | ||
366 | sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, attachmentPt, true, d); | 365 | sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, attachmentPt, true, d); |
367 | |||
368 | |||
369 | if (ThrottlePer100PrimsRezzed > 0) | ||
370 | { | ||
371 | int throttleMs = (int)Math.Round((float)objatt.PrimCount / 100 * ThrottlePer100PrimsRezzed); | ||
372 | |||
373 | if (DebugLevel > 0) | ||
374 | m_log.DebugFormat( | ||
375 | "[ATTACHMENTS MODULE]: Throttling by {0}ms after rez of {1} with {2} prims for attachment to {3} on point {4} in {5}", | ||
376 | throttleMs, objatt.Name, objatt.PrimCount, sp.Name, attachmentPt, m_scene.Name); | ||
377 | |||
378 | Thread.Sleep(throttleMs); | ||
379 | } | ||
380 | } | 366 | } |
381 | catch (Exception e) | 367 | catch (Exception e) |
382 | { | 368 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 35045b5..62acd78 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -844,7 +844,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
844 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID); | 844 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID); |
845 | TestClient tc = new TestClient(acd, sceneA); | 845 | TestClient tc = new TestClient(acd, sceneA); |
846 | List<TestClient> destinationTestClients = new List<TestClient>(); | 846 | List<TestClient> destinationTestClients = new List<TestClient>(); |
847 | EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients); | 847 | EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients); |
848 | 848 | ||
849 | ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd); | 849 | ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd); |
850 | beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32); | 850 | beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32); |
@@ -925,7 +925,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
925 | IConfig modulesConfig = config.AddConfig("Modules"); | 925 | IConfig modulesConfig = config.AddConfig("Modules"); |
926 | modulesConfig.Set("EntityTransferModule", etmA.Name); | 926 | modulesConfig.Set("EntityTransferModule", etmA.Name); |
927 | modulesConfig.Set("SimulationServices", lscm.Name); | 927 | modulesConfig.Set("SimulationServices", lscm.Name); |
928 | IConfig entityTransferConfig = config.AddConfig("EntityTransfer"); | ||
929 | 928 | ||
930 | modulesConfig.Set("InventoryAccessModule", "BasicInventoryAccessModule"); | 929 | modulesConfig.Set("InventoryAccessModule", "BasicInventoryAccessModule"); |
931 | 930 | ||
@@ -944,7 +943,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
944 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID); | 943 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID); |
945 | TestClient tc = new TestClient(acd, sceneA); | 944 | TestClient tc = new TestClient(acd, sceneA); |
946 | List<TestClient> destinationTestClients = new List<TestClient>(); | 945 | List<TestClient> destinationTestClients = new List<TestClient>(); |
947 | EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients); | 946 | EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients); |
948 | 947 | ||
949 | ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd); | 948 | ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd); |
950 | beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32); | 949 | beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32); |
@@ -966,7 +965,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
966 | // Both these operations will occur on different threads and will wait for each other. | 965 | // Both these operations will occur on different threads and will wait for each other. |
967 | // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 | 966 | // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 |
968 | // test protocol, where we are trying to avoid unpredictable async operations in regression tests. | 967 | // test protocol, where we are trying to avoid unpredictable async operations in regression tests. |
969 | ((TestClient)beforeTeleportSp.ControllingClient).OnTestClientSendRegionTeleport | 968 | tc.OnTestClientSendRegionTeleport |
970 | += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) | 969 | += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) |
971 | => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); | 970 | => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); |
972 | 971 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index c04098c..966a05c 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -307,7 +307,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
307 | } | 307 | } |
308 | 308 | ||
309 | string serverURI = string.Empty; | 309 | string serverURI = string.Empty; |
310 | bool foreign = GetUserProfileServerURI(targetID, out serverURI); | 310 | GetUserProfileServerURI(targetID, out serverURI); |
311 | UUID creatorId = UUID.Zero; | 311 | UUID creatorId = UUID.Zero; |
312 | 312 | ||
313 | OSDMap parameters= new OSDMap(); | 313 | OSDMap parameters= new OSDMap(); |
@@ -372,7 +372,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
372 | } | 372 | } |
373 | 373 | ||
374 | string serverURI = string.Empty; | 374 | string serverURI = string.Empty; |
375 | bool foreign = GetUserProfileServerURI(target, out serverURI); | 375 | GetUserProfileServerURI(target, out serverURI); |
376 | 376 | ||
377 | object Ad = (object)ad; | 377 | object Ad = (object)ad; |
378 | if(!JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString())) | 378 | if(!JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString())) |
@@ -441,10 +441,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
441 | Vector3 pos = remoteClient.SceneAgent.AbsolutePosition; | 441 | Vector3 pos = remoteClient.SceneAgent.AbsolutePosition; |
442 | ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y); | 442 | ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y); |
443 | ScenePresence p = FindPresence(remoteClient.AgentId); | 443 | ScenePresence p = FindPresence(remoteClient.AgentId); |
444 | Vector3 avaPos = p.AbsolutePosition; | 444 | // Vector3 avaPos = p.AbsolutePosition; |
445 | 445 | ||
446 | string serverURI = string.Empty; | 446 | string serverURI = string.Empty; |
447 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 447 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
448 | 448 | ||
449 | if (land == null) | 449 | if (land == null) |
450 | { | 450 | { |
@@ -470,7 +470,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
470 | 470 | ||
471 | object Ad = ad; | 471 | object Ad = ad; |
472 | 472 | ||
473 | OSD X = OSD.SerializeMembers(Ad); | 473 | OSD.SerializeMembers(Ad); |
474 | 474 | ||
475 | if(!JsonRpcRequest(ref Ad, "classified_update", serverURI, UUID.Random().ToString())) | 475 | if(!JsonRpcRequest(ref Ad, "classified_update", serverURI, UUID.Random().ToString())) |
476 | { | 476 | { |
@@ -491,7 +491,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
491 | public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient) | 491 | public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient) |
492 | { | 492 | { |
493 | string serverURI = string.Empty; | 493 | string serverURI = string.Empty; |
494 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 494 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
495 | 495 | ||
496 | UUID classifiedId; | 496 | UUID classifiedId; |
497 | OSDMap parameters= new OSDMap(); | 497 | OSDMap parameters= new OSDMap(); |
@@ -541,7 +541,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
541 | } | 541 | } |
542 | 542 | ||
543 | string serverURI = string.Empty; | 543 | string serverURI = string.Empty; |
544 | bool foreign = GetUserProfileServerURI(targetId, out serverURI); | 544 | GetUserProfileServerURI(targetId, out serverURI); |
545 | 545 | ||
546 | OSDMap parameters= new OSDMap(); | 546 | OSDMap parameters= new OSDMap(); |
547 | parameters.Add("creatorId", OSD.FromUUID(targetId)); | 547 | parameters.Add("creatorId", OSD.FromUUID(targetId)); |
@@ -592,7 +592,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
592 | UUID targetID; | 592 | UUID targetID; |
593 | UUID.TryParse(args[0], out targetID); | 593 | UUID.TryParse(args[0], out targetID); |
594 | string serverURI = string.Empty; | 594 | string serverURI = string.Empty; |
595 | bool foreign = GetUserProfileServerURI(targetID, out serverURI); | 595 | GetUserProfileServerURI(targetID, out serverURI); |
596 | IClientAPI remoteClient = (IClientAPI)sender; | 596 | IClientAPI remoteClient = (IClientAPI)sender; |
597 | 597 | ||
598 | UserProfilePick pick = new UserProfilePick(); | 598 | UserProfilePick pick = new UserProfilePick(); |
@@ -660,7 +660,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
660 | m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); | 660 | m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); |
661 | UserProfilePick pick = new UserProfilePick(); | 661 | UserProfilePick pick = new UserProfilePick(); |
662 | string serverURI = string.Empty; | 662 | string serverURI = string.Empty; |
663 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 663 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
664 | ScenePresence p = FindPresence(remoteClient.AgentId); | 664 | ScenePresence p = FindPresence(remoteClient.AgentId); |
665 | 665 | ||
666 | Vector3 avaPos = p.AbsolutePosition; | 666 | Vector3 avaPos = p.AbsolutePosition; |
@@ -720,7 +720,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
720 | public void PickDelete(IClientAPI remoteClient, UUID queryPickID) | 720 | public void PickDelete(IClientAPI remoteClient, UUID queryPickID) |
721 | { | 721 | { |
722 | string serverURI = string.Empty; | 722 | string serverURI = string.Empty; |
723 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 723 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
724 | 724 | ||
725 | OSDMap parameters= new OSDMap(); | 725 | OSDMap parameters= new OSDMap(); |
726 | parameters.Add("pickId", OSD.FromUUID(queryPickID)); | 726 | parameters.Add("pickId", OSD.FromUUID(queryPickID)); |
@@ -755,7 +755,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
755 | 755 | ||
756 | IClientAPI remoteClient = (IClientAPI)sender; | 756 | IClientAPI remoteClient = (IClientAPI)sender; |
757 | string serverURI = string.Empty; | 757 | string serverURI = string.Empty; |
758 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 758 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
759 | note.TargetId = remoteClient.AgentId; | 759 | note.TargetId = remoteClient.AgentId; |
760 | UUID.TryParse(args[0], out note.UserId); | 760 | UUID.TryParse(args[0], out note.UserId); |
761 | 761 | ||
@@ -791,7 +791,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
791 | note.Notes = queryNotes; | 791 | note.Notes = queryNotes; |
792 | 792 | ||
793 | string serverURI = string.Empty; | 793 | string serverURI = string.Empty; |
794 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 794 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
795 | 795 | ||
796 | object Note = note; | 796 | object Note = note; |
797 | if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) | 797 | if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) |
@@ -836,7 +836,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
836 | prop.Language = languages; | 836 | prop.Language = languages; |
837 | 837 | ||
838 | string serverURI = string.Empty; | 838 | string serverURI = string.Empty; |
839 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 839 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
840 | 840 | ||
841 | object Param = prop; | 841 | object Param = prop; |
842 | if(!JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString())) | 842 | if(!JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString())) |
@@ -958,7 +958,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
958 | prop.FirstLifeText = newProfile.FirstLifeAboutText; | 958 | prop.FirstLifeText = newProfile.FirstLifeAboutText; |
959 | 959 | ||
960 | string serverURI = string.Empty; | 960 | string serverURI = string.Empty; |
961 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 961 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
962 | 962 | ||
963 | object Prop = prop; | 963 | object Prop = prop; |
964 | 964 | ||
@@ -972,7 +972,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
972 | } | 972 | } |
973 | } | 973 | } |
974 | 974 | ||
975 | |||
976 | /// <summary> | 975 | /// <summary> |
977 | /// Gets the profile data. | 976 | /// Gets the profile data. |
978 | /// </summary> | 977 | /// </summary> |
@@ -997,7 +996,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
997 | } | 996 | } |
998 | 997 | ||
999 | string serverURI = string.Empty; | 998 | string serverURI = string.Empty; |
1000 | bool foreign = GetUserProfileServerURI(properties.UserId, out serverURI); | 999 | GetUserProfileServerURI(properties.UserId, out serverURI); |
1001 | 1000 | ||
1002 | // This is checking a friend on the home grid | 1001 | // This is checking a friend on the home grid |
1003 | // Not HG friend | 1002 | // Not HG friend |
@@ -1245,11 +1244,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1245 | return false; | 1244 | return false; |
1246 | } | 1245 | } |
1247 | 1246 | ||
1248 | byte[] buf = new byte[8192]; | ||
1249 | Stream rstream = webResponse.GetResponseStream(); | 1247 | Stream rstream = webResponse.GetResponseStream(); |
1250 | OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream); | 1248 | OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream); |
1251 | 1249 | ||
1252 | if(mret.ContainsKey("error")) | 1250 | if (mret.ContainsKey("error")) |
1253 | return false; | 1251 | return false; |
1254 | 1252 | ||
1255 | // get params... | 1253 | // get params... |
@@ -1311,7 +1309,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1311 | return false; | 1309 | return false; |
1312 | } | 1310 | } |
1313 | 1311 | ||
1314 | byte[] buf = new byte[8192]; | ||
1315 | Stream rstream = webResponse.GetResponseStream(); | 1312 | Stream rstream = webResponse.GetResponseStream(); |
1316 | 1313 | ||
1317 | OSDMap response = new OSDMap(); | 1314 | OSDMap response = new OSDMap(); |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 711167f..6ff9988 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -317,7 +317,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
317 | "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2}@{3} - agent is already in transit.", | 317 | "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2}@{3} - agent is already in transit.", |
318 | sp.Name, sp.UUID, position, regionHandle); | 318 | sp.Name, sp.UUID, position, regionHandle); |
319 | 319 | ||
320 | sp.ControllingClient.SendTeleportFailed("Slow down!"); | 320 | sp.ControllingClient.SendTeleportFailed("Previous teleport process incomplete. Please retry shortly."); |
321 | |||
321 | return; | 322 | return; |
322 | } | 323 | } |
323 | 324 | ||
@@ -1034,6 +1035,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1034 | agent.SenderWantsToWaitForRoot = true; | 1035 | agent.SenderWantsToWaitForRoot = true; |
1035 | //SetCallbackURL(agent, sp.Scene.RegionInfo); | 1036 | //SetCallbackURL(agent, sp.Scene.RegionInfo); |
1036 | 1037 | ||
1038 | // Reset the do not close flag. This must be done before the destination opens child connections (here | ||
1039 | // triggered by UpdateAgent) to avoid race conditions. However, we also want to reset it as late as possible | ||
1040 | // to avoid a situation where an unexpectedly early call to Scene.NewUserConnection() wrongly results | ||
1041 | // in no close. | ||
1042 | sp.DoNotCloseAfterTeleport = false; | ||
1043 | |||
1037 | // Send the Update. If this returns true, we know the client has contacted the destination | 1044 | // Send the Update. If this returns true, we know the client has contacted the destination |
1038 | // via CompleteMovementIntoRegion, so we can let go. | 1045 | // via CompleteMovementIntoRegion, so we can let go. |
1039 | // If it returns false, something went wrong, and we need to abort. | 1046 | // If it returns false, something went wrong, and we need to abort. |
@@ -1060,6 +1067,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1060 | 1067 | ||
1061 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); | 1068 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); |
1062 | 1069 | ||
1070 | // Need to signal neighbours whether child agents may need closing irrespective of whether this | ||
1071 | // one needed closing. We also need to close child agents as quickly as possible to avoid complicated | ||
1072 | // race conditions with rapid agent releporting (e.g. from A1 to a non-neighbour B, back | ||
1073 | // to a neighbour A2 then off to a non-neighbour C). Closing child agents any later requires complex | ||
1074 | // distributed checks to avoid problems in rapid reteleporting scenarios and where child agents are | ||
1075 | // abandoned without proper close by viewer but then re-used by an incoming connection. | ||
1076 | sp.CloseChildAgents(newRegionX, newRegionY); | ||
1077 | |||
1063 | // May need to logout or other cleanup | 1078 | // May need to logout or other cleanup |
1064 | AgentHasMovedAway(sp, logout); | 1079 | AgentHasMovedAway(sp, logout); |
1065 | 1080 | ||
@@ -1069,22 +1084,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1069 | // Now let's make it officially a child agent | 1084 | // Now let's make it officially a child agent |
1070 | sp.MakeChildAgent(); | 1085 | sp.MakeChildAgent(); |
1071 | 1086 | ||
1072 | // May still need to signal neighbours whether child agents may need closing irrespective of whether this | ||
1073 | // one needed closing. Neighbour regions also contain logic to prevent a close if a subsequent move or | ||
1074 | // teleport re-established the child connection. | ||
1075 | // | ||
1076 | // It may be possible to also close child agents after a pause but one needs to be very careful about | ||
1077 | // race conditions between different regions on rapid teleporting (e.g. from A1 to a non-neighbour B, back | ||
1078 | // to a neighbour A2 then off to a non-neighbour C. Also, closing child agents early may be more compatible | ||
1079 | // with complicated scenarios where there a mixture of V1 and V2 teleports, though this is conjecture. It's | ||
1080 | // easier to close immediately and greatly reduce the scope of race conditions if possible. | ||
1081 | sp.CloseChildAgents(newRegionX, newRegionY); | ||
1082 | |||
1083 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 1087 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
1084 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 1088 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
1085 | { | 1089 | { |
1086 | sp.DoNotCloseAfterTeleport = false; | ||
1087 | |||
1088 | // RED ALERT!!!! | 1090 | // RED ALERT!!!! |
1089 | // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES. | 1091 | // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES. |
1090 | // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion | 1092 | // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion |
@@ -1093,17 +1095,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1093 | // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. | 1095 | // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. |
1094 | Thread.Sleep(15000); | 1096 | Thread.Sleep(15000); |
1095 | 1097 | ||
1096 | if (!sp.DoNotCloseAfterTeleport) | 1098 | // OK, it got this agent. Let's close everything |
1097 | { | 1099 | // If we shouldn't close the agent due to some other region renewing the connection |
1098 | // OK, it got this agent. Let's close everything | 1100 | // then this will be handled in IncomingCloseAgent under lock conditions |
1099 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing agent {0} in {1}", sp.Name, Scene.Name); | 1101 | m_log.DebugFormat( |
1100 | sp.Scene.IncomingCloseAgent(sp.UUID, false); | 1102 | "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); |
1101 | } | 1103 | sp.Scene.IncomingCloseAgent(sp.UUID, false); |
1102 | else | ||
1103 | { | ||
1104 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {1}", sp.Name, Scene.Name); | ||
1105 | sp.DoNotCloseAfterTeleport = false; | ||
1106 | } | ||
1107 | } | 1104 | } |
1108 | else | 1105 | else |
1109 | { | 1106 | { |