diff options
author | Adam Frisby | 2007-07-17 23:14:19 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-17 23:14:19 +0000 |
commit | 9fc72755ce137814d27edeb55e8c82c0124815ca (patch) | |
tree | 4edc564d3efc0335019646a0ab50034cef384be5 /OpenSim/Region | |
parent | * Working more on the Interpreted Script API (for use in scripts which have t... (diff) | |
download | opensim-SC-9fc72755ce137814d27edeb55e8c82c0124815ca.zip opensim-SC-9fc72755ce137814d27edeb55e8c82c0124815ca.tar.gz opensim-SC-9fc72755ce137814d27edeb55e8c82c0124815ca.tar.bz2 opensim-SC-9fc72755ce137814d27edeb55e8c82c0124815ca.tar.xz |
* More LSL related fun
Diffstat (limited to 'OpenSim/Region')
5 files changed, 23 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs index 1d82cd2..4ee4d37 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs | |||
@@ -12,8 +12,10 @@ namespace OpenSim.Region.Scripting.LSL | |||
12 | ScriptInfo scriptInfo; | 12 | ScriptInfo scriptInfo; |
13 | LSL.Engine lindenScriptEngine; | 13 | LSL.Engine lindenScriptEngine; |
14 | 14 | ||
15 | public LSLScript(string filename) | 15 | public LSLScript(string filename, libsecondlife.LLUUID taskObject) |
16 | { | 16 | { |
17 | scriptInfo.CreateTaskAPI(taskObject); | ||
18 | |||
17 | lindenScriptEngine = new Engine(); | 19 | lindenScriptEngine = new Engine(); |
18 | lindenScriptEngine.Start(filename); | 20 | lindenScriptEngine.Start(filename); |
19 | } | 21 | } |
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs index 65f73dd..10706ad 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs | |||
@@ -16,7 +16,7 @@ namespace OpenSim.Region.Scripting | |||
16 | 16 | ||
17 | public Dictionary<string, IScript> compile(string filename) | 17 | public Dictionary<string, IScript> compile(string filename) |
18 | { | 18 | { |
19 | LSLScript script = new LSLScript(filename); | 19 | LSLScript script = new LSLScript(filename, libsecondlife.LLUUID.Zero); |
20 | Dictionary<string, IScript> returns = new Dictionary<string, IScript>(); | 20 | Dictionary<string, IScript> returns = new Dictionary<string, IScript>(); |
21 | 21 | ||
22 | returns.Add(filename, script); | 22 | returns.Add(filename, script); |
diff --git a/OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs b/OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs index b4f6a05..b3a804d 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/ScriptAPI.cs | |||
@@ -18,10 +18,10 @@ namespace OpenSim.Region.Scripting | |||
18 | Scene scene; | 18 | Scene scene; |
19 | ScriptInterpretedAPI interpretedAPI; | 19 | ScriptInterpretedAPI interpretedAPI; |
20 | 20 | ||
21 | public ScriptAPI(Scene world) | 21 | public ScriptAPI(Scene world, Key taskID) |
22 | { | 22 | { |
23 | scene = world; | 23 | scene = world; |
24 | interpretedAPI = new ScriptInterpretedAPI(); | 24 | interpretedAPI = new ScriptInterpretedAPI(world, taskID); |
25 | } | 25 | } |
26 | 26 | ||
27 | public Object CallMethod(String method, Object[] args) | 27 | public Object CallMethod(String method, Object[] args) |
diff --git a/OpenSim/Region/Environment/Scenes/scripting/ScriptInfo.cs b/OpenSim/Region/Environment/Scenes/scripting/ScriptInfo.cs index 4a6086c..35a6d9f 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/ScriptInfo.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/ScriptInfo.cs | |||
@@ -52,7 +52,12 @@ namespace OpenSim.Region.Scripting | |||
52 | world = scene; | 52 | world = scene; |
53 | events = world.EventManager; | 53 | events = world.EventManager; |
54 | logger = MainLog.Instance; | 54 | logger = MainLog.Instance; |
55 | api = new ScriptAPI(scene); | 55 | api = new ScriptAPI(world, libsecondlife.LLUUID.Zero); |
56 | } | ||
57 | |||
58 | public void CreateTaskAPI(libsecondlife.LLUUID task) | ||
59 | { | ||
60 | api = new ScriptAPI(world, task); | ||
56 | } | 61 | } |
57 | } | 62 | } |
58 | } | 63 | } |
diff --git a/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs b/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs index 5153ed3..982cd65 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Scripting | |||
51 | /// <param name="member">The specific member being 'occupied' by the script</param> | 51 | /// <param name="member">The specific member being 'occupied' by the script</param> |
52 | public ScriptInterpretedAPI(Scene world, libsecondlife.LLUUID member) | 52 | public ScriptInterpretedAPI(Scene world, libsecondlife.LLUUID member) |
53 | { | 53 | { |
54 | m_object = world; | 54 | m_scene = world; |
55 | m_object = member; | 55 | m_object = member; |
56 | } | 56 | } |
57 | 57 | ||
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Scripting | |||
76 | int parcelID = 0; | 76 | int parcelID = 0; |
77 | 77 | ||
78 | Vector myPosition = Task.Pos; | 78 | Vector myPosition = Task.Pos; |
79 | Land myParcel = World.LandManager.getLandObject(myPosition.X, myPosition.Y, myPosition.Z); | 79 | Land myParcel = World.LandManager.getLandObject(myPosition.X, myPosition.Y); |
80 | 80 | ||
81 | OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); | 81 | OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); |
82 | return; | 82 | return; |
@@ -135,6 +135,15 @@ namespace OpenSim.Region.Scripting | |||
135 | [Obsolete("Unimplemented")] | 135 | [Obsolete("Unimplemented")] |
136 | public Key osAvatarOnSitTarget() | 136 | public Key osAvatarOnSitTarget() |
137 | { | 137 | { |
138 | //TODO: Follow this as Children is chanced to be of type entity to support ScenePresences | ||
139 | foreach (KeyValuePair<Key, Primitive> Child in Task.Children) | ||
140 | { | ||
141 | if (Child.Value is ScenePresence) | ||
142 | { | ||
143 | return Child.Value.uuid; | ||
144 | } | ||
145 | } | ||
146 | |||
138 | return Key.Zero; | 147 | return Key.Zero; |
139 | } | 148 | } |
140 | 149 | ||