* Rex merge, Regions/ExtensionsScript

afrisby-3
Adam Frisby 2008-02-23 04:10:30 +00:00
parent 9559c3f6e6
commit 8df0331405
20 changed files with 2130 additions and 2119 deletions

View File

@ -35,6 +35,8 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
{ {
public class CSharpScriptEngine : IScriptCompiler public class CSharpScriptEngine : IScriptCompiler
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public string FileExt() public string FileExt()
{ {
return ".cs"; return ".cs";
@ -58,10 +60,10 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
if (compilerResults.Errors.Count > 0) if (compilerResults.Errors.Count > 0)
{ {
MainLog.Instance.Error("Compile errors"); m_log.Error("Compile errors");
foreach (CompilerError error in compilerResults.Errors) foreach (CompilerError error in compilerResults.Errors)
{ {
MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString()); m_log.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
} }
} }
else else

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
@ -50,7 +50,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
{ {
/*if (args[0].ToLower() == "lslexport") /*if (args[0].ToLower() == "lslexport")
{ {
string sequence = ""; string sequence = String.Empty;
foreach (KeyValuePair<LLUUID, SceneObject> obj in script.world.Objects) foreach (KeyValuePair<LLUUID, SceneObject> obj in script.world.Objects)
{ {
@ -82,13 +82,13 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
LLVector3 scale = prim.Scale; LLVector3 scale = prim.Scale;
LLVector3 rootPos = prim.WorldPos; LLVector3 rootPos = prim.WorldPos;
string setPrimParams = ""; string setPrimParams = String.Empty;
setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n"; setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n";
return setPrimParams; return setPrimParams;
*/ */
return ""; return System.String.Empty;
} }
} }
} }

View File

