aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework
diff options
context:
space:
mode:
authorMelanie Thielker2015-11-01 19:11:14 +0100
committerMelanie Thielker2015-11-01 19:11:14 +0100
commit69585a4824a7814bbe543d624de6c3627e0b927b (patch)
tree5d4bb6480906000f019c0d456939b24f5dfd8ab4 /OpenSim/Region/CoreModules/Framework
parentMerge branch 'master' into avinationmerge (diff)
downloadopensim-SC_OLD-69585a4824a7814bbe543d624de6c3627e0b927b.zip
opensim-SC_OLD-69585a4824a7814bbe543d624de6c3627e0b927b.tar.gz
opensim-SC_OLD-69585a4824a7814bbe543d624de6c3627e0b927b.tar.bz2
opensim-SC_OLD-69585a4824a7814bbe543d624de6c3627e0b927b.tar.xz
More plumbing of the EntityTransferContext (not yet complete)
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs25
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs10
2 files changed, 18 insertions, 17 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 {
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index dcc4746..1783e0a 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -263,7 +263,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
263 } 263 }
264 } 264 }
265 265
266 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) 266 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, EntityTransferContext ctx, out string reason, out bool logout)
267 { 267 {
268 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: CreateAgent {0} {1}", reg.ServerURI, finalDestination.ServerURI); 268 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: CreateAgent {0} {1}", reg.ServerURI, finalDestination.ServerURI);
269 reason = string.Empty; 269 reason = string.Empty;
@@ -308,7 +308,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
308 } 308 }
309 } 309 }
310 310
311 return base.CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout); 311 return base.CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout);
312 } 312 }
313 313
314 public void TriggerTeleportHome(UUID id, IClientAPI client) 314 public void TriggerTeleportHome(UUID id, IClientAPI client)
@@ -333,7 +333,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
333 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: RestrictAppearanceAbroad is ON. Checking generic appearance"); 333 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: RestrictAppearanceAbroad is ON. Checking generic appearance");
334 334
335 // Check wearables 335 // Check wearables
336 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) 336 for (int i = 0; i < sp.Appearance.Wearables.Length ; i++)
337 { 337 {
338 for (int j = 0; j < sp.Appearance.Wearables[i].Count; j++) 338 for (int j = 0; j < sp.Appearance.Wearables[i].Count; j++)
339 { 339 {
@@ -342,7 +342,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
342 342
343 bool found = false; 343 bool found = false;
344 foreach (AvatarAppearance a in ExportedAppearance) 344 foreach (AvatarAppearance a in ExportedAppearance)
345 if (a.Wearables[i] != null) 345 if (i < a.Wearables.Length && a.Wearables[i] != null)
346 { 346 {
347 found = true; 347 found = true;
348 break; 348 break;
@@ -356,7 +356,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
356 356
357 found = false; 357 found = false;
358 foreach (AvatarAppearance a in ExportedAppearance) 358 foreach (AvatarAppearance a in ExportedAppearance)
359 if (sp.Appearance.Wearables[i][j].AssetID == a.Wearables[i][j].AssetID) 359 if (i < a.Wearables.Length && sp.Appearance.Wearables[i][j].AssetID == a.Wearables[i][j].AssetID)
360 { 360 {
361 found = true; 361 found = true;
362 break; 362 break;