aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/ScriptEngine/DotNetEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/ScriptEngine/DotNetEngine')
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs7
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs4
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs4
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs8
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs12
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs19
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs8
7 files changed, 35 insertions, 27 deletions
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs
index 98a2cc5..bcfeefc 100644
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs
+++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs
@@ -26,10 +26,13 @@
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29
29namespace OpenSim.Grid.ScriptEngine.DotNetEngine 30namespace OpenSim.Grid.ScriptEngine.DotNetEngine
30{ 31{
31 public static class Common 32 public static class Common
32 { 33 {
34 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
35
33 public static bool debug = true; 36 public static bool debug = true;
34 public static ScriptEngine mySE; 37 public static ScriptEngine mySE;
35 38
@@ -41,14 +44,14 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
41 public static void SendToDebug(string Message) 44 public static void SendToDebug(string Message)
42 { 45 {
43 //if (Debug == true) 46 //if (Debug == true)
44 mySE.Log.Verbose("ScriptEngine", "Debug: " + Message); 47 mySE.m_log.Info("[ScriptEngine]: Debug: " + Message);
45 //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); 48 //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
46 } 49 }
47 50
48 public static void SendToLog(string Message) 51 public static void SendToLog(string Message)
49 { 52 {
50 //if (Debug == true) 53 //if (Debug == true)
51 mySE.Log.Verbose("ScriptEngine", "LOG: " + Message); 54 mySE.m_log.Info("[ScriptEngine]: LOG: " + Message);
52 //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); 55 //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
53 } 56 }
54 } 57 }
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
index 1f5e6da..e0a5461 100644
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
+++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
@@ -41,6 +41,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL
41 //[Serializable] 41 //[Serializable]
42 public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript 42 public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
43 { 43 {
44 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
45
44 // Object never expires 46 // Object never expires
45 public override Object InitializeLifetimeService() 47 public override Object InitializeLifetimeService()
46 { 48 {
@@ -87,7 +89,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL
87 { 89 {
88 m_LSL_Functions = LSL_Functions; 90 m_LSL_Functions = LSL_Functions;
89 91
90 //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called."); 92 //m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called.");
91 93
92 // Get this AppDomain's settings and display some of them. 94 // Get this AppDomain's settings and display some of them.
93 AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation; 95 AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
index 8f58b55..1ffbd3a 100644
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
@@ -52,6 +52,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
52 /// </summary> 52 /// </summary>
53 public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface 53 public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
54 { 54 {
55 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
56
55 private ASCIIEncoding enc = new ASCIIEncoding(); 57 private ASCIIEncoding enc = new ASCIIEncoding();
56 private ScriptEngine m_ScriptEngine; 58 private ScriptEngine m_ScriptEngine;
57 private SceneObjectPart m_host; 59 private SceneObjectPart m_host;
@@ -68,7 +70,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
68 m_itemID = itemID; 70 m_itemID = itemID;
69 71
70 72
71 //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); 73 //m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
72 } 74 }
73 75
74 76
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs
index 3a1ae5a..3aa2216 100644
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs
+++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs
@@ -38,17 +38,19 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
38 [Serializable] 38 [Serializable]
39 internal class EventManager 39 internal class EventManager
40 { 40 {
41 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42
41 private ScriptEngine myScriptEngine; 43 private ScriptEngine myScriptEngine;
42 //public IScriptHost TEMP_OBJECT_ID; 44 //public IScriptHost TEMP_OBJECT_ID;
43 public EventManager(ScriptEngine _ScriptEngine) 45 public EventManager(ScriptEngine _ScriptEngine)
44 { 46 {
45 myScriptEngine = _ScriptEngine; 47 myScriptEngine = _ScriptEngine;
46 // TODO: HOOK EVENTS UP TO SERVER! 48 // TODO: HOOK EVENTS UP TO SERVER!
47 //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Start"); 49 //myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Start");
48 // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager 50 // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager
49 51
50 // Hook up a test event to our test form 52 // Hook up a test event to our test form
51 myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); 53 myScriptEngine.m_log.Info("[ScriptEngine]: Hooking up to server events");
52 myScriptEngine.World.EventManager.OnObjectGrab += touch_start; 54 myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
53 myScriptEngine.World.EventManager.OnRezScript += OnRezScript; 55 myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
54 myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; 56 myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
@@ -57,7 +59,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
57 public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 59 public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
58 { 60 {
59 // Add to queue for all scripts in ObjectID object 61 // Add to queue for all scripts in ObjectID object
60 //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); 62 //myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Event: touch_start");
61 //Console.WriteLine("touch_start localID: " + localID); 63 //Console.WriteLine("touch_start localID: " + localID);
62 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); 64 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1});
63 } 65 }
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs
index d9d26aa..2606862 100644
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs
+++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
44 [Serializable] 44 [Serializable]
45 internal class EventQueueManager 45 internal class EventQueueManager
46 { 46 {
47 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
48
47 /// <summary> 49 /// <summary>
48 /// List of threads processing event queue 50 /// List of threads processing event queue
49 /// </summary> 51 /// </summary>
@@ -118,7 +120,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
118 } 120 }
119 catch (Exception) 121 catch (Exception)
120 { 122 {
121 //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Exception killing worker thread: " + e.ToString()); 123 //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Exception killing worker thread: " + e.ToString());
122 } 124 }
123 } 125 }
124 } 126 }
@@ -132,7 +134,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
132 /// </summary> 134 /// </summary>
133 private void EventQueueThreadLoop() 135 private void EventQueueThreadLoop()
134 { 136 {
135 //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Worker thread spawned"); 137 //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Worker thread spawned");
136 try 138 try
137 { 139 {
138 QueueItemStruct BlankQIS = new QueueItemStruct(); 140 QueueItemStruct BlankQIS = new QueueItemStruct();
@@ -151,7 +153,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
151 else 153 else
152 { 154 {
153 // Something in queue, process 155 // Something in queue, process
154 //myScriptEngine.m_logger.Verbose("ScriptEngine", "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName); 156 //myScriptEngine.m_log.Info("[ScriptEngine]: Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName);
155 157
156 // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD 158 // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD
157 lock (queueLock) 159 lock (queueLock)
@@ -237,7 +239,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
237 } // try 239 } // try
238 catch (ThreadAbortException) 240 catch (ThreadAbortException)
239 { 241 {
240 //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Worker thread killed: " + tae.Message); 242 //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Worker thread killed: " + tae.Message);
241 } 243 }
242 } 244 }
243 245
@@ -287,7 +289,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
287 public void AddToObjectQueue(uint localID, string FunctionName, object[] param) 289 public void AddToObjectQueue(uint localID, string FunctionName, object[] param)
288 { 290 {
289 // Determine all scripts in Object and add to their queue 291 // Determine all scripts in Object and add to their queue
290 //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); 292 //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName);
291 293
292 294
293 // Do we have any scripts in this object at all? If not, return 295 // Do we have any scripts in this object at all? If not, return
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs
index cc6cde2..a45efe9 100644
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
40 [Serializable] 40 [Serializable]
41 public class ScriptEngine : IRegionModule 41 public class ScriptEngine : IRegionModule
42 { 42 {
43 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
44
43 internal Scene World; 45 internal Scene World;
44 internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim 46 internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim
45 internal EventQueueManager m_EventQueueManager; // Executes events 47 internal EventQueueManager m_EventQueueManager; // Executes events
@@ -47,7 +49,6 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
47 internal AppDomainManager m_AppDomainManager; 49 internal AppDomainManager m_AppDomainManager;
48 internal LSLLongCmdHandler m_LSLLongCmdHandler; 50 internal LSLLongCmdHandler m_LSLLongCmdHandler;
49 51
50 private LogBase m_log;
51 52
52 public ScriptEngine() 53 public ScriptEngine()
53 { 54 {
@@ -55,19 +56,13 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
55 Common.mySE = this; 56 Common.mySE = this;
56 } 57 }
57 58
58 public LogBase Log 59 public void InitializeEngine(Scene Sceneworld)
59 {
60 get { return m_log; }
61 }
62
63 public void InitializeEngine(Scene Sceneworld, LogBase logger)
64 { 60 {
65 World = Sceneworld; 61 World = Sceneworld;
66 m_log = logger;
67 62
68 Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing"); 63 m_log.Info("[ScriptEngine]: DotNet & LSL ScriptEngine initializing");
69 64
70 //m_logger.Status("ScriptEngine", "InitializeEngine"); 65 //m_log.Info("[ScriptEngine]: InitializeEngine");
71 66
72 // Create all objects we'll be using 67 // Create all objects we'll be using
73 m_EventQueueManager = new EventQueueManager(this); 68 m_EventQueueManager = new EventQueueManager(this);
@@ -90,7 +85,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
90 //public void StartScript(string ScriptID, IScriptHost ObjectID) 85 //public void StartScript(string ScriptID, IScriptHost ObjectID)
91 //{ 86 //{
92 // this.myEventManager.TEMP_OBJECT_ID = ObjectID; 87 // this.myEventManager.TEMP_OBJECT_ID = ObjectID;
93 // Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID); 88 // m_log.Info("[ScriptEngine]: DEBUG FUNCTION: StartScript: " + ScriptID);
94 // myScriptManager.StartScript(ScriptID, ObjectID); 89 // myScriptManager.StartScript(ScriptID, ObjectID);
95 //} 90 //}
96 91
@@ -98,7 +93,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
98 93
99 public void Initialise(Scene scene, IConfigSource config) 94 public void Initialise(Scene scene, IConfigSource config)
100 { 95 {
101 InitializeEngine(scene, MainLog.Instance); 96 InitializeEngine(scene);
102 } 97 }
103 98
104 public void PostInitialise() 99 public void PostInitialise()
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs
index f482834..2846399 100644
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -48,6 +48,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
48 [Serializable] 48 [Serializable]
49 public class ScriptManager 49 public class ScriptManager
50 { 50 {
51 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
52
51 #region Declares 53 #region Declares
52 54
53 private Thread scriptLoadUnloadThread; 55 private Thread scriptLoadUnloadThread;
@@ -312,7 +314,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
312 } 314 }
313 catch (Exception e) 315 catch (Exception e)
314 { 316 {
315 //m_scriptEngine.Log.Error("ScriptEngine", "Error compiling script: " + e.ToString()); 317 //m_scriptEngine.m_log.Error("[ScriptEngine]: Error compiling script: " + e.ToString());
316 try 318 try
317 { 319 {
318 // DISPLAY ERROR INWORLD 320 // DISPLAY ERROR INWORLD
@@ -323,7 +325,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
323 } 325 }
324 catch (Exception e2) 326 catch (Exception e2)
325 { 327 {
326 m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString()); 328 m_scriptEngine.m_log.Error("[ScriptEngine]: Error displaying error in-world: " + e2.ToString());
327 } 329 }
328 } 330 }
329 } 331 }
@@ -384,7 +386,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
384 internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args) 386 internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args)
385 { 387 {
386 // Execute a function in the script 388 // Execute a function in the script
387 //m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); 389 //m_scriptEngine.m_log.Info("[ScriptEngine]: Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
388 LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID); 390 LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID);
389 if (Script == null) 391 if (Script == null)
390 return; 392 return;