diff options
Diffstat (limited to '')
9 files changed, 80 insertions, 30 deletions
diff --git a/OpenSim/Grid/ScriptServer/Application.cs b/OpenSim/Grid/ScriptServer/Application.cs index 7b62727..9893249 100644 --- a/OpenSim/Grid/ScriptServer/Application.cs +++ b/OpenSim/Grid/ScriptServer/Application.cs | |||
@@ -49,8 +49,8 @@ namespace OpenSim.Grid.ScriptServer | |||
49 | Console.WriteLine("APPLICATION EXCEPTION DETECTED"); | 49 | Console.WriteLine("APPLICATION EXCEPTION DETECTED"); |
50 | Console.WriteLine(""); | 50 | Console.WriteLine(""); |
51 | Console.WriteLine("Application is terminating: " + e.IsTerminating.ToString()); | 51 | Console.WriteLine("Application is terminating: " + e.IsTerminating.ToString()); |
52 | Console.WriteLine("Exception:"); | 52 | //Console.WriteLine("Exception:"); |
53 | Console.WriteLine(e.ExceptionObject.ToString()); | 53 | //Console.WriteLine(e.ExceptionObject.ToString()); |
54 | } | 54 | } |
55 | } | 55 | } |
56 | } \ No newline at end of file | 56 | } \ No newline at end of file |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index f86aaba..de70347 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System.IO; | 29 | using System.IO; |
30 | using libsecondlife; | ||
30 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
31 | using OpenSim.Framework.Console; | 32 | using OpenSim.Framework.Console; |
32 | using OpenSim.Grid.ScriptServer.ScriptServer; | 33 | using OpenSim.Grid.ScriptServer.ScriptServer; |
@@ -46,6 +47,7 @@ namespace OpenSim.Grid.ScriptServer | |||
46 | 47 | ||
47 | // TEMP | 48 | // TEMP |
48 | public static ScriptServerInterfaces.ScriptEngine Engine; | 49 | public static ScriptServerInterfaces.ScriptEngine Engine; |
50 | //public static FakeScene m_Scene = new FakeScene(null,null,null,null,null,null,null,null,null,false, false, false); | ||
49 | 51 | ||
50 | // Objects we use | 52 | // Objects we use |
51 | internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region | 53 | internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region |
@@ -64,6 +66,8 @@ namespace OpenSim.Grid.ScriptServer | |||
64 | 66 | ||
65 | // Load DotNetEngine | 67 | // Load DotNetEngine |
66 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); | 68 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); |
69 | Engine.InitializeEngine(null, m_log, false); | ||
70 | |||
67 | 71 | ||
68 | // Set up server | 72 | // Set up server |
69 | //m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); | 73 | //m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); |
@@ -85,6 +89,11 @@ namespace OpenSim.Grid.ScriptServer | |||
85 | m_log.Notice("SERVER", "Param " + i + ": " + p[i].ToString()); | 89 | m_log.Notice("SERVER", "Param " + i + ": " + p[i].ToString()); |
86 | } | 90 | } |
87 | } | 91 | } |
92 | |||
93 | if (Command == "OnRezScript") | ||
94 | { | ||
95 | Engine.EventManager().OnRezScript((uint)p[0], new LLUUID((string)p[1]), (string)p[2]); | ||
96 | } | ||
88 | } | 97 | } |
89 | 98 | ||
90 | ~ScriptServerMain() | 99 | ~ScriptServerMain() |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index 14b97b8..23ef126 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs | |||
@@ -1,5 +1,7 @@ | |||
1 | using libsecondlife; | 1 | using libsecondlife; |
2 | using OpenSim.Framework; | 2 | using OpenSim.Framework; |
3 | using OpenSim.Framework.Console; | ||
4 | using OpenSim.Region.Environment.Scenes; | ||
3 | 5 | ||
4 | namespace OpenSim.Region.ScriptEngine.Common | 6 | namespace OpenSim.Region.ScriptEngine.Common |
5 | { | 7 | { |
@@ -50,6 +52,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
50 | public interface ScriptEngine | 52 | public interface ScriptEngine |
51 | { | 53 | { |
52 | RemoteEvents EventManager(); | 54 | RemoteEvents EventManager(); |
55 | void InitializeEngine(Scene Sceneworld, LogBase logger, bool DontHookUp); | ||
53 | } | 56 | } |
54 | 57 | ||
55 | } | 58 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs index b6c2e93..10abc35 100644 --- a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs +++ b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs | |||
@@ -2,6 +2,7 @@ | |||
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Diagnostics; | 3 | using System.Diagnostics; |
4 | using System.Text; | 4 | using System.Text; |
5 | using libsecondlife; | ||
5 | using OpenSim.Region.ScriptEngine.Common.TRPC; | 6 | using OpenSim.Region.ScriptEngine.Common.TRPC; |
6 | 7 | ||
7 | namespace OpenSim.Region.ScriptEngine.Common | 8 | namespace OpenSim.Region.ScriptEngine.Common |
@@ -22,7 +23,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
22 | typeof(System.Int64), | 23 | typeof(System.Int64), |
23 | typeof(System.Double), | 24 | typeof(System.Double), |
24 | typeof(System.Decimal), | 25 | typeof(System.Decimal), |
25 | typeof(System.Array) | 26 | typeof(System.Array), |
27 | typeof(LLUUID), | ||
28 | typeof(System.UInt16), | ||
29 | typeof(System.UInt32), | ||
30 | typeof(System.UInt64) | ||
26 | }; | 31 | }; |
27 | 32 | ||
28 | // TODO: Maybe we should move queue into TCPSocket so we won't have to keep one queue instance per connection | 33 | // TODO: Maybe we should move queue into TCPSocket so we won't have to keep one queue instance per connection |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index ad29feb..a36691d 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | |||
@@ -55,34 +55,30 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
55 | 55 | ||
56 | private ScriptEngine myScriptEngine; | 56 | private ScriptEngine myScriptEngine; |
57 | //public IScriptHost TEMP_OBJECT_ID; | 57 | //public IScriptHost TEMP_OBJECT_ID; |
58 | public EventManager(ScriptEngine _ScriptEngine) | 58 | public EventManager(ScriptEngine _ScriptEngine, bool performHookUp) |
59 | { | 59 | { |
60 | myScriptEngine = _ScriptEngine; | 60 | myScriptEngine = _ScriptEngine; |
61 | // TODO: HOOK EVENTS UP TO SERVER! | ||
62 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Start"); | ||
63 | // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager | ||
64 | 61 | ||
65 | // Hook up a test event to our test form | 62 | // Hook up to events from OpenSim |
66 | myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); | 63 | // We may not want to do it because someone is controlling us and will deliver events to us |
67 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | 64 | if (performHookUp) |
68 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | 65 | { |
69 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | 66 | myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); |
67 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | ||
68 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | ||
69 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | ||
70 | // TODO: HOOK ALL EVENTS UP TO SERVER! | ||
71 | } | ||
70 | } | 72 | } |
71 | 73 | ||
72 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 74 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
73 | { | 75 | { |
74 | // Add to queue for all scripts in ObjectID object | 76 | // Add to queue for all scripts in ObjectID object |
75 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); | ||
76 | //Console.WriteLine("touch_start localID: " + localID); | ||
77 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); | 77 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); |
78 | } | 78 | } |
79 | 79 | ||
80 | public void OnRezScript(uint localID, LLUUID itemID, string script) | 80 | public void OnRezScript(uint localID, LLUUID itemID, string script) |
81 | { | 81 | { |
82 | //myScriptEngine.myScriptManager.StartScript( | ||
83 | // Path.Combine("ScriptEngines", "Default.lsl"), | ||
84 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() | ||
85 | //); | ||
86 | Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + | 82 | Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + |
87 | script.Length); | 83 | script.Length); |
88 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script); | 84 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script); |
@@ -90,10 +86,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
90 | 86 | ||
91 | public void OnRemoveScript(uint localID, LLUUID itemID) | 87 | public void OnRemoveScript(uint localID, LLUUID itemID) |
92 | { | 88 | { |
93 | //myScriptEngine.myScriptManager.StartScript( | ||
94 | // Path.Combine("ScriptEngines", "Default.lsl"), | ||
95 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() | ||
96 | //); | ||
97 | Console.WriteLine("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString()); | 89 | Console.WriteLine("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString()); |
98 | myScriptEngine.m_ScriptManager.StopScript( | 90 | myScriptEngine.m_ScriptManager.StopScript( |
99 | localID, | 91 | localID, |
@@ -102,134 +94,166 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
102 | } | 94 | } |
103 | 95 | ||
104 | // TODO: Replace placeholders below | 96 | // TODO: Replace placeholders below |
97 | // NOTE! THE PARAMETERS FOR THESE FUNCTIONS ARE NOT CORRECT! | ||
105 | // These needs to be hooked up to OpenSim during init of this class | 98 | // These needs to be hooked up to OpenSim during init of this class |
106 | // then queued in EventQueueManager. | 99 | // then queued in EventQueueManager. |
107 | // When queued in EventQueueManager they need to be LSL compatible (name and params) | 100 | // When queued in EventQueueManager they need to be LSL compatible (name and params) |
108 | 101 | ||
109 | //public void state_entry() { } // | ||
110 | public void state_exit(uint localID, LLUUID itemID) | 102 | public void state_exit(uint localID, LLUUID itemID) |
111 | { | 103 | { |
104 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_exit"); | ||
112 | } | 105 | } |
113 | 106 | ||
114 | //public void touch_start(uint localID, LLUUID itemID) { } | ||
115 | public void touch(uint localID, LLUUID itemID) | 107 | public void touch(uint localID, LLUUID itemID) |
116 | { | 108 | { |
109 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch"); | ||
117 | } | 110 | } |
118 | 111 | ||
119 | public void touch_end(uint localID, LLUUID itemID) | 112 | public void touch_end(uint localID, LLUUID itemID) |
120 | { | 113 | { |
114 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end"); | ||
121 | } | 115 | } |
122 | 116 | ||
123 | public void collision_start(uint localID, LLUUID itemID) | 117 | public void collision_start(uint localID, LLUUID itemID) |
124 | { | 118 | { |
119 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_start"); | ||
125 | } | 120 | } |
126 | 121 | ||
127 | public void collision(uint localID, LLUUID itemID) | 122 | public void collision(uint localID, LLUUID itemID) |
128 | { | 123 | { |
124 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision"); | ||
129 | } | 125 | } |
130 | 126 | ||
131 | public void collision_end(uint localID, LLUUID itemID) | 127 | public void collision_end(uint localID, LLUUID itemID) |
132 | { | 128 | { |
129 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_end"); | ||
133 | } | 130 | } |
134 | 131 | ||
135 | public void land_collision_start(uint localID, LLUUID itemID) | 132 | public void land_collision_start(uint localID, LLUUID itemID) |
136 | { | 133 | { |
134 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_start"); | ||
137 | } | 135 | } |
138 | 136 | ||
139 | public void land_collision(uint localID, LLUUID itemID) | 137 | public void land_collision(uint localID, LLUUID itemID) |
140 | { | 138 | { |
139 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision"); | ||
141 | } | 140 | } |
142 | 141 | ||
143 | public void land_collision_end(uint localID, LLUUID itemID) | 142 | public void land_collision_end(uint localID, LLUUID itemID) |
144 | { | 143 | { |
144 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_end"); | ||
145 | } | 145 | } |
146 | 146 | ||
147 | // Handled by long commands | ||
147 | public void timer(uint localID, LLUUID itemID) | 148 | public void timer(uint localID, LLUUID itemID) |
148 | { | 149 | { |
150 | //myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, ""); | ||
149 | } | 151 | } |
150 | 152 | ||
151 | public void listen(uint localID, LLUUID itemID) | 153 | public void listen(uint localID, LLUUID itemID) |
152 | { | 154 | { |
155 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "listen"); | ||
153 | } | 156 | } |
154 | 157 | ||
155 | public void on_rez(uint localID, LLUUID itemID) | 158 | public void on_rez(uint localID, LLUUID itemID) |
156 | { | 159 | { |
160 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "on_rez"); | ||
157 | } | 161 | } |
158 | 162 | ||
159 | public void sensor(uint localID, LLUUID itemID) | 163 | public void sensor(uint localID, LLUUID itemID) |
160 | { | 164 | { |
165 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "sensor"); | ||
161 | } | 166 | } |
162 | 167 | ||
163 | public void no_sensor(uint localID, LLUUID itemID) | 168 | public void no_sensor(uint localID, LLUUID itemID) |
164 | { | 169 | { |
170 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor"); | ||
165 | } | 171 | } |
166 | 172 | ||
167 | public void control(uint localID, LLUUID itemID) | 173 | public void control(uint localID, LLUUID itemID) |
168 | { | 174 | { |
175 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control"); | ||
169 | } | 176 | } |
170 | 177 | ||
171 | public void money(uint localID, LLUUID itemID) | 178 | public void money(uint localID, LLUUID itemID) |
172 | { | 179 | { |
180 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "money"); | ||
173 | } | 181 | } |
174 | 182 | ||
175 | public void email(uint localID, LLUUID itemID) | 183 | public void email(uint localID, LLUUID itemID) |
176 | { | 184 | { |
185 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email"); | ||
177 | } | 186 | } |
178 | 187 | ||
179 | public void at_target(uint localID, LLUUID itemID) | 188 | public void at_target(uint localID, LLUUID itemID) |
180 | { | 189 | { |
190 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_target"); | ||
181 | } | 191 | } |
182 | 192 | ||
183 | public void not_at_target(uint localID, LLUUID itemID) | 193 | public void not_at_target(uint localID, LLUUID itemID) |
184 | { | 194 | { |
195 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_target"); | ||
185 | } | 196 | } |
186 | 197 | ||
187 | public void at_rot_target(uint localID, LLUUID itemID) | 198 | public void at_rot_target(uint localID, LLUUID itemID) |
188 | { | 199 | { |
200 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_rot_target"); | ||
189 | } | 201 | } |
190 | 202 | ||
191 | public void not_at_rot_target(uint localID, LLUUID itemID) | 203 | public void not_at_rot_target(uint localID, LLUUID itemID) |
192 | { | 204 | { |
205 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_rot_target"); | ||
193 | } | 206 | } |
194 | 207 | ||
195 | public void run_time_permissions(uint localID, LLUUID itemID) | 208 | public void run_time_permissions(uint localID, LLUUID itemID) |
196 | { | 209 | { |
210 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "run_time_permissions"); | ||
197 | } | 211 | } |
198 | 212 | ||
199 | public void changed(uint localID, LLUUID itemID) | 213 | public void changed(uint localID, LLUUID itemID) |
200 | { | 214 | { |
215 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "changed"); | ||
201 | } | 216 | } |
202 | 217 | ||
203 | public void attach(uint localID, LLUUID itemID) | 218 | public void attach(uint localID, LLUUID itemID) |
204 | { | 219 | { |
220 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "attach"); | ||
205 | } | 221 | } |
206 | 222 | ||
207 | public void dataserver(uint localID, LLUUID itemID) | 223 | public void dataserver(uint localID, LLUUID itemID) |
208 | { | 224 | { |
225 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "dataserver"); | ||
209 | } | 226 | } |
210 | 227 | ||
211 | public void link_message(uint localID, LLUUID itemID) | 228 | public void link_message(uint localID, LLUUID itemID) |
212 | { | 229 | { |
230 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "link_message"); | ||
213 | } | 231 | } |
214 | 232 | ||
215 | public void moving_start(uint localID, LLUUID itemID) | 233 | public void moving_start(uint localID, LLUUID itemID) |
216 | { | 234 | { |
235 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_start"); | ||
217 | } | 236 | } |
218 | 237 | ||
219 | public void moving_end(uint localID, LLUUID itemID) | 238 | public void moving_end(uint localID, LLUUID itemID) |
220 | { | 239 | { |
240 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_end"); | ||
221 | } | 241 | } |
222 | 242 | ||
223 | public void object_rez(uint localID, LLUUID itemID) | 243 | public void object_rez(uint localID, LLUUID itemID) |
224 | { | 244 | { |
245 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "object_rez"); | ||
225 | } | 246 | } |
226 | 247 | ||
227 | public void remote_data(uint localID, LLUUID itemID) | 248 | public void remote_data(uint localID, LLUUID itemID) |
228 | { | 249 | { |
250 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "remote_data"); | ||
229 | } | 251 | } |
230 | 252 | ||
253 | // Handled by long commands | ||
231 | public void http_response(uint localID, LLUUID itemID) | 254 | public void http_response(uint localID, LLUUID itemID) |
232 | { | 255 | { |
256 | // myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "http_response"); | ||
233 | } | 257 | } |
234 | } | 258 | } |
235 | } \ No newline at end of file | 259 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs index e2b11cc..e7cb489 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs | |||
@@ -314,7 +314,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
314 | /// <param name="localID"></param> | 314 | /// <param name="localID"></param> |
315 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | 315 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> |
316 | /// <param name="param">Array of parameters to match event mask</param> | 316 | /// <param name="param">Array of parameters to match event mask</param> |
317 | public void AddToObjectQueue(uint localID, string FunctionName, object[] param) | 317 | public void AddToObjectQueue(uint localID, string FunctionName, params object[] param) |
318 | { | 318 | { |
319 | // Determine all scripts in Object and add to their queue | 319 | // Determine all scripts in Object and add to their queue |
320 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); | 320 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); |
@@ -345,7 +345,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
345 | /// <param name="itemID"></param> | 345 | /// <param name="itemID"></param> |
346 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | 346 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> |
347 | /// <param name="param">Array of parameters to match event mask</param> | 347 | /// <param name="param">Array of parameters to match event mask</param> |
348 | public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, object[] param) | 348 | public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, params object[] param) |
349 | { | 349 | { |
350 | lock (queueLock) | 350 | lock (queueLock) |
351 | { | 351 | { |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs index e403385..1e4dc99 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs | |||
@@ -202,6 +202,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
202 | 202 | ||
203 | public void CheckHttpRequests() | 203 | public void CheckHttpRequests() |
204 | { | 204 | { |
205 | if (m_ScriptEngine.World == null) | ||
206 | return; | ||
207 | |||
205 | IHttpRequests iHttpReq = | 208 | IHttpRequests iHttpReq = |
206 | m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>(); | 209 | m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>(); |
207 | 210 | ||
@@ -241,6 +244,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
241 | 244 | ||
242 | public void CheckXMLRPCRequests() | 245 | public void CheckXMLRPCRequests() |
243 | { | 246 | { |
247 | if (m_ScriptEngine.World == null) | ||
248 | return; | ||
249 | |||
244 | IXMLRPC xmlrpc = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); | 250 | IXMLRPC xmlrpc = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); |
245 | 251 | ||
246 | if (xmlrpc != null) | 252 | if (xmlrpc != null) |
@@ -266,6 +272,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
266 | 272 | ||
267 | public void CheckListeners() | 273 | public void CheckListeners() |
268 | { | 274 | { |
275 | if (m_ScriptEngine.World == null) | ||
276 | return; | ||
269 | IWorldComm comms = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 277 | IWorldComm comms = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
270 | 278 | ||
271 | while (comms.HasMessages()) | 279 | while (comms.HasMessages()) |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index 604a5f3..c3cb34d 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
62 | get { return m_log; } | 62 | get { return m_log; } |
63 | } | 63 | } |
64 | 64 | ||
65 | public void InitializeEngine(Scene Sceneworld, LogBase logger) | 65 | public void InitializeEngine(Scene Sceneworld, LogBase logger, bool HookUpToServer) |
66 | { | 66 | { |
67 | World = Sceneworld; | 67 | World = Sceneworld; |
68 | m_log = logger; | 68 | m_log = logger; |
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
73 | 73 | ||
74 | // Create all objects we'll be using | 74 | // Create all objects we'll be using |
75 | m_EventQueueManager = new EventQueueManager(this); | 75 | m_EventQueueManager = new EventQueueManager(this); |
76 | m_EventManager = new EventManager(this); | 76 | m_EventManager = new EventManager(this, HookUpToServer); |
77 | m_ScriptManager = new ScriptManager(this); | 77 | m_ScriptManager = new ScriptManager(this); |
78 | m_AppDomainManager = new AppDomainManager(); | 78 | m_AppDomainManager = new AppDomainManager(); |
79 | m_LSLLongCmdHandler = new LSLLongCmdHandler(this); | 79 | m_LSLLongCmdHandler = new LSLLongCmdHandler(this); |
@@ -97,7 +97,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
97 | 97 | ||
98 | public void Initialise(Scene scene, IConfigSource config) | 98 | public void Initialise(Scene scene, IConfigSource config) |
99 | { | 99 | { |
100 | InitializeEngine(scene, MainLog.Instance); | 100 | InitializeEngine(scene, MainLog.Instance, true); |
101 | } | 101 | } |
102 | 102 | ||
103 | public void PostInitialise() | 103 | public void PostInitialise() |
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 39f2695..047ff2e 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
87 | myScriptEngine.Log.Verbose("RemoteEngine", "Creating new script (with connection)"); | 87 | myScriptEngine.Log.Verbose("RemoteEngine", "Creating new script (with connection)"); |
88 | 88 | ||
89 | // Temp for now: We have one connection only - this is hardcoded in myScriptServerID | 89 | // Temp for now: We have one connection only - this is hardcoded in myScriptServerID |
90 | RPC.SendCommand(myScriptServerID, "OnRezScript", script); | 90 | RPC.SendCommand(myScriptServerID, "OnRezScript", localID, itemID.ToString(), script); |
91 | 91 | ||
92 | //ScriptServerInterfaces.ServerRemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); | 92 | //ScriptServerInterfaces.ServerRemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); |
93 | //remoteScript.Add(localID, obj); | 93 | //remoteScript.Add(localID, obj); |
@@ -99,6 +99,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
99 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 99 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
100 | { | 100 | { |
101 | //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient); | 101 | //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient); |
102 | RPC.SendCommand(myScriptServerID, "touch_start", offsetPos, "How to transfer IClientAPI?"); | ||
102 | } | 103 | } |
103 | 104 | ||
104 | 105 | ||