aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common
diff options
context:
space:
mode:
authorCharles Krinke2008-09-15 14:32:02 +0000
committerCharles Krinke2008-09-15 14:32:02 +0000
commit5164fa24110b0197c2d18dc824351d384b1b8582 (patch)
treec6180377754fb75e812a65bf0cb224e37e107273 /OpenSim/Region/ScriptEngine/Common
parentUpdate svn properties, minor formatting cleanup, fix a compiler warning. (diff)
downloadopensim-SC_OLD-5164fa24110b0197c2d18dc824351d384b1b8582.zip
opensim-SC_OLD-5164fa24110b0197c2d18dc824351d384b1b8582.tar.gz
opensim-SC_OLD-5164fa24110b0197c2d18dc824351d384b1b8582.tar.bz2
opensim-SC_OLD-5164fa24110b0197c2d18dc824351d384b1b8582.tar.xz
Mantis#2197. Thank you kindly, Tyre, for a patch that:
adds the new function osTeleportAgent().
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs30
-rw-r--r--OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs4
4 files changed, 47 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
index 1b7cc48..cfc8e94 100644
--- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
@@ -37,7 +37,7 @@ using rotation = OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion;
37 37
38namespace OpenSim.Region.ScriptEngine.Common 38namespace OpenSim.Region.ScriptEngine.Common
39{ 39{
40 public class BuiltIn_Commands_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript 40 public class BuiltIn_Commands_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, OSSL_BuilIn_Commands_Interface, IScript
41 { 41 {
42 // 42 //
43 // Included as base for any LSL-script that is compiled. 43 // Included as base for any LSL-script that is compiled.
@@ -1942,6 +1942,18 @@ namespace OpenSim.Region.ScriptEngine.Common
1942 m_LSL_Functions.osSetPrimFloatOnWater(floatYN); 1942 m_LSL_Functions.osSetPrimFloatOnWater(floatYN);
1943 } 1943 }
1944 1944
1945 // Teleport Functions
1946
1947 public void osTeleportAgent(string agent, string regionName, vector position, vector lookat)
1948 {
1949 m_LSL_Functions.osTeleportAgent(agent, regionName, position, lookat);
1950 }
1951
1952 public void osTeleportAgent(string agent, vector position, vector lookat)
1953 {
1954 m_LSL_Functions.osTeleportAgent(agent, position, lookat);
1955 }
1956
1945 // Animation Functions 1957 // Animation Functions
1946 1958
1947 public void osAvatarPlayAnimation(string avatar, string animation) 1959 public void osAvatarPlayAnimation(string avatar, string animation)
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 39502b6..5d6cd37 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Region.ScriptEngine.Common
88 private float m_distanceFactor = 1.0f; 88 private float m_distanceFactor = 1.0f;
89 89
90 90
91 private void ScriptSleep(int delay) 91 protected void ScriptSleep(int delay)
92 { 92 {
93 delay = (int)((float)delay * m_delayFactor); 93 delay = (int)((float)delay * m_delayFactor);
94 if (delay == 0) 94 if (delay == 0)
diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs
index c6ded79..264a586 100644
--- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs
@@ -32,7 +32,7 @@ using OpenSim.Framework.Console;
32using OpenSim.Region.Environment.Interfaces; 32using OpenSim.Region.Environment.Interfaces;
33using OpenSim.Region.Environment.Scenes; 33using OpenSim.Region.Environment.Scenes;
34using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; 34using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase;
35 35using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
36//using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; 36//using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL;
37 37
38namespace OpenSim.Region.ScriptEngine.Common 38namespace OpenSim.Region.ScriptEngine.Common
@@ -436,6 +436,34 @@ namespace OpenSim.Region.ScriptEngine.Common
436 } 436 }
437 } 437 }
438 438
439 // Teleport functions
440 public void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
441 {
442 m_host.AddScriptLPS(1);
443 UUID agentId = new UUID();
444 if (UUID.TryParse(agent, out agentId))
445 {
446 ScenePresence presence = World.GetScenePresence(agentId);
447 if (presence != null)
448 {
449 // agent must be over owners land to avoid abuse
450 if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y))
451 {
452 World.RequestTeleportLocation(presence.ControllingClient, regionName,
453 new Vector3((float)position.x, (float)position.y, (float)position.z),
454 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation);
455 // ScriptSleep(5000);
456
457 }
458 }
459 }
460 }
461
462 public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
463 {
464 osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat);
465 }
466
439 // Adam's super super custom animation functions 467 // Adam's super super custom animation functions
440 public void osAvatarPlayAnimation(string avatar, string animation) 468 public void osAvatarPlayAnimation(string avatar, string animation)
441 { 469 {
diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs
index 7daef7d..9c1587d 100644
--- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs
+++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs
@@ -44,6 +44,10 @@ namespace OpenSim.Region.ScriptEngine.Common
44 void osSetParcelMediaURL(string url); 44 void osSetParcelMediaURL(string url);
45 void osSetPrimFloatOnWater(int floatYN); 45 void osSetPrimFloatOnWater(int floatYN);
46 46
47 // Teleport commands
48 void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
49 void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
50
47 // Animation commands 51 // Animation commands
48 void osAvatarPlayAnimation(string avatar, string animation); 52 void osAvatarPlayAnimation(string avatar, string animation);
49 void osAvatarStopAnimation(string avatar, string animation); 53 void osAvatarStopAnimation(string avatar, string animation);