@ -35,6 +35,8 @@ namespace OpenSim.Region.ExtensionsScriptModule.JScript
{ {
public class JScriptEngine : IScriptCompiler public class JScriptEngine : IScriptCompiler
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public string FileExt() public string FileExt()
{ {
return ".js"; return ".js";
@ -58,10 +60,10 @@ namespace OpenSim.Region.ExtensionsScriptModule.JScript
if (compilerResults.Errors.Count > 0) if (compilerResults.Errors.Count > 0)
{ {
MainLog.Instance.Error("Compile errors"); m_log.Error("Compile errors");
foreach (CompilerError error in compilerResults.Errors) foreach (CompilerError error in compilerResults.Errors)
{ {
MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString()); m_log.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
} }
} }
else else

View File

@ -237,7 +237,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public class PoolUtf8 : PoolItem public class PoolUtf8 : PoolItem
{ {
public string Value = ""; public string Value = String.Empty;
public void readValue(byte[] data, ref int pointer, int length) public void readValue(byte[] data, ref int pointer, int length)
{ {
@ -274,7 +274,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public class PoolClass : PoolItem public class PoolClass : PoolItem
{ {
//public string name = ""; //public string name = String.Empty;
public ushort namePointer = 0; public ushort namePointer = 0;
private ClassRecord parent; private ClassRecord parent;
public PoolUtf8 Name; public PoolUtf8 Name;
@ -384,7 +384,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{ {
public ushort AccessFlags = 0; public ushort AccessFlags = 0;
public ushort NameIndex = 0; public ushort NameIndex = 0;
public string Name = ""; public string Name = String.Empty;
public ushort DescriptorIndex = 0; public ushort DescriptorIndex = 0;
public ushort AttributeCount = 0; public ushort AttributeCount = 0;
public List<MethodAttribute> Attributes = new List<MethodAttribute>(); public List<MethodAttribute> Attributes = new List<MethodAttribute>();
@ -436,7 +436,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public class MethodAttribute public class MethodAttribute
{ {
public ushort NameIndex = 0; public ushort NameIndex = 0;
public string Name = ""; public string Name = String.Empty;
public Int32 Length = 0; public Int32 Length = 0;
//for now only support code attribute //for now only support code attribute
public ushort MaxStack = 0; public ushort MaxStack = 0;
@ -502,7 +502,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public class SubAttribute public class SubAttribute
{ {
public ushort NameIndex = 0; public ushort NameIndex = 0;
public string Name = ""; public string Name = String.Empty;
public Int32 Length = 0; public Int32 Length = 0;
public byte[] Data; public byte[] Data;
private ClassRecord parent; private ClassRecord parent;
@ -546,7 +546,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
{ {
public ushort AccessFlags = 0; public ushort AccessFlags = 0;
public ushort NameIndex = 0; public ushort NameIndex = 0;
public string Name = ""; public string Name = String.Empty;
public ushort DescriptorIndex = 0; public ushort DescriptorIndex = 0;
public ushort AttributeCount = 0; public ushort AttributeCount = 0;
public List<FieldAttribute> Attributes = new List<FieldAttribute>(); public List<FieldAttribute> Attributes = new List<FieldAttribute>();
@ -605,7 +605,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
public class FieldAttribute public class FieldAttribute
{ {
public ushort NameIndex = 0; public ushort NameIndex = 0;
public string Name = ""; public string Name = String.Empty;
public Int32 Length = 0; public Int32 Length = 0;
public byte[] Data; public byte[] Data;
private ClassRecord parent; private ClassRecord parent;

View File

@ -46,8 +46,8 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM
string typ = string typ =
((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]). ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]).
mNameType.Type.Value; mNameType.Type.Value;
string typeparam = ""; string typeparam = System.String.Empty;
string typereturn = ""; string typereturn = System.String.Empty;
int firstbrak = 0; int firstbrak = 0;
int secondbrak = 0; int secondbrak = 0;
firstbrak = typ.LastIndexOf('('); firstbrak = typ.LastIndexOf('(');

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -53,12 +53,12 @@ namespace OpenSim.Region.ExtensionsScriptModule
private void events_OnNewPresence(ScenePresence presence) private void events_OnNewPresence(ScenePresence presence)
{ {
script.logger.Verbose("TESTSCRIPT", "Hello " + presence.Firstname.ToString() + "!"); script.Log.Info("[TESTSCRIPT]: Hello " + presence.Firstname.ToString() + "!");
} }
private void events_OnFrame() private void events_OnFrame()
{ {
//script.logger.Verbose("TESTSCRIPT", "Hello World!"); //script.logger.Info("[TESTSCRIPT]: Hello World!");
} }
} }
} }

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -36,23 +36,26 @@ namespace OpenSim.Region.ExtensionsScriptModule
/// </summary> /// </summary>
public class ScriptInfo public class ScriptInfo
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Reference to world.eventsManager provided for convenience // Reference to world.eventsManager provided for convenience
public EventManager events; public EventManager events;
// The main world // The main world
public Scene world; public Scene world;
// The console
public LogBase logger;
// API Access // API Access
public ScriptAPI api; public ScriptAPI api;
public log4net.ILog Log
{
get { return m_log; }
}
public ScriptInfo(Scene scene) public ScriptInfo(Scene scene)
{ {
world = scene; world = scene;
events = world.EventManager; events = world.EventManager;
logger = MainLog.Instance;
api = new ScriptAPI(world, LLUUID.Zero); api = new ScriptAPI(world, LLUUID.Zero);
} }

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
@ -45,6 +45,8 @@ namespace OpenSim.Region.ExtensionsScriptModule
/// <remarks>Avoid at all costs. This should ONLY be used for LSL.</remarks> /// <remarks>Avoid at all costs. This should ONLY be used for LSL.</remarks>
internal class ScriptInterpretedAPI internal class ScriptInterpretedAPI
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected Key m_object; protected Key m_object;
protected Scene m_scene; protected Scene m_scene;
@ -109,7 +111,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
{ {
//Dont do anything! //Dont do anything!
} }
MainLog.Instance.Warn("script", m_log.Warn("[script]: " +
"Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); "Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)");
return; return;
} }
@ -117,7 +119,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
[Obsolete("Unimplemented")] [Obsolete("Unimplemented")]
public void osAdjustSoundVolume(float volume) public void osAdjustSoundVolume(float volume)
{ {
MainLog.Instance.Warn("script", "Unimplemented function called by script: osAdjustSoundVolume(float volume)"); m_log.Warn("[script]: Unimplemented function called by script: osAdjustSoundVolume(float volume)");
return; return;
} }

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

View File

@ -38,6 +38,8 @@ namespace OpenSim.Region.ExtensionsScriptModule
{ {
public class ScriptManager : IRegionModule, IExtensionScriptModule public class ScriptManager : IRegionModule, IExtensionScriptModule
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly List<IScript> scripts = new List<IScript>(); private readonly List<IScript> scripts = new List<IScript>();
private Scene m_scene; private Scene m_scene;
private readonly Dictionary<string, IScriptCompiler> compilers = new Dictionary<string, IScriptCompiler>(); private readonly Dictionary<string, IScriptCompiler> compilers = new Dictionary<string, IScriptCompiler>();
@ -48,12 +50,12 @@ namespace OpenSim.Region.ExtensionsScriptModule
{ {
ScriptInfo scriptInfo = new ScriptInfo(m_scene); ScriptInfo scriptInfo = new ScriptInfo(m_scene);
// Since each script could potentially corrupt their access with a stray assignment, making a new one for each script. // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
MainLog.Instance.Verbose("SCRIPT", "Loading " + script.Key); m_log.Info("[SCRIPT]: Loading " + script.Key);
script.Value.Initialise(scriptInfo); script.Value.Initialise(scriptInfo);
scripts.Add(script.Value); scripts.Add(script.Value);
} }
MainLog.Instance.Verbose("SCRIPT", string.Format("Finished loading {0} script(s)", compiledscripts.Count)); m_log.Info("[SCRIPT]: " + string.Format("Finished loading {0} script(s)", compiledscripts.Count));
} }
public ScriptManager() public ScriptManager()
@ -71,7 +73,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
MainLog.Instance.Verbose("SCRIPTMODULE", "Initialising Extensions Scripting Module"); m_log.Info("[SCRIPTMODULE]: Initialising Extensions Scripting Module");
m_scene = scene; m_scene = scene;
m_scene.RegisterModuleInterface<IExtensionScriptModule>(this); m_scene.RegisterModuleInterface<IExtensionScriptModule>(this);
@ -118,14 +120,14 @@ namespace OpenSim.Region.ExtensionsScriptModule
break; break;
default: default:
MainLog.Instance.Error("Unknown script command"); m_log.Error("Unknown script command");
break; break;
} }
} }
public bool AddPreCompiledScript(IScript script) public bool AddPreCompiledScript(IScript script)
{ {
MainLog.Instance.Verbose("SCRIPT", "Loading script " + script.Name); m_log.Info("[SCRIPT]: Loading script " + script.Name);
ScriptInfo scriptInfo = new ScriptInfo(m_scene); ScriptInfo scriptInfo = new ScriptInfo(m_scene);
// Since each script could potentially corrupt their access with a stray assignment, making a new one for each script. // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
script.Initialise(scriptInfo); script.Initialise(scriptInfo);