aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs23
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs
index d76c7c1..3a73674 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs
@@ -31,11 +31,14 @@ using System.Reflection;
31using System.Runtime.Remoting.Lifetime; 31using System.Runtime.Remoting.Lifetime;
32using OpenSim.Region.ScriptEngine.Shared; 32using OpenSim.Region.ScriptEngine.Shared;
33using OpenSim.Region.ScriptEngine.Shared.ScriptBase; 33using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
34using log4net;
34 35
35namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase 36namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
36{ 37{
37 public class Executor : MarshalByRefObject 38 public class Executor : MarshalByRefObject
38 { 39 {
40 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41
39 /// <summary> 42 /// <summary>
40 /// Contains the script to execute functions in. 43 /// Contains the script to execute functions in.
41 /// </summary> 44 /// </summary>
@@ -92,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
92 /// <returns></returns> 95 /// <returns></returns>
93 public override Object InitializeLifetimeService() 96 public override Object InitializeLifetimeService()
94 { 97 {
95 //Console.WriteLine("Executor: InitializeLifetimeService()"); 98 //m_log.Debug("Executor: InitializeLifetimeService()");
96 // return null; 99 // return null;
97 ILease lease = (ILease)base.InitializeLifetimeService(); 100 ILease lease = (ILease)base.InitializeLifetimeService();
98 101
@@ -108,7 +111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
108 111
109 public scriptEvents GetStateEventFlags(string state) 112 public scriptEvents GetStateEventFlags(string state)
110 { 113 {
111 //Console.WriteLine("Get event flags for " + state); 114 //m_log.Debug("Get event flags for " + state);
112 115
113 // Check to see if we've already computed the flags for this state 116 // Check to see if we've already computed the flags for this state
114 scriptEvents eventFlags = scriptEvents.None; 117 scriptEvents eventFlags = scriptEvents.None;
@@ -124,19 +127,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
124 foreach (KeyValuePair<string, scriptEvents> kvp in m_eventFlagsMap) 127 foreach (KeyValuePair<string, scriptEvents> kvp in m_eventFlagsMap)
125 { 128 {
126 string evname = state + "_event_" + kvp.Key; 129 string evname = state + "_event_" + kvp.Key;
127 //Console.WriteLine("Trying event "+evname); 130 //m_log.Debug("Trying event "+evname);
128 try 131 try
129 { 132 {
130 MethodInfo mi = type.GetMethod(evname); 133 MethodInfo mi = type.GetMethod(evname);
131 if (mi != null) 134 if (mi != null)
132 { 135 {
133 //Console.WriteLine("Found handler for " + kvp.Key); 136 //m_log.Debug("Found handler for " + kvp.Key);
134 eventFlags |= kvp.Value; 137 eventFlags |= kvp.Value;
135 } 138 }
136 } 139 }
137 catch(Exception) 140 catch(Exception)
138 { 141 {
139 //Console.WriteLine("Exeption in GetMethod:\n"+e.ToString()); 142 //m_log.Debug("Exeption in GetMethod:\n"+e.ToString());
140 } 143 }
141 } 144 }
142 145
@@ -144,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
144 if (eventFlags != 0) 147 if (eventFlags != 0)
145 m_stateEvents.Add(state, eventFlags); 148 m_stateEvents.Add(state, eventFlags);
146 149
147 //Console.WriteLine("Returning {0:x}", eventFlags); 150 //m_log.Debug("Returning {0:x}", eventFlags);
148 return (eventFlags); 151 return (eventFlags);
149 } 152 }
150 153
@@ -156,7 +159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
156 string EventName = state + "_event_" + FunctionName; 159 string EventName = state + "_event_" + FunctionName;
157 160
158//#if DEBUG 161//#if DEBUG
159 //Console.WriteLine("ScriptEngine: Script event function name: " + EventName); 162 //m_log.Debug("ScriptEngine: Script event function name: " + EventName);
160//#endif 163//#endif
161 164
162 if (Events.ContainsKey(EventName) == false) 165 if (Events.ContainsKey(EventName) == false)
@@ -170,7 +173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
170 } 173 }
171 catch 174 catch
172 { 175 {
173 Console.WriteLine("Event {0}not found", EventName); 176 m_log.Error("Event "+EventName+" not found.");
174 // Event name not found, cache it as not found 177 // Event name not found, cache it as not found
175 Events.Add(EventName, null); 178 Events.Add(EventName, null);
176 } 179 }
@@ -182,13 +185,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
182 185
183 if (ev == null) // No event by that name! 186 if (ev == null) // No event by that name!
184 { 187 {
185 //Console.WriteLine("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty); 188 //m_log.Debug("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty);
186 return; 189 return;
187 } 190 }
188 191
189//cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined 192//cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined
190#if DEBUG 193#if DEBUG
191 //Console.WriteLine("ScriptEngine: Executing function name: " + EventName); 194 //m_log.Debug("ScriptEngine: Executing function name: " + EventName);
192#endif 195#endif
193 // Found 196 // Found
194 try 197 try