diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 4d70c54..ed93f05 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -849,7 +849,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
849 | // Let's create an agent there if one doesn't exist yet. | 849 | // Let's create an agent there if one doesn't exist yet. |
850 | // NOTE: logout will always be false for a non-HG teleport. | 850 | // NOTE: logout will always be false for a non-HG teleport. |
851 | bool logout = false; | 851 | bool logout = false; |
852 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) | 852 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) |
853 | { | 853 | { |
854 | m_interRegionTeleportFailures.Value++; | 854 | m_interRegionTeleportFailures.Value++; |
855 | 855 | ||
@@ -948,7 +948,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
948 | // destination region but the viewer cannot establish the connection (e.g. due to network issues between | 948 | // destination region but the viewer cannot establish the connection (e.g. due to network issues between |
949 | // the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then | 949 | // the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then |
950 | // there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail(). | 950 | // there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail(). |
951 | if (!UpdateAgent(reg, finalDestination, agent, sp)) | 951 | if (!UpdateAgent(reg, finalDestination, agent, sp, ctx)) |
952 | { | 952 | { |
953 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 953 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
954 | { | 954 | { |
@@ -1084,7 +1084,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1084 | // Let's create an agent there if one doesn't exist yet. | 1084 | // Let's create an agent there if one doesn't exist yet. |
1085 | // NOTE: logout will always be false for a non-HG teleport. | 1085 | // NOTE: logout will always be false for a non-HG teleport. |
1086 | bool logout = false; | 1086 | bool logout = false; |
1087 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) | 1087 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) |
1088 | { | 1088 | { |
1089 | m_interRegionTeleportFailures.Value++; | 1089 | m_interRegionTeleportFailures.Value++; |
1090 | 1090 | ||
@@ -1158,7 +1158,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1158 | // Send the Update. If this returns true, we know the client has contacted the destination | 1158 | // Send the Update. If this returns true, we know the client has contacted the destination |
1159 | // via CompleteMovementIntoRegion, so we can let go. | 1159 | // via CompleteMovementIntoRegion, so we can let go. |
1160 | // If it returns false, something went wrong, and we need to abort. | 1160 | // If it returns false, something went wrong, and we need to abort. |
1161 | if (!UpdateAgent(reg, finalDestination, agent, sp)) | 1161 | if (!UpdateAgent(reg, finalDestination, agent, sp, ctx)) |
1162 | { | 1162 | { |
1163 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 1163 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
1164 | { | 1164 | { |
@@ -1280,13 +1280,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1280 | sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); | 1280 | sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) | 1283 | protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, EntityTransferContext ctx, out string reason, out bool logout) |
1284 | { | 1284 | { |
1285 | GridRegion source = new GridRegion(Scene.RegionInfo); | 1285 | GridRegion source = new GridRegion(Scene.RegionInfo); |
1286 | source.RawServerURI = m_GatekeeperURI; | 1286 | source.RawServerURI = m_GatekeeperURI; |
1287 | 1287 | ||
1288 | logout = false; | 1288 | logout = false; |
1289 | bool success = Scene.SimulationService.CreateAgent(source, finalDestination, agentCircuit, teleportFlags, out reason); | 1289 | bool success = Scene.SimulationService.CreateAgent(source, finalDestination, agentCircuit, teleportFlags, ctx, out reason); |
1290 | 1290 | ||
1291 | if (success) | 1291 | if (success) |
1292 | sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout); | 1292 | sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout); |
@@ -1294,9 +1294,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1294 | return success; | 1294 | return success; |
1295 | } | 1295 | } |
1296 | 1296 | ||
1297 | protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent, ScenePresence sp) | 1297 | protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent, ScenePresence sp, EntityTransferContext ctx) |
1298 | { | 1298 | { |
1299 | return Scene.SimulationService.UpdateAgent(finalDestination, agent); | 1299 | return Scene.SimulationService.UpdateAgent(finalDestination, agent, ctx); |
1300 | } | 1300 | } |
1301 | 1301 | ||
1302 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) | 1302 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) |
@@ -1679,7 +1679,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1679 | m_entityTransferStateMachine.ResetFromTransit(agent.UUID); | 1679 | m_entityTransferStateMachine.ResetFromTransit(agent.UUID); |
1680 | } | 1680 | } |
1681 | 1681 | ||
1682 | if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying)) | 1682 | if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying, ctx)) |
1683 | { | 1683 | { |
1684 | m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader); | 1684 | m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader); |
1685 | m_entityTransferStateMachine.ResetFromTransit(agent.UUID); | 1685 | m_entityTransferStateMachine.ResetFromTransit(agent.UUID); |
@@ -1695,7 +1695,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1695 | return agent; | 1695 | return agent; |
1696 | } | 1696 | } |
1697 | 1697 | ||
1698 | public bool CrossAgentIntoNewRegionMain(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying) | 1698 | public bool CrossAgentIntoNewRegionMain(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx) |
1699 | { | 1699 | { |
1700 | int ts = Util.EnvironmentTickCount(); | 1700 | int ts = Util.EnvironmentTickCount(); |
1701 | try | 1701 | try |
@@ -1718,7 +1718,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1718 | // Beyond this point, extra cleanup is needed beyond removing transit state | 1718 | // Beyond this point, extra cleanup is needed beyond removing transit state |
1719 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.Transferring); | 1719 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.Transferring); |
1720 | 1720 | ||
1721 | if (!agent.Scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) | 1721 | if (!agent.Scene.SimulationService.UpdateAgent(neighbourRegion, cAgent, ctx)) |
1722 | { | 1722 | { |
1723 | // region doesn't take it | 1723 | // region doesn't take it |
1724 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); | 1724 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); |
@@ -2360,7 +2360,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2360 | 2360 | ||
2361 | string reason = String.Empty; | 2361 | string reason = String.Empty; |
2362 | 2362 | ||
2363 | bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, a, (uint)TeleportFlags.Default, out reason); | 2363 | EntityTransferContext ctx = new EntityTransferContext(); |
2364 | bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, a, (uint)TeleportFlags.Default, ctx, out reason); | ||
2364 | 2365 | ||
2365 | if (regionAccepted) | 2366 | if (regionAccepted) |
2366 | { | 2367 | { |