diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 58d6cf2..6b1eb54 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -72,9 +72,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
72 | /// If true then we ask the viewer to disable teleport cancellation and ignore teleport requests. | 72 | /// If true then we ask the viewer to disable teleport cancellation and ignore teleport requests. |
73 | /// </summary> | 73 | /// </summary> |
74 | /// <remarks> | 74 | /// <remarks> |
75 | /// This is useful in situations where teleport is very likely to always succeed and we want to avoid a | 75 | /// This is useful in situations where teleport is very likely to always succeed and we want to avoid a |
76 | /// situation where avatars can be come 'stuck' due to a failed teleport cancellation. Unfortunately, the | 76 | /// situation where avatars can be come 'stuck' due to a failed teleport cancellation. Unfortunately, the |
77 | /// nature of the teleport protocol makes it extremely difficult (maybe impossible) to make teleport | 77 | /// nature of the teleport protocol makes it extremely difficult (maybe impossible) to make teleport |
78 | /// cancellation consistently suceed. | 78 | /// cancellation consistently suceed. |
79 | /// </remarks> | 79 | /// </remarks> |
80 | public bool DisableInterRegionTeleportCancellation { get; set; } | 80 | public bool DisableInterRegionTeleportCancellation { get; set; } |
@@ -221,12 +221,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
221 | IConfig transferConfig = source.Configs["EntityTransfer"]; | 221 | IConfig transferConfig = source.Configs["EntityTransfer"]; |
222 | if (transferConfig != null) | 222 | if (transferConfig != null) |
223 | { | 223 | { |
224 | DisableInterRegionTeleportCancellation | 224 | DisableInterRegionTeleportCancellation |
225 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); | 225 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); |
226 | 226 | ||
227 | WaitForAgentArrivedAtDestination | 227 | WaitForAgentArrivedAtDestination |
228 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); | 228 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); |
229 | 229 | ||
230 | MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance); | 230 | MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance); |
231 | } | 231 | } |
232 | else | 232 | else |
@@ -250,7 +250,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
250 | 250 | ||
251 | Scene = scene; | 251 | Scene = scene; |
252 | 252 | ||
253 | m_interRegionTeleportAttempts = | 253 | m_interRegionTeleportAttempts = |
254 | new Stat( | 254 | new Stat( |
255 | "InterRegionTeleportAttempts", | 255 | "InterRegionTeleportAttempts", |
256 | "Number of inter-region teleports attempted.", | 256 | "Number of inter-region teleports attempted.", |
@@ -263,7 +263,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
263 | null, | 263 | null, |
264 | StatVerbosity.Debug); | 264 | StatVerbosity.Debug); |
265 | 265 | ||
266 | m_interRegionTeleportAborts = | 266 | m_interRegionTeleportAborts = |
267 | new Stat( | 267 | new Stat( |
268 | "InterRegionTeleportAborts", | 268 | "InterRegionTeleportAborts", |
269 | "Number of inter-region teleports aborted due to client actions.", | 269 | "Number of inter-region teleports aborted due to client actions.", |
@@ -275,7 +275,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
275 | null, | 275 | null, |
276 | StatVerbosity.Debug); | 276 | StatVerbosity.Debug); |
277 | 277 | ||
278 | m_interRegionTeleportCancels = | 278 | m_interRegionTeleportCancels = |
279 | new Stat( | 279 | new Stat( |
280 | "InterRegionTeleportCancels", | 280 | "InterRegionTeleportCancels", |
281 | "Number of inter-region teleports cancelled by the client.", | 281 | "Number of inter-region teleports cancelled by the client.", |
@@ -287,7 +287,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
287 | null, | 287 | null, |
288 | StatVerbosity.Debug); | 288 | StatVerbosity.Debug); |
289 | 289 | ||
290 | m_interRegionTeleportFailures = | 290 | m_interRegionTeleportFailures = |
291 | new Stat( | 291 | new Stat( |
292 | "InterRegionTeleportFailures", | 292 | "InterRegionTeleportFailures", |
293 | "Number of inter-region teleports that failed due to server/client/network issues.", | 293 | "Number of inter-region teleports that failed due to server/client/network issues.", |
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
321 | 321 | ||
322 | public virtual void Close() {} | 322 | public virtual void Close() {} |
323 | 323 | ||
324 | public virtual void RemoveRegion(Scene scene) | 324 | public virtual void RemoveRegion(Scene scene) |
325 | { | 325 | { |
326 | if (m_Enabled) | 326 | if (m_Enabled) |
327 | { | 327 | { |
@@ -349,7 +349,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
349 | if (client.IsLoggingOut && m_entityTransferStateMachine.UpdateInTransit(client.AgentId, AgentTransferState.Aborting)) | 349 | if (client.IsLoggingOut && m_entityTransferStateMachine.UpdateInTransit(client.AgentId, AgentTransferState.Aborting)) |
350 | { | 350 | { |
351 | m_log.DebugFormat( | 351 | m_log.DebugFormat( |
352 | "[ENTITY TRANSFER MODULE]: Aborted teleport request from {0} in {1} due to simultaneous logout", | 352 | "[ENTITY TRANSFER MODULE]: Aborted teleport request from {0} in {1} due to simultaneous logout", |
353 | client.Name, Scene.Name); | 353 | client.Name, Scene.Name); |
354 | } | 354 | } |
355 | } | 355 | } |
@@ -672,7 +672,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
672 | sp.ControllingClient.SendTeleportFailed("Agent is already in transit."); | 672 | sp.ControllingClient.SendTeleportFailed("Agent is already in transit."); |
673 | return; | 673 | return; |
674 | } | 674 | } |
675 | 675 | ||
676 | try | 676 | try |
677 | { | 677 | { |
678 | DoTeleportInternal(sp, reg, finalDestination, position, lookAt, teleportFlags); | 678 | DoTeleportInternal(sp, reg, finalDestination, position, lookAt, teleportFlags); |
@@ -766,7 +766,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
766 | m_interRegionTeleportAttempts.Value++; | 766 | m_interRegionTeleportAttempts.Value++; |
767 | 767 | ||
768 | m_log.DebugFormat( | 768 | m_log.DebugFormat( |
769 | "[ENTITY TRANSFER MODULE]: {0} transfer protocol version to {1} is {2} / {3}", | 769 | "[ENTITY TRANSFER MODULE]: {0} transfer protocol version to {1} is {2} / {3}", |
770 | sp.Scene.Name, finalDestination.RegionName, ctx.OutboundVersion, ctx.InboundVersion); | 770 | sp.Scene.Name, finalDestination.RegionName, ctx.OutboundVersion, ctx.InboundVersion); |
771 | 771 | ||
772 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 772 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
@@ -797,7 +797,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
797 | AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); | 797 | AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); |
798 | agentCircuit.startpos = position; | 798 | agentCircuit.startpos = position; |
799 | agentCircuit.child = true; | 799 | agentCircuit.child = true; |
800 | 800 | ||
801 | // agentCircuit.Appearance = sp.Appearance; | 801 | // agentCircuit.Appearance = sp.Appearance; |
802 | // agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false); | 802 | // agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false); |
803 | agentCircuit.Appearance = new AvatarAppearance(); | 803 | agentCircuit.Appearance = new AvatarAppearance(); |
@@ -814,7 +814,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
814 | } | 814 | } |
815 | 815 | ||
816 | IClientIPEndpoint ipepClient; | 816 | IClientIPEndpoint ipepClient; |
817 | 817 | ||
818 | uint newRegionX, newRegionY, oldRegionX, oldRegionY; | 818 | uint newRegionX, newRegionY, oldRegionX, oldRegionY; |
819 | Util.RegionHandleToRegionLoc(destinationHandle, out newRegionX, out newRegionY); | 819 | Util.RegionHandleToRegionLoc(destinationHandle, out newRegionX, out newRegionY); |
820 | Util.RegionHandleToRegionLoc(sourceRegion.RegionHandle, out oldRegionX, out oldRegionY); | 820 | Util.RegionHandleToRegionLoc(sourceRegion.RegionHandle, out oldRegionX, out oldRegionY); |
@@ -853,7 +853,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
853 | if (ctx.OutboundVersion >= 0.2f) | 853 | if (ctx.OutboundVersion >= 0.2f) |
854 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange , ctx, out reason); | 854 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange , ctx, out reason); |
855 | else | 855 | else |
856 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange, ctx, out reason); | 856 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange, ctx, out reason); |
857 | } | 857 | } |
858 | 858 | ||
859 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, | 859 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, |
@@ -863,12 +863,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
863 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 863 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
864 | 864 | ||
865 | m_log.DebugFormat( | 865 | m_log.DebugFormat( |
866 | "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}", | 866 | "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}", |
867 | sp.Name, Scene.Name, finalDestination.RegionName); | 867 | sp.Name, Scene.Name, finalDestination.RegionName); |
868 | 868 | ||
869 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | 869 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); |
870 | 870 | ||
871 | // Let's create an agent there if one doesn't exist yet. | 871 | // Let's create an agent there if one doesn't exist yet. |
872 | // NOTE: logout will always be false for a non-HG teleport. | 872 | // NOTE: logout will always be false for a non-HG teleport. |
873 | bool logout = false; | 873 | bool logout = false; |
874 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) | 874 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) |
@@ -953,7 +953,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
953 | SetCallbackURL(agent, sp.Scene.RegionInfo); | 953 | SetCallbackURL(agent, sp.Scene.RegionInfo); |
954 | 954 | ||
955 | 955 | ||
956 | // We will check for an abort before UpdateAgent since UpdateAgent will require an active viewer to | 956 | // We will check for an abort before UpdateAgent since UpdateAgent will require an active viewer to |
957 | // establish th econnection to the destination which makes it return true. | 957 | // establish th econnection to the destination which makes it return true. |
958 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 958 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
959 | { | 959 | { |
@@ -966,7 +966,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
966 | return; | 966 | return; |
967 | } | 967 | } |
968 | 968 | ||
969 | // A common teleport failure occurs when we can send CreateAgent to the | 969 | // A common teleport failure occurs when we can send CreateAgent to the |
970 | // destination region but the viewer cannot establish the connection (e.g. due to network issues between | 970 | // destination region but the viewer cannot establish the connection (e.g. due to network issues between |
971 | // the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then | 971 | // the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then |
972 | // there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail(). | 972 | // there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail(). |
@@ -1010,7 +1010,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1010 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); | 1010 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); |
1011 | 1011 | ||
1012 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, | 1012 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, |
1013 | // where that neighbour simulator could otherwise request a child agent create on the source which then | 1013 | // where that neighbour simulator could otherwise request a child agent create on the source which then |
1014 | // closes our existing agent which is still signalled as root. | 1014 | // closes our existing agent which is still signalled as root. |
1015 | sp.IsChildAgent = true; | 1015 | sp.IsChildAgent = true; |
1016 | 1016 | ||
@@ -1071,7 +1071,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1071 | AgentHasMovedAway(sp, logout); | 1071 | AgentHasMovedAway(sp, logout); |
1072 | 1072 | ||
1073 | sp.HasMovedAway(!(OutSideViewRange || logout)); | 1073 | sp.HasMovedAway(!(OutSideViewRange || logout)); |
1074 | 1074 | ||
1075 | // ulong sourceRegionHandle = sp.RegionHandle; | 1075 | // ulong sourceRegionHandle = sp.RegionHandle; |
1076 | 1076 | ||
1077 | // Now let's make it officially a child agent | 1077 | // Now let's make it officially a child agent |
@@ -1107,7 +1107,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1107 | 1107 | ||
1108 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);; | 1108 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);; |
1109 | 1109 | ||
1110 | // Let's create an agent there if one doesn't exist yet. | 1110 | // Let's create an agent there if one doesn't exist yet. |
1111 | // NOTE: logout will always be false for a non-HG teleport. | 1111 | // NOTE: logout will always be false for a non-HG teleport. |
1112 | bool logout = false; | 1112 | bool logout = false; |
1113 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) | 1113 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) |
@@ -1150,7 +1150,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1150 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); | 1150 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); |
1151 | 1151 | ||
1152 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, | 1152 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, |
1153 | // where that neighbour simulator could otherwise request a child agent create on the source which then | 1153 | // where that neighbour simulator could otherwise request a child agent create on the source which then |
1154 | // closes our existing agent which is still signalled as root. | 1154 | // closes our existing agent which is still signalled as root. |
1155 | //sp.IsChildAgent = true; | 1155 | //sp.IsChildAgent = true; |
1156 | 1156 | ||
@@ -1166,7 +1166,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1166 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", | 1166 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", |
1167 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); | 1167 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); |
1168 | 1168 | ||
1169 | // Let's send a full update of the agent. | 1169 | // Let's send a full update of the agent. |
1170 | AgentData agent = new AgentData(); | 1170 | AgentData agent = new AgentData(); |
1171 | sp.CopyTo(agent,false); | 1171 | sp.CopyTo(agent,false); |
1172 | agent.Position = agentCircuit.startpos; | 1172 | agent.Position = agentCircuit.startpos; |
@@ -1207,7 +1207,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1207 | sp.IsInTransit = false; | 1207 | sp.IsInTransit = false; |
1208 | return; | 1208 | return; |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); | 1211 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); |
1212 | 1212 | ||
1213 | // Need to signal neighbours whether child agents may need closing irrespective of whether this | 1213 | // Need to signal neighbours whether child agents may need closing irrespective of whether this |
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1248 | // Thread.Sleep(1000); | 1248 | // Thread.Sleep(1000); |
1249 | 1249 | ||
1250 | // OK, it got this agent. Let's close everything | 1250 | // OK, it got this agent. Let's close everything |
1251 | // If we shouldn't close the agent due to some other region renewing the connection | 1251 | // If we shouldn't close the agent due to some other region renewing the connection |
1252 | // then this will be handled in IncomingCloseAgent under lock conditions | 1252 | // then this will be handled in IncomingCloseAgent under lock conditions |
1253 | m_log.DebugFormat( | 1253 | m_log.DebugFormat( |
1254 | "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); | 1254 | "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); |
@@ -1258,7 +1258,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1258 | /* | 1258 | /* |
1259 | else | 1259 | else |
1260 | { | 1260 | { |
1261 | // now we have a child agent in this region. | 1261 | // now we have a child agent in this region. |
1262 | sp.Reset(); | 1262 | sp.Reset(); |
1263 | } | 1263 | } |
1264 | */ | 1264 | */ |
@@ -1343,7 +1343,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1343 | /// </summary> | 1343 | /// </summary> |
1344 | /// <param name='sp'></param> | 1344 | /// <param name='sp'></param> |
1345 | /// <param name='logout'></param> | 1345 | /// <param name='logout'></param> |
1346 | /// | 1346 | /// |
1347 | /// now just a HG hook | 1347 | /// now just a HG hook |
1348 | protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) | 1348 | protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) |
1349 | { | 1349 | { |
@@ -1375,7 +1375,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1375 | 1375 | ||
1376 | // HG Hook | 1376 | // HG Hook |
1377 | protected virtual bool NeedsClosing(GridRegion reg, bool OutViewRange) | 1377 | protected virtual bool NeedsClosing(GridRegion reg, bool OutViewRange) |
1378 | 1378 | ||
1379 | { | 1379 | { |
1380 | return OutViewRange; | 1380 | return OutViewRange; |
1381 | } | 1381 | } |
@@ -1399,11 +1399,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1399 | remoteClient.SendTeleportFailed("The teleport destination could not be found."); | 1399 | remoteClient.SendTeleportFailed("The teleport destination could not be found."); |
1400 | return; | 1400 | return; |
1401 | } | 1401 | } |
1402 | ((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position, | 1402 | ((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position, |
1403 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); | 1403 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); |
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | #endregion | 1406 | #endregion |
1407 | 1407 | ||
1408 | #region Teleport Home | 1408 | #region Teleport Home |
1409 | 1409 | ||
@@ -1437,7 +1437,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1437 | client.SendTeleportFailed("Your home region could not be found."); | 1437 | client.SendTeleportFailed("Your home region could not be found."); |
1438 | return false; | 1438 | return false; |
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Home region of {0} is {1} ({2}-{3})", | 1441 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Home region of {0} is {1} ({2}-{3})", |
1442 | client.Name, regionInfo.RegionName, regionInfo.RegionCoordX, regionInfo.RegionCoordY); | 1442 | client.Name, regionInfo.RegionName, regionInfo.RegionCoordX, regionInfo.RegionCoordY); |
1443 | 1443 | ||
@@ -1475,7 +1475,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1475 | 1475 | ||
1476 | Scene ascene = agent.Scene; | 1476 | Scene ascene = agent.Scene; |
1477 | string homeURI = ascene.GetAgentHomeURI(agentID); | 1477 | string homeURI = ascene.GetAgentHomeURI(agentID); |
1478 | 1478 | ||
1479 | 1479 | ||
1480 | if (!ascene.SimulationService.QueryAccess(destiny, agentID, homeURI, false, position, | 1480 | if (!ascene.SimulationService.QueryAccess(destiny, agentID, homeURI, false, position, |
1481 | agent.Scene.GetFormatsOffered(), ctx, out reason)) | 1481 | agent.Scene.GetFormatsOffered(), ctx, out reason)) |
@@ -1489,7 +1489,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1489 | 1489 | ||
1490 | // Given a position relative to the current region and outside of it | 1490 | // Given a position relative to the current region and outside of it |
1491 | // find the new region that the point is actually in. | 1491 | // find the new region that the point is actually in. |
1492 | // returns 'null' if new region not found or if information | 1492 | // returns 'null' if new region not found or if information |
1493 | // and new position relative to it | 1493 | // and new position relative to it |
1494 | // now only works for crossings | 1494 | // now only works for crossings |
1495 | 1495 | ||
@@ -1611,14 +1611,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1611 | Thread.Sleep(10000); | 1611 | Thread.Sleep(10000); |
1612 | 1612 | ||
1613 | m_log.DebugFormat( | 1613 | m_log.DebugFormat( |
1614 | "[ENTITY TRANSFER MODULE]: Auto-reteleporting {0} to correct megaregion location {1},{2},{3} from {4}", | 1614 | "[ENTITY TRANSFER MODULE]: Auto-reteleporting {0} to correct megaregion location {1},{2},{3} from {4}", |
1615 | agent.Name, regionX, regionY, position, initiatingScene.Name); | 1615 | agent.Name, regionX, regionY, position, initiatingScene.Name); |
1616 | 1616 | ||
1617 | agent.Scene.RequestTeleportLocation( | 1617 | agent.Scene.RequestTeleportLocation( |
1618 | agent.ControllingClient, | 1618 | agent.ControllingClient, |
1619 | Util.RegionGridLocToHandle(regionX, regionY), | 1619 | Util.RegionGridLocToHandle(regionX, regionY), |
1620 | position, | 1620 | position, |
1621 | agent.Lookat, | 1621 | agent.Lookat, |
1622 | (uint)Constants.TeleportFlags.ViaLocation); | 1622 | (uint)Constants.TeleportFlags.ViaLocation); |
1623 | 1623 | ||
1624 | /* | 1624 | /* |
@@ -1662,7 +1662,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1662 | icon.EndInvoke(iar); | 1662 | icon.EndInvoke(iar); |
1663 | } | 1663 | } |
1664 | 1664 | ||
1665 | 1665 | ||
1666 | 1666 | ||
1667 | /// <summary> | 1667 | /// <summary> |
1668 | /// This Closes child agents on neighbouring regions | 1668 | /// This Closes child agents on neighbouring regions |
@@ -1708,7 +1708,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1708 | int ts = Util.EnvironmentTickCount(); | 1708 | int ts = Util.EnvironmentTickCount(); |
1709 | try | 1709 | try |
1710 | { | 1710 | { |
1711 | AgentData cAgent = new AgentData(); | 1711 | AgentData cAgent = new AgentData(); |
1712 | agent.CopyTo(cAgent,true); | 1712 | agent.CopyTo(cAgent,true); |
1713 | 1713 | ||
1714 | // agent.Appearance.WearableCacheItems = null; | 1714 | // agent.Appearance.WearableCacheItems = null; |
@@ -1731,7 +1731,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1731 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); | 1731 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); |
1732 | 1732 | ||
1733 | m_log.WarnFormat( | 1733 | m_log.WarnFormat( |
1734 | "[ENTITY TRANSFER MODULE]: Region {0} would not accept update for agent {1} on cross attempt. Returning to original region.", | 1734 | "[ENTITY TRANSFER MODULE]: Region {0} would not accept update for agent {1} on cross attempt. Returning to original region.", |
1735 | neighbourRegion.RegionName, agent.Name); | 1735 | neighbourRegion.RegionName, agent.Name); |
1736 | 1736 | ||
1737 | ReInstantiateScripts(agent); | 1737 | ReInstantiateScripts(agent); |
@@ -1827,7 +1827,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1827 | 1827 | ||
1828 | return; | 1828 | return; |
1829 | } | 1829 | } |
1830 | 1830 | ||
1831 | private void CrossAgentToNewRegionCompleted(IAsyncResult iar) | 1831 | private void CrossAgentToNewRegionCompleted(IAsyncResult iar) |
1832 | { | 1832 | { |
1833 | CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; | 1833 | CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; |
@@ -2167,7 +2167,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2167 | return false; | 2167 | return false; |
2168 | } | 2168 | } |
2169 | } | 2169 | } |
2170 | 2170 | ||
2171 | private void DoExpiration() | 2171 | private void DoExpiration() |
2172 | { | 2172 | { |
2173 | List<ulong> m_toRemove = new List<ulong>();; | 2173 | List<ulong> m_toRemove = new List<ulong>();; |
@@ -2179,7 +2179,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2179 | if (kvp.Value < now) | 2179 | if (kvp.Value < now) |
2180 | m_toRemove.Add(kvp.Key); | 2180 | m_toRemove.Add(kvp.Key); |
2181 | } | 2181 | } |
2182 | 2182 | ||
2183 | if (m_toRemove.Count > 0) | 2183 | if (m_toRemove.Count > 0) |
2184 | { | 2184 | { |
2185 | foreach (ulong u in m_toRemove) | 2185 | foreach (ulong u in m_toRemove) |
@@ -2199,7 +2199,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2199 | // to find possible regions. | 2199 | // to find possible regions. |
2200 | return GetRegionContainingWorldLocation(pGridService, pScopeID, px, py, Constants.MaximumRegionSize); | 2200 | return GetRegionContainingWorldLocation(pGridService, pScopeID, px, py, Constants.MaximumRegionSize); |
2201 | } | 2201 | } |
2202 | 2202 | ||
2203 | // Given a world position, get the GridRegion info for | 2203 | // Given a world position, get the GridRegion info for |
2204 | // the region containing that point. | 2204 | // the region containing that point. |
2205 | // for compatibility with old grids it does a scan to find large regions | 2205 | // for compatibility with old grids it does a scan to find large regions |
@@ -2285,7 +2285,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2285 | if (newAgent) | 2285 | if (newAgent) |
2286 | { | 2286 | { |
2287 | // we may already had lost this sp | 2287 | // we may already had lost this sp |
2288 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened | 2288 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened |
2289 | return; | 2289 | return; |
2290 | 2290 | ||
2291 | Scene scene = sp.Scene; | 2291 | Scene scene = sp.Scene; |
@@ -2303,13 +2303,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2303 | 2303 | ||
2304 | if (regionAccepted) | 2304 | if (regionAccepted) |
2305 | { | 2305 | { |
2306 | // give time for createAgent to finish, since it is async and does grid services access | 2306 | // give time for createAgent to finish, since it is async and does grid services access |
2307 | Thread.Sleep(500); | 2307 | Thread.Sleep(500); |
2308 | 2308 | ||
2309 | if (m_eqModule != null) | 2309 | if (m_eqModule != null) |
2310 | { | 2310 | { |
2311 | #region IP Translation for NAT | 2311 | #region IP Translation for NAT |
2312 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened | 2312 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened |
2313 | return; | 2313 | return; |
2314 | 2314 | ||
2315 | IClientIPEndpoint ipepClient; | 2315 | IClientIPEndpoint ipepClient; |
@@ -2344,7 +2344,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2344 | reg.RegionName, sp.Name, sp.UUID, reason); | 2344 | reg.RegionName, sp.Name, sp.UUID, reason); |
2345 | } | 2345 | } |
2346 | } | 2346 | } |
2347 | 2347 | ||
2348 | } | 2348 | } |
2349 | 2349 | ||
2350 | /// <summary> | 2350 | /// <summary> |
@@ -2353,7 +2353,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2353 | /// <param name="avatar"></param> | 2353 | /// <param name="avatar"></param> |
2354 | /// <param name="pRegionLocX"></param> | 2354 | /// <param name="pRegionLocX"></param> |
2355 | /// <param name="pRegionLocY"></param> | 2355 | /// <param name="pRegionLocY"></param> |
2356 | /// <returns></returns> | 2356 | /// <returns></returns> |
2357 | protected List<GridRegion> GetNeighbors(ScenePresence avatar, uint pRegionLocX, uint pRegionLocY) | 2357 | protected List<GridRegion> GetNeighbors(ScenePresence avatar, uint pRegionLocX, uint pRegionLocY) |
2358 | { | 2358 | { |
2359 | Scene pScene = avatar.Scene; | 2359 | Scene pScene = avatar.Scene; |
@@ -2588,7 +2588,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2588 | if (Scene.RegionInfo.EstateSettings.IsBanned(so.OwnerID)) | 2588 | if (Scene.RegionInfo.EstateSettings.IsBanned(so.OwnerID)) |
2589 | { | 2589 | { |
2590 | m_log.DebugFormat( | 2590 | m_log.DebugFormat( |
2591 | "[ENTITY TRANSFER MODULE]: Denied prim crossing of {0} {1} into {2} for banned avatar {3}", | 2591 | "[ENTITY TRANSFER MODULE]: Denied prim crossing of {0} {1} into {2} for banned avatar {3}", |
2592 | so.Name, so.UUID, Scene.Name, so.OwnerID); | 2592 | so.Name, so.UUID, Scene.Name, so.OwnerID); |
2593 | 2593 | ||
2594 | return false; | 2594 | return false; |
@@ -2600,7 +2600,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2600 | if (!Scene.AddSceneObject(so)) | 2600 | if (!Scene.AddSceneObject(so)) |
2601 | { | 2601 | { |
2602 | m_log.DebugFormat( | 2602 | m_log.DebugFormat( |
2603 | "[ENTITY TRANSFER MODULE]: Problem adding scene object {0} {1} into {2} ", | 2603 | "[ENTITY TRANSFER MODULE]: Problem adding scene object {0} {1} into {2} ", |
2604 | so.Name, so.UUID, Scene.Name); | 2604 | so.Name, so.UUID, Scene.Name); |
2605 | 2605 | ||
2606 | return false; | 2606 | return false; |