aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorCharles Krinke2009-02-22 20:52:55 +0000
committerCharles Krinke2009-02-22 20:52:55 +0000
commit8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49 (patch)
tree96a24a49de82056060dd9b7bab0cb209d5f1a129 /OpenSim/Region/ScriptEngine/Shared/Api
parentAllow delivery of object messages gridwide (diff)
downloadopensim-SC_OLD-8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49.zip
opensim-SC_OLD-8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49.tar.gz
opensim-SC_OLD-8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49.tar.bz2
opensim-SC_OLD-8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49.tar.xz
Mantis#3218. Thank you kindly, TLaukkan (Tommil) for a patch that:
* Added log4net dependency to physxplugin in prebuild.xml. * Added missing m_log fields to classes. * Replaced Console.WriteLine with appropriate m_log.Xxxx * Tested that nant test target runs succesfully. * Tested that local opensim sandbox starts up without errors.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs23
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs12
6 files changed, 31 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5455b53..bc113db 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -58,6 +58,7 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
58using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion; 58using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
59using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; 59using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
60using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; 60using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
61using System.Reflection;
61 62
62namespace OpenSim.Region.ScriptEngine.Shared.Api 63namespace OpenSim.Region.ScriptEngine.Shared.Api
63{ 64{
@@ -66,6 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
66 /// </summary> 67 /// </summary>
67 public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi 68 public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi
68 { 69 {
70 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
69 protected IScriptEngine m_ScriptEngine; 71 protected IScriptEngine m_ScriptEngine;
70 protected SceneObjectPart m_host; 72 protected SceneObjectPart m_host;
71 protected uint m_localID; 73 protected uint m_localID;
@@ -1135,7 +1137,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1135 public LSL_Integer llGetStatus(int status) 1137 public LSL_Integer llGetStatus(int status)
1136 { 1138 {
1137 m_host.AddScriptLPS(1); 1139 m_host.AddScriptLPS(1);
1138 // Console.WriteLine(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); 1140 // m_log.Debug(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString());
1139 switch (status) 1141 switch (status)
1140 { 1142 {
1141 case ScriptBaseClass.STATUS_PHYSICS: 1143 case ScriptBaseClass.STATUS_PHYSICS:
@@ -2706,8 +2708,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2706 msg.fromAgentID = new Guid(m_host.UUID.ToString()); // fromAgentID.Guid; 2708 msg.fromAgentID = new Guid(m_host.UUID.ToString()); // fromAgentID.Guid;
2707 msg.toAgentID = new Guid(user); // toAgentID.Guid; 2709 msg.toAgentID = new Guid(user); // toAgentID.Guid;
2708 msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here 2710 msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here
2709// Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); 2711// m_log.Debug("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message);
2710// Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); 2712// m_log.Debug("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString());
2711 msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp; 2713 msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp;
2712 //if (client != null) 2714 //if (client != null)
2713 //{ 2715 //{
@@ -7882,7 +7884,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7882 } 7884 }
7883 catch(Exception e) 7885 catch(Exception e)
7884 { 7886 {
7885 Console.WriteLine("[LSL_API]: llRequestSimulatorData" + e.ToString()); 7887 m_log.Error("[LSL_API]: llRequestSimulatorData" + e.ToString());
7886 return UUID.Zero.ToString(); 7888 return UUID.Zero.ToString();
7887 } 7889 }
7888 } 7890 }
@@ -9068,7 +9070,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9068 System.Text.ASCIIEncoding enc = 9070 System.Text.ASCIIEncoding enc =
9069 new System.Text.ASCIIEncoding(); 9071 new System.Text.ASCIIEncoding();
9070 string data = enc.GetString(a.Data); 9072 string data = enc.GetString(a.Data);
9071 //Console.WriteLine(data); 9073 //m_log.Debug(data);
9072 NotecardCache.Cache(id, data); 9074 NotecardCache.Cache(id, data);
9073 AsyncCommands. 9075 AsyncCommands.
9074 DataserverPlugin.DataserverReply(id.ToString(), 9076 DataserverPlugin.DataserverReply(id.ToString(),
@@ -9114,7 +9116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9114 System.Text.ASCIIEncoding enc = 9116 System.Text.ASCIIEncoding enc =
9115 new System.Text.ASCIIEncoding(); 9117 new System.Text.ASCIIEncoding();
9116 string data = enc.GetString(a.Data); 9118 string data = enc.GetString(a.Data);
9117 //Console.WriteLine(data); 9119 //m_log.Debug(data);
9118 NotecardCache.Cache(id, data); 9120 NotecardCache.Cache(id, data);
9119 AsyncCommands. 9121 AsyncCommands.
9120 DataserverPlugin.DataserverReply(id.ToString(), 9122 DataserverPlugin.DataserverReply(id.ToString(),
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 597592d..7834a83 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -842,7 +842,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
842 for (i=0;i<JSON.Length; i++) 842 for (i=0;i<JSON.Length; i++)
843 { 843 {
844 844
845 // Console.WriteLine(""+JSON[i]); 845 // m_log.Debug(""+JSON[i]);
846 switch (JSON[i]) 846 switch (JSON[i])
847 { 847 {
848 case '{': 848 case '{':
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs
index 0654c07..2ed9295 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
58 58
59 while (httpInfo != null) 59 while (httpInfo != null)
60 { 60 {
61 //System.Console.WriteLine("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status); 61 //m_log.Debug("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status);
62 62
63 // Deliver data to prim's remote_data handler 63 // Deliver data to prim's remote_data handler
64 // 64 //
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
index 91cef9b..d08790c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
@@ -108,7 +108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
108 // Time has passed? 108 // Time has passed?
109 if (ts.next < DateTime.Now.Ticks) 109 if (ts.next < DateTime.Now.Ticks)
110 { 110 {
111 //Console.WriteLine("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next); 111 //m_log.Debug("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
112 // Add it to queue 112 // Add it to queue
113 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID, 113 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
114 new EventParams("timer", new Object[0], 114 new EventParams("timer", new Object[0],
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
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs
index 5a9b0aa..9cdffaa 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs
@@ -36,6 +36,7 @@ using System.Reflection;
36using System.Net.Sockets; 36using System.Net.Sockets;
37using System.Text; 37using System.Text;
38using System.Text.RegularExpressions; 38using System.Text.RegularExpressions;
39using log4net;
39 40
40namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog 41namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
41{ 42{
@@ -45,6 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
45 /// </summary> 46 /// </summary>
46 public class YP 47 public class YP
47 { 48 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 private static Fail _fail = new Fail(); 50 private static Fail _fail = new Fail();
49 private static Repeat _repeat = new Repeat(); 51 private static Repeat _repeat = new Repeat();
50 private static Dictionary<NameArity, List<IClause>> _predicatesStore = 52 private static Dictionary<NameArity, List<IClause>> _predicatesStore =
@@ -2341,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
2341 string results = ""; 2343 string results = "";
2342 for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) 2344 for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch())
2343 { 2345 {
2344 //Console.WriteLine( m ); 2346 //m_log.Debug( m );
2345 results += presep+ m + postsep; 2347 results += presep+ m + postsep;
2346 } 2348 }
2347 return results; 2349 return results;
@@ -2359,7 +2361,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
2359 } 2361 }
2360 catch 2362 catch
2361 { 2363 {
2362 Console.WriteLine("Failed to connect to server at {0}:999", "localhost"); 2364 m_log.Error("Failed to connect to server at localhost:999");
2363 return ""; 2365 return "";
2364 } 2366 }
2365 2367
@@ -2379,16 +2381,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
2379 streamWriter.Flush(); 2381 streamWriter.Flush();
2380 2382
2381 cycOutputString = streamReader.ReadLine(); 2383 cycOutputString = streamReader.ReadLine();
2382 Console.WriteLine("Cycoutput:" + cycOutputString); 2384 m_log.Debug("Cycoutput:" + cycOutputString);
2383 //streamWriter.WriteLine("Client Message"); 2385 //streamWriter.WriteLine("Client Message");
2384 //Console.WriteLine("Client Message"); 2386 //m_log.Debug("Client Message");
2385 streamWriter.Flush(); 2387 streamWriter.Flush();
2386 } 2388 }
2387 2389
2388 } 2390 }
2389 catch 2391 catch
2390 { 2392 {
2391 Console.WriteLine("Exception reading from Server"); 2393 m_log.Error("Exception reading from Server");
2392 return ""; 2394 return "";
2393 } 2395 }
2394 // tidy up 2396 // tidy up