aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs21
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs65
10 files changed, 68 insertions, 61 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs
index e5f7220..4594ad8 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs
@@ -52,4 +52,4 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
52 //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); 52 //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
53 } 53 }
54 } 54 }
55} 55} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index c81e6bd..0623cc5 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -39,7 +39,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
39 private LSL2CSConverter LSL_Converter = new LSL2CSConverter(); 39 private LSL2CSConverter LSL_Converter = new LSL2CSConverter();
40 private CSharpCodeProvider codeProvider = new CSharpCodeProvider(); 40 private CSharpCodeProvider codeProvider = new CSharpCodeProvider();
41 private static UInt64 scriptCompileCounter = 0; 41 private static UInt64 scriptCompileCounter = 0;
42 private static int instanceID = new Random().Next(0, int.MaxValue); // Implemented due to peer preassure --- will cause garbage in ScriptEngines folder ;) 42
43 private static int instanceID = new Random().Next(0, int.MaxValue);
44 // Implemented due to peer preassure --- will cause garbage in ScriptEngines folder ;)
45
43 //private ICodeCompiler icc = codeProvider.CreateCompiler(); 46 //private ICodeCompiler icc = codeProvider.CreateCompiler();
44 public string CompileFromFile(string LSOFileName) 47 public string CompileFromFile(string LSOFileName)
45 { 48 {
@@ -83,7 +86,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
83 { 86 {
84 // Output assembly name 87 // Output assembly name
85 scriptCompileCounter++; 88 scriptCompileCounter++;
86 string OutFile = Path.Combine("ScriptEngines", "DotNetScript_" + instanceID.ToString() + "_" + scriptCompileCounter.ToString() + ".dll"); 89 string OutFile =
90 Path.Combine("ScriptEngines",
91 "DotNetScript_" + instanceID.ToString() + "_" + scriptCompileCounter.ToString() + ".dll");
87 try 92 try
88 { 93 {
89 File.Delete(OutFile); 94 File.Delete(OutFile);
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
index 4063647..8e37798 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
@@ -316,8 +316,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
316 316
317 317
318 quotes.Clear(); 318 quotes.Clear();
319 319
320 return Return; 320 return Return;
321 } 321 }
322 } 322 }
323} 323} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
index a9297fd..2796b64 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
@@ -1638,7 +1638,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
1638 1638
1639 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) 1639 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end)
1640 { 1640 {
1641 return m_LSL_Functions.llListReplaceList(dest,src,start,end); 1641 return m_LSL_Functions.llListReplaceList(dest, src, start, end);
1642 } 1642 }
1643 1643
1644 public void llLoadURL(string avatar_id, string message, string url) 1644 public void llLoadURL(string avatar_id, string message, string url)
@@ -2025,7 +2025,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
2025 public const int REMOTE_DATA_CHANNEL = 1; 2025 public const int REMOTE_DATA_CHANNEL = 1;
2026 public const int REMOTE_DATA_REQUEST = 2; 2026 public const int REMOTE_DATA_REQUEST = 2;
2027 public const int REMOTE_DATA_REPLY = 3; 2027 public const int REMOTE_DATA_REPLY = 3;
2028 2028
2029 public const int PRIM_MATERIAL = 2; 2029 public const int PRIM_MATERIAL = 2;
2030 public const int PRIM_PHYSICS = 3; 2030 public const int PRIM_PHYSICS = 3;
2031 public const int PRIM_TEMP_ON_REZ = 4; 2031 public const int PRIM_TEMP_ON_REZ = 4;
@@ -2041,7 +2041,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
2041 public const int PRIM_FLEXIBLE = 21; 2041 public const int PRIM_FLEXIBLE = 21;
2042 public const int PRIM_TEXGEN = 22; 2042 public const int PRIM_TEXGEN = 22;
2043 public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake 2043 public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake
2044 public const int PRIM_POINT_LIGHT = 23; // Huh? 2044 public const int PRIM_POINT_LIGHT = 23; // Huh?
2045 public const int PRIM_TEXGEN_DEFAULT = 0; 2045 public const int PRIM_TEXGEN_DEFAULT = 0;
2046 public const int PRIM_TEXGEN_PLANAR = 1; 2046 public const int PRIM_TEXGEN_PLANAR = 1;
2047 public const int PRIM_TYPE_BOX = 0; 2047 public const int PRIM_TYPE_BOX = 0;
@@ -2122,4 +2122,4 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
2122 public vector ZERO_VECTOR = new vector(0, 0, 0); 2122 public vector ZERO_VECTOR = new vector(0, 0, 0);
2123 public rotation ZERO_ROTATION = new rotation(0, 0, 0, 0); 2123 public rotation ZERO_ROTATION = new rotation(0, 0, 0, 0);
2124 } 2124 }
2125} 2125} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
index bc47241..d5a31fb 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
@@ -28,13 +28,11 @@
28 28
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Collections;
32using System.Runtime.Remoting.Lifetime; 31using System.Runtime.Remoting.Lifetime;
33using System.Text; 32using System.Text;
34using System.Threading; 33using System.Threading;
35using Axiom.Math; 34using Axiom.Math;
36using libsecondlife; 35using libsecondlife;
37using libsecondlife.StructuredData;
38using OpenSim.Framework; 36using OpenSim.Framework;
39using OpenSim.Region.Environment.Interfaces; 37using OpenSim.Region.Environment.Interfaces;
40using OpenSim.Region.Environment.Scenes; 38using OpenSim.Region.Environment.Scenes;
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
index 161cedf..8dfd908 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
@@ -217,4 +217,4 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
217 { 217 {
218 } 218 }
219 } 219 }
220} 220} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs
index 890335b..2d0d69d 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs
@@ -184,9 +184,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
184 { 184 {
185#if DEBUG 185#if DEBUG
186 m_ScriptEngine.Log.Debug("ScriptEngine", "Executing event:\r\n" 186 m_ScriptEngine.Log.Debug("ScriptEngine", "Executing event:\r\n"
187 + "QIS.localID: " + QIS.localID 187 + "QIS.localID: " + QIS.localID
188 + ", QIS.itemID: " + QIS.itemID 188 + ", QIS.itemID: " + QIS.itemID
189 + ", QIS.functionName: " + QIS.functionName); 189 + ", QIS.functionName: " + QIS.functionName);
190#endif 190#endif
191 m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID, 191 m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID,
192 QIS.functionName, QIS.param); 192 QIS.functionName, QIS.param);
@@ -197,14 +197,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
197 string text = "Error executing script function \"" + QIS.functionName + "\":\r\n"; 197 string text = "Error executing script function \"" + QIS.functionName + "\":\r\n";
198 //if (e.InnerException != null) 198 //if (e.InnerException != null)
199 //{ 199 //{
200 // Send inner exception 200 // Send inner exception
201 text += e.InnerException.Message.ToString(); 201 text += e.InnerException.Message.ToString();
202 //} 202 //}
203 //else 203 //else
204 //{ 204 //{
205 text += "\r\n"; 205 text += "\r\n";
206 // Send normal 206 // Send normal
207 text += e.Message.ToString(); 207 text += e.Message.ToString();
208 //} 208 //}
209 try 209 try
210 { 210 {
@@ -222,7 +222,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
222 //else 222 //else
223 //{ 223 //{
224 // T oconsole 224 // T oconsole
225 m_ScriptEngine.Log.Error("ScriptEngine", "Unable to send text in-world:\r\n" + text); 225 m_ScriptEngine.Log.Error("ScriptEngine",
226 "Unable to send text in-world:\r\n" + text);
226 } 227 }
227 } 228 }
228 finally 229 finally
@@ -338,4 +339,4 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
338 } 339 }
339 } 340 }
340 } 341 }
341} 342} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs
index fdd7260..e403385 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs
@@ -202,17 +202,16 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
202 202
203 public void CheckHttpRequests() 203 public void CheckHttpRequests()
204 { 204 {
205 IHttpRequests iHttpReq = 205 IHttpRequests iHttpReq =
206 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>(); 206 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>();
207 207
208 HttpRequestClass httpInfo = null; 208 HttpRequestClass httpInfo = null;
209 209
210 if( iHttpReq != null ) 210 if (iHttpReq != null)
211 httpInfo = iHttpReq.GetNextCompletedRequest(); 211 httpInfo = iHttpReq.GetNextCompletedRequest();
212 212
213 while ( httpInfo != null ) 213 while (httpInfo != null)
214 { 214 {
215
216 //Console.WriteLine("PICKED HTTP REQ:" + httpInfo.response_body + httpInfo.status); 215 //Console.WriteLine("PICKED HTTP REQ:" + httpInfo.response_body + httpInfo.status);
217 216
218 // Deliver data to prim's remote_data handler 217 // Deliver data to prim's remote_data handler
@@ -221,7 +220,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
221 // only returns the byte for HTTP_BODY_TRUNCATED, which is not 220 // only returns the byte for HTTP_BODY_TRUNCATED, which is not
222 // implemented here yet anyway. Should be fixed if/when maxsize 221 // implemented here yet anyway. Should be fixed if/when maxsize
223 // is supported 222 // is supported
224 223
225 object[] resobj = new object[] 224 object[] resobj = new object[]
226 { 225 {
227 httpInfo.reqID.ToString(), httpInfo.status, null, httpInfo.response_body 226 httpInfo.reqID.ToString(), httpInfo.status, null, httpInfo.response_body
@@ -254,7 +253,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
254 //Deliver data to prim's remote_data handler 253 //Deliver data to prim's remote_data handler
255 object[] resobj = new object[] 254 object[] resobj = new object[]
256 { 255 {
257 2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), "", rInfo.GetIntValue(), 256 2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), "",
257 rInfo.GetIntValue(),
258 rInfo.GetStrVal() 258 rInfo.GetStrVal()
259 }; 259 };
260 m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( 260 m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
@@ -284,4 +284,4 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
284 } 284 }
285 } 285 }
286 } 286 }
287} 287} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index c1c792c..82049f7 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -121,4 +121,4 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
121 121
122 #endregion 122 #endregion
123 } 123 }
124} 124} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 6b83dff..e211902 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -224,7 +224,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
224 224
225 #region Start/Stop/Reset script 225 #region Start/Stop/Reset script
226 226
227 Object startStopLock = new Object(); 227 private Object startStopLock = new Object();
228 228
229 /// <summary> 229 /// <summary>
230 /// Fetches, loads and hooks up a script to an objects events 230 /// Fetches, loads and hooks up a script to an objects events
@@ -261,7 +261,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
261 } 261 }
262 262
263 // Create a new instance of the compiler (reuse) 263 // Create a new instance of the compiler (reuse)
264 Compiler.LSL.Compiler LSLCompiler = new Compiler.LSL.Compiler(); 264 private Compiler.LSL.Compiler LSLCompiler = new Compiler.LSL.Compiler();
265
265 private void _StartScript(uint localID, LLUUID itemID, string Script) 266 private void _StartScript(uint localID, LLUUID itemID, string Script)
266 { 267 {
267 lock (startStopLock) 268 lock (startStopLock)
@@ -316,7 +317,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
316 CompiledScript.Start(LSLB); 317 CompiledScript.Start(LSLB);
317 318
318 // Fire the first start-event 319 // Fire the first start-event
319 m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", new object[] { }); 320 m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", new object[] {});
320 } 321 }
321 catch (Exception e) 322 catch (Exception e)
322 { 323 {
@@ -327,12 +328,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
327 string text = "Error compiling script:\r\n" + e.Message.ToString(); 328 string text = "Error compiling script:\r\n" + e.Message.ToString();
328 if (text.Length > 1500) 329 if (text.Length > 1500)
329 text = text.Substring(0, 1500); 330 text = text.Substring(0, 1500);
330 World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 331 World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0, m_host.AbsolutePosition,
332 m_host.Name, m_host.UUID);
331 } 333 }
332 catch (Exception e2) 334 catch (Exception e2)
333 { 335 {
334 m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString()); 336 m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString());
335 m_scriptEngine.Log.Error("ScriptEngine", "Errormessage: Error compiling script:\r\n" + e.Message.ToString()); 337 m_scriptEngine.Log.Error("ScriptEngine",
338 "Errormessage: Error compiling script:\r\n" + e.Message.ToString());
336 } 339 }
337 } 340 }
338 } 341 }
@@ -342,39 +345,39 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
342 { 345 {
343 lock (startStopLock) 346 lock (startStopLock)
344 { 347 {
345 // Stop script 348 // Stop script
346 Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString()); 349 Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString());
347 350
348 351
349 // Stop long command on script 352 // Stop long command on script
350 m_scriptEngine.m_LSLLongCmdHandler.RemoveScript(localID, itemID); 353 m_scriptEngine.m_LSLLongCmdHandler.RemoveScript(localID, itemID);
351 354
352 LSL_BaseClass LSLBC = GetScript(localID, itemID); 355 LSL_BaseClass LSLBC = GetScript(localID, itemID);
353 if (LSLBC == null) 356 if (LSLBC == null)
354 return; 357 return;
355 358
356 // TEMP: First serialize it 359 // TEMP: First serialize it
357 //GetSerializedScript(localID, itemID); 360 //GetSerializedScript(localID, itemID);
358 361
359 362
360 try 363 try
361 { 364 {
362 // Get AppDomain 365 // Get AppDomain
363 AppDomain ad = LSLBC.Exec.GetAppDomain(); 366 AppDomain ad = LSLBC.Exec.GetAppDomain();
364 // Tell script not to accept new requests 367 // Tell script not to accept new requests
365 GetScript(localID, itemID).Exec.StopScript(); 368 GetScript(localID, itemID).Exec.StopScript();
366 // Remove from internal structure 369 // Remove from internal structure
367 RemoveScript(localID, itemID); 370 RemoveScript(localID, itemID);
368 // Tell AppDomain that we have stopped script 371 // Tell AppDomain that we have stopped script
369 m_scriptEngine.m_AppDomainManager.StopScript(ad); 372 m_scriptEngine.m_AppDomainManager.StopScript(ad);
370 } 373 }
371 catch (Exception e) 374 catch (Exception e)
372 { 375 {
373 Console.WriteLine("Exception stopping script localID: " + localID + " LLUID: " + itemID.ToString() + 376 Console.WriteLine("Exception stopping script localID: " + localID + " LLUID: " + itemID.ToString() +
374 ": " + e.ToString()); 377 ": " + e.ToString());
378 }
375 } 379 }
376 } 380 }
377 }
378 381
379 private string ProcessYield(string FileName) 382 private string ProcessYield(string FileName)
380 { 383 {
@@ -435,4 +438,4 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
435 438
436 #endregion 439 #endregion
437 } 440 }
438} 441} \ No newline at end of file