aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2013-02-23 20:37:09 +0000
committerMelanie2013-02-23 20:37:09 +0000
commite3ea2c4beefb65ba997beab1509aa996a46f7864 (patch)
tree778cba450e788b13f4d000c6e49f3d94bd25f65c /OpenSim/Region
parentMerge branch 'master' into careminster (diff)
parentMore clarification on the [Groups] section (diff)
downloadopensim-SC_OLD-e3ea2c4beefb65ba997beab1509aa996a46f7864.zip
opensim-SC_OLD-e3ea2c4beefb65ba997beab1509aa996a46f7864.tar.gz
opensim-SC_OLD-e3ea2c4beefb65ba997beab1509aa996a46f7864.tar.bz2
opensim-SC_OLD-e3ea2c4beefb65ba997beab1509aa996a46f7864.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs114
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs7
-rw-r--r--OpenSim/Region/DataSnapshot/DataSnapshotManager.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs4
6 files changed, 83 insertions, 52 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
index 784a788..22cdc80 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
65 { 65 {
66 m_Enabled = true; 66 m_Enabled = true;
67 67
68 m_ThisGridURL = Util.GetConfigVarWithDefaultSection(config, "GatekeeperURI", "Messaging"); 68 m_ThisGridURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] {"Startup", "Messaging"});
69 // Legacy. Remove soon! 69 // Legacy. Remove soon!
70 m_ThisGridURL = config.Configs["Messaging"].GetString("Gatekeeper", m_ThisGridURL); 70 m_ThisGridURL = config.Configs["Messaging"].GetString("Gatekeeper", m_ThisGridURL);
71 m_log.DebugFormat("[LURE MODULE]: {0} enabled", Name); 71 m_log.DebugFormat("[LURE MODULE]: {0} enabled", Name);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index cb09047..6f18e1c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -180,13 +180,24 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
180 if (!sp.Scene.Permissions.CanTeleport(sp.UUID)) 180 if (!sp.Scene.Permissions.CanTeleport(sp.UUID))
181 return; 181 return;
182 182
183 // Reset animations; the viewer does that in teleports.
184 sp.Animator.ResetAnimations();
185
186 string destinationRegionName = "(not found)"; 183 string destinationRegionName = "(not found)";
187 184
185 // Record that this agent is in transit so that we can prevent simultaneous requests and do later detection
186 // of whether the destination region completes the teleport.
187 if (!m_entityTransferStateMachine.SetInTransit(sp.UUID))
188 {
189 m_log.DebugFormat(
190 "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2}@{3} - agent is already in transit.",
191 sp.Name, sp.UUID, position, regionHandle);
192
193 return;
194 }
195
188 try 196 try
189 { 197 {
198 // Reset animations; the viewer does that in teleports.
199 sp.Animator.ResetAnimations();
200
190 if (regionHandle == sp.Scene.RegionInfo.RegionHandle) 201 if (regionHandle == sp.Scene.RegionInfo.RegionHandle)
191 { 202 {
192 destinationRegionName = sp.Scene.RegionInfo.RegionName; 203 destinationRegionName = sp.Scene.RegionInfo.RegionName;
@@ -195,12 +206,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
195 } 206 }
196 else // Another region possibly in another simulator 207 else // Another region possibly in another simulator
197 { 208 {
198 GridRegion finalDestination; 209 GridRegion finalDestination = null;
199 TeleportAgentToDifferentRegion( 210 try
200 sp, regionHandle, position, lookAt, teleportFlags, out finalDestination); 211 {
201 212 TeleportAgentToDifferentRegion(
202 if (finalDestination != null) 213 sp, regionHandle, position, lookAt, teleportFlags, out finalDestination);
203 destinationRegionName = finalDestination.RegionName; 214 }
215 finally
216 {
217 if (finalDestination != null)
218 destinationRegionName = finalDestination.RegionName;
219 }
204 } 220 }
205 } 221 }
206 catch (Exception e) 222 catch (Exception e)
@@ -210,11 +226,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
210 sp.Name, sp.AbsolutePosition, sp.Scene.RegionInfo.RegionName, position, destinationRegionName, 226 sp.Name, sp.AbsolutePosition, sp.Scene.RegionInfo.RegionName, position, destinationRegionName,
211 e.Message, e.StackTrace); 227 e.Message, e.StackTrace);
212 228
213 // Make sure that we clear the in-transit flag so that future teleport attempts don't always fail.
214 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
215
216 sp.ControllingClient.SendTeleportFailed("Internal error"); 229 sp.ControllingClient.SendTeleportFailed("Internal error");
217 } 230 }
231 finally
232 {
233 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
234 }
218 } 235 }
219 236
220 /// <summary> 237 /// <summary>
@@ -230,15 +247,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
230 "[ENTITY TRANSFER MODULE]: Teleport for {0} to {1} within {2}", 247 "[ENTITY TRANSFER MODULE]: Teleport for {0} to {1} within {2}",
231 sp.Name, position, sp.Scene.RegionInfo.RegionName); 248 sp.Name, position, sp.Scene.RegionInfo.RegionName);
232 249
233 if (!m_entityTransferStateMachine.SetInTransit(sp.UUID))
234 {
235 m_log.DebugFormat(
236 "[ENTITY TRANSFER MODULE]: Ignoring within region teleport request of {0} {1} to {2} - agent is already in transit.",
237 sp.Name, sp.UUID, position);
238
239 return;
240 }
241
242 // Teleport within the same region 250 // Teleport within the same region
243 if (IsOutsideRegion(sp.Scene, position) || position.Z < 0) 251 if (IsOutsideRegion(sp.Scene, position) || position.Z < 0)
244 { 252 {
@@ -287,7 +295,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
287 } 295 }
288 296
289 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); 297 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
290 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
291 } 298 }
292 299
293 /// <summary> 300 /// <summary>
@@ -341,7 +348,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
341 // 348 //
342 // This is it 349 // This is it
343 // 350 //
344 DoTeleport(sp, reg, finalDestination, position, lookAt, teleportFlags); 351 DoTeleportInternal(sp, reg, finalDestination, position, lookAt, teleportFlags);
345 // 352 //
346 // 353 //
347 // 354 //
@@ -396,27 +403,54 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
396 && Math.Abs(sourceRegion.RegionLocY - destRegion.RegionCoordY) <= MaxTransferDistance; 403 && Math.Abs(sourceRegion.RegionLocY - destRegion.RegionCoordY) <= MaxTransferDistance;
397 } 404 }
398 405
406 /// <summary>
407 /// Wraps DoTeleportInternal() and manages the transfer state.
408 /// </summary>
399 public void DoTeleport( 409 public void DoTeleport(
400 ScenePresence sp, GridRegion reg, GridRegion finalDestination, 410 ScenePresence sp, GridRegion reg, GridRegion finalDestination,
401 Vector3 position, Vector3 lookAt, uint teleportFlags) 411 Vector3 position, Vector3 lookAt, uint teleportFlags)
402 { 412 {
403 // Record that this agent is in transit so that we can prevent simultaneous requests and do later detection 413 // Record that this agent is in transit so that we can prevent simultaneous requests and do later detection
404 // of whether the destination region completes the teleport. 414 // of whether the destination region completes the teleport.
405 m_entityTransferStateMachine.SetInTransit(sp.UUID); 415 if (!m_entityTransferStateMachine.SetInTransit(sp.UUID))
406// if (!m_entityTransferStateMachine.SetInTransit(sp.UUID)) 416 {
407// { 417 m_log.DebugFormat(
408// m_log.DebugFormat( 418 "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
409// "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.", 419 sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
410// sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
411//
412// return;
413// }
414 420
415 if (reg == null || finalDestination == null) 421 return;
422 }
423
424 try
425 {
426 DoTeleportInternal(sp, reg, finalDestination, position, lookAt, teleportFlags);
427 }
428 catch (Exception e)
429 {
430 m_log.ErrorFormat(
431 "[ENTITY TRANSFER MODULE]: Exception on teleport of {0} from {1}@{2} to {3}@{4}: {5}{6}",
432 sp.Name, sp.AbsolutePosition, sp.Scene.RegionInfo.RegionName, position, finalDestination.RegionName,
433 e.Message, e.StackTrace);
434
435 sp.ControllingClient.SendTeleportFailed("Internal error");
436 }
437 finally
416 { 438 {
417 sp.ControllingClient.SendTeleportFailed("Unable to locate destination");
418 m_entityTransferStateMachine.ResetFromTransit(sp.UUID); 439 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
440 }
441 }
419 442
443 /// <summary>
444 /// Teleports the agent to another region.
445 /// This method doesn't manage the transfer state; the caller must do that.
446 /// </summary>
447 private void DoTeleportInternal(
448 ScenePresence sp, GridRegion reg, GridRegion finalDestination,
449 Vector3 position, Vector3 lookAt, uint teleportFlags)
450 {
451 if (reg == null || finalDestination == null)
452 {
453 sp.ControllingClient.SendTeleportFailed("Unable to locate destination");
420 return; 454 return;
421 } 455 }
422 456
@@ -436,8 +470,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
436 sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY, 470 sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY,
437 MaxTransferDistance)); 471 MaxTransferDistance));
438 472
439 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
440
441 return; 473 return;
442 } 474 }
443 475
@@ -455,7 +487,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
455 if (endPoint == null || endPoint.Address == null) 487 if (endPoint == null || endPoint.Address == null)
456 { 488 {
457 sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down"); 489 sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down");
458 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
459 490
460 return; 491 return;
461 } 492 }
@@ -477,7 +508,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
477 finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason)) 508 finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason))
478 { 509 {
479 sp.ControllingClient.SendTeleportFailed(reason); 510 sp.ControllingClient.SendTeleportFailed(reason);
480 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
481 511
482 m_log.DebugFormat( 512 m_log.DebugFormat(
483 "[ENTITY TRANSFER MODULE]: {0} was stopped from teleporting from {1} to {2} because {3}", 513 "[ENTITY TRANSFER MODULE]: {0} was stopped from teleporting from {1} to {2} because {3}",
@@ -535,7 +565,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
535 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) 565 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
536 { 566 {
537 sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}", reason)); 567 sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}", reason));
538 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
539 568
540 m_log.DebugFormat( 569 m_log.DebugFormat(
541 "[ENTITY TRANSFER MODULE]: Teleport of {0} from {1} to {2} was refused because {3}", 570 "[ENTITY TRANSFER MODULE]: Teleport of {0} from {1} to {2} was refused because {3}",
@@ -636,7 +665,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
636 "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.", 665 "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.",
637 sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); 666 sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName);
638 667
639 Fail(sp, finalDestination, logout); 668 Fail(sp, finalDestination, logout);
640 return; 669 return;
641 } 670 }
642 671
@@ -689,8 +718,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
689// "[ENTITY TRANSFER MODULE]: User {0} is going to another region, profile cache removed", 718// "[ENTITY TRANSFER MODULE]: User {0} is going to another region, profile cache removed",
690// sp.UUID); 719// sp.UUID);
691// } 720// }
692
693 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
694 } 721 }
695 722
696 protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout) 723 protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
@@ -710,8 +737,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
710 Scene.SimulationService.CloseAgent(finalDestination, sp.UUID); 737 Scene.SimulationService.CloseAgent(finalDestination, sp.UUID);
711 738
712 sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); 739 sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout);
713
714 m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
715 } 740 }
716 741
717 protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) 742 protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
@@ -1139,7 +1164,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1139 1164
1140 ReInstantiateScripts(agent); 1165 ReInstantiateScripts(agent);
1141 agent.AddToPhysicalScene(isFlying); 1166 agent.AddToPhysicalScene(isFlying);
1142 m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
1143 1167
1144 return false; 1168 return false;
1145 } 1169 }
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index c439ea8..4f6b92e 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -88,11 +88,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
88 IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"]; 88 IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"];
89 if (thisModuleConfig != null) 89 if (thisModuleConfig != null)
90 { 90 {
91 m_HomeURI = Util.GetConfigVarWithDefaultSection(source, "HomeURI", "HGInventoryAccessModule"); 91 m_HomeURI = Util.GetConfigVarFromSections<string>(source, "HomeURI", new string[] {"Startup", "HGInventoryAccessModule"});
92 m_OutboundPermission = thisModuleConfig.GetBoolean("OutboundPermission", true); 92 m_ThisGatekeeper = Util.GetConfigVarFromSections<string>(source, "GatekeeperURI", new string[] {"Startup", "HGInventoryAccessModule"});
93 m_ThisGatekeeper = Util.GetConfigVarWithDefaultSection(source, "GatekeeperURI", "HGInventoryAccessModule");
94 // Legacy. Renove soon! 93 // Legacy. Renove soon!
95 m_ThisGatekeeper = thisModuleConfig.GetString("Gatekeeper", m_ThisGatekeeper); 94 m_ThisGatekeeper = thisModuleConfig.GetString("Gatekeeper", m_ThisGatekeeper);
95
96 m_OutboundPermission = thisModuleConfig.GetBoolean("OutboundPermission", true);
96 m_RestrictInventoryAccessAbroad = thisModuleConfig.GetBoolean("RestrictInventoryAccessAbroad", true); 97 m_RestrictInventoryAccessAbroad = thisModuleConfig.GetBoolean("RestrictInventoryAccessAbroad", true);
97 } 98 }
98 else 99 else
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
index 13d9d31..e8bf194 100644
--- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
+++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Region.DataSnapshot
113 try 113 try
114 { 114 {
115 m_enabled = config.Configs["DataSnapshot"].GetBoolean("index_sims", m_enabled); 115 m_enabled = config.Configs["DataSnapshot"].GetBoolean("index_sims", m_enabled);
116 string gatekeeper = Util.GetConfigVarWithDefaultSection(config, "GatekeeperURI", "GridService"); 116 string gatekeeper = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] {"Startup", "GridService"});
117 // Legacy. Remove soon! 117 // Legacy. Remove soon!
118 if (string.IsNullOrEmpty(gatekeeper)) 118 if (string.IsNullOrEmpty(gatekeeper))
119 { 119 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9bc9c2d..f2aa0c5 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -703,6 +703,12 @@ namespace OpenSim.Region.Framework.Scenes
703 703
704 private bool m_inTransit; 704 private bool m_inTransit;
705 705
706 /// <summary>
707 /// This signals whether the presence is in transit between neighbouring regions.
708 /// </summary>
709 /// <remarks>
710 /// It is not set when the presence is teleporting or logging in/out directly to a region.
711 /// </remarks>
706 public bool IsInTransit 712 public bool IsInTransit
707 { 713 {
708 get { return m_inTransit; } 714 get { return m_inTransit; }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index d64e6d7..4c018d4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2173,7 +2173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2173 m_host.AddScriptLPS(1); 2173 m_host.AddScriptLPS(1);
2174 2174
2175 IConfigSource config = m_ScriptEngine.ConfigSource; 2175 IConfigSource config = m_ScriptEngine.ConfigSource;
2176 string HomeURI = Util.GetConfigVarWithDefaultSection(config, "HomeURI", string.Empty); 2176 string HomeURI = Util.GetConfigVarFromSections<string>(config, "HomeURI", new string[]{"Startup"});
2177 2177
2178 if (!string.IsNullOrEmpty(HomeURI)) 2178 if (!string.IsNullOrEmpty(HomeURI))
2179 return HomeURI; 2179 return HomeURI;
@@ -2194,7 +2194,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2194 m_host.AddScriptLPS(1); 2194 m_host.AddScriptLPS(1);
2195 2195
2196 IConfigSource config = m_ScriptEngine.ConfigSource; 2196 IConfigSource config = m_ScriptEngine.ConfigSource;
2197 string gatekeeperURI = Util.GetConfigVarWithDefaultSection(config, "GatekeeperURI", string.Empty); 2197 string gatekeeperURI = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] {"Startup"});
2198 2198
2199 if (!string.IsNullOrEmpty(gatekeeperURI)) 2199 if (!string.IsNullOrEmpty(gatekeeperURI))
2200 return gatekeeperURI; 2200 return gatekeeperURI;