aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMarck2010-11-26 22:46:48 +0100
committerMarck2010-11-26 22:46:48 +0100
commit2827deffe822378b6cb35dac6c90a21c3fbc0de7 (patch)
treecbb66c64b72892d850007fd8ff64b830216a2337 /OpenSim
parentFix handling of landmarks for systems with culture settings other than en_US.... (diff)
downloadopensim-SC_OLD-2827deffe822378b6cb35dac6c90a21c3fbc0de7.zip
opensim-SC_OLD-2827deffe822378b6cb35dac6c90a21c3fbc0de7.tar.gz
opensim-SC_OLD-2827deffe822378b6cb35dac6c90a21c3fbc0de7.tar.bz2
opensim-SC_OLD-2827deffe822378b6cb35dac6c90a21c3fbc0de7.tar.xz
Trigger changed event with CHANGED_TELEPORT when teleporting to another region.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs15
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs17
3 files changed, 18 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 129b52d..b1216c5 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2324,16 +2324,14 @@ namespace OpenSim.Region.Framework.Scenes
2324 m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); 2324 m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName);
2325 return false; 2325 return false;
2326 } 2326 }
2327 2327
2328 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 2); 2328 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
2329 2329
2330 newObject.ResumeScripts(); 2330 newObject.ResumeScripts();
2331 2331
2332 // Do this as late as possible so that listeners have full access to the incoming object 2332 // Do this as late as possible so that listeners have full access to the incoming object
2333 EventManager.TriggerOnIncomingSceneObject(newObject); 2333 EventManager.TriggerOnIncomingSceneObject(newObject);
2334 2334
2335 TriggerChangedTeleport(newObject);
2336
2337 return true; 2335 return true;
2338 } 2336 }
2339 2337
@@ -2441,7 +2439,7 @@ namespace OpenSim.Region.Framework.Scenes
2441 return true; 2439 return true;
2442 } 2440 }
2443 2441
2444 private void TriggerChangedTeleport(SceneObjectGroup sog) 2442 private int GetStateSource(SceneObjectGroup sog)
2445 { 2443 {
2446 ScenePresence sp = GetScenePresence(sog.OwnerID); 2444 ScenePresence sp = GetScenePresence(sog.OwnerID);
2447 2445
@@ -2452,13 +2450,12 @@ namespace OpenSim.Region.Framework.Scenes
2452 if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) 2450 if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default))
2453 { 2451 {
2454 // This will get your attention 2452 // This will get your attention
2455 //m_log.Error("[XXX] Triggering "); 2453 //m_log.Error("[XXX] Triggering CHANGED_TELEPORT");
2456 2454
2457 // Trigger CHANGED_TELEPORT 2455 return 5; // StateSource.Teleporting
2458 sp.Scene.EventManager.TriggerOnScriptChangedEvent(sog.LocalId, (uint)Changed.TELEPORT);
2459 } 2456 }
2460
2461 } 2457 }
2458 return 2; // StateSource.PrimCrossing
2462 } 2459 }
2463 2460
2464 #endregion 2461 #endregion
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index 0c99d8c..8b7871b 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -42,7 +42,8 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
42 NewRez = 1, 42 NewRez = 1,
43 PrimCrossing = 2, 43 PrimCrossing = 2,
44 ScriptedRez = 3, 44 ScriptedRez = 3,
45 AttachedRez = 4 45 AttachedRez = 4,
46 Teleporting = 5
46 } 47 }
47 48
48 public interface IScriptWorkItem 49 public interface IScriptWorkItem
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 660e9a3..8e712b6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -390,19 +390,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
390 } 390 }
391 else if (m_stateSource == StateSource.RegionStart) 391 else if (m_stateSource == StateSource.RegionStart)
392 { 392 {
393// m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); 393 //m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script");
394 PostEvent(new EventParams("changed", 394 PostEvent(new EventParams("changed",
395 new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) }, 395 new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) }, new DetectParams[0]));
396 new DetectParams[0]));
397 } 396 }
398 else if (m_stateSource == StateSource.PrimCrossing) 397 else if (m_stateSource == StateSource.PrimCrossing || m_stateSource == StateSource.Teleporting)
399 { 398 {
400 // CHANGED_REGION 399 // CHANGED_REGION
401 PostEvent(new EventParams("changed", 400 PostEvent(new EventParams("changed",
402 new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) }, 401 new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) }, new DetectParams[0]));
403 new DetectParams[0])); 402
403 // CHANGED_TELEPORT
404 if (m_stateSource == StateSource.Teleporting)
405 PostEvent(new EventParams("changed",
406 new Object[] { new LSL_Types.LSLInteger((int)Changed.TELEPORT) }, new DetectParams[0]));
404 } 407 }
405 } 408 }
406 else 409 else
407 { 410 {
408 Start(); 411 Start();