* minor refactorings
parent
ea980ca928
commit
1b100e17a5
|
@ -75,7 +75,7 @@ namespace OpenSim.Region.Scripting
|
||||||
{
|
{
|
||||||
IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
|
IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
|
||||||
|
|
||||||
string scriptName = "C#/" + script.getName();
|
string scriptName = "C#/" + script.Name;
|
||||||
Console.WriteLine("Script: " + scriptName + " loaded.");
|
Console.WriteLine("Script: " + scriptName + " loaded.");
|
||||||
|
|
||||||
if (!scripts.ContainsKey(scriptName))
|
if (!scripts.ContainsKey(scriptName))
|
||||||
|
|
|
@ -12,9 +12,9 @@ namespace OpenSim.Region.Scripting.Examples
|
||||||
{
|
{
|
||||||
ScriptInfo script;
|
ScriptInfo script;
|
||||||
|
|
||||||
public string getName()
|
public string Name
|
||||||
{
|
{
|
||||||
return "LSL Export Script 0.1";
|
get { return "LSL Export Script 0.1"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(ScriptInfo scriptInfo)
|
public void Initialise(ScriptInfo scriptInfo)
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace OpenSim.Region.Scripting
|
||||||
{
|
{
|
||||||
IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
|
IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
|
||||||
|
|
||||||
string scriptName = "JS.NET/" + script.getName();
|
string scriptName = "JS.NET/" + script.Name;
|
||||||
Console.WriteLine("Script: " + scriptName + " loaded.");
|
Console.WriteLine("Script: " + scriptName + " loaded.");
|
||||||
|
|
||||||
if (!scripts.ContainsKey(scriptName))
|
if (!scripts.ContainsKey(scriptName))
|
||||||
|
|
|
@ -91,9 +91,9 @@ namespace OpenSim.Region.Scripting.EmbeddedJVM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getName()
|
public string Name
|
||||||
{
|
{
|
||||||
return "JVM Scripting Engine";
|
get { return "JVM Scripting Engine"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadScript(string script)
|
public void LoadScript(string script)
|
||||||
|
|
|
@ -25,9 +25,9 @@ namespace OpenSim.Region.Scripting.LSL
|
||||||
scriptInfo = info;
|
scriptInfo = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getName()
|
public string Name
|
||||||
{
|
{
|
||||||
return "LSL Script";
|
get { return "LSL Script"; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,23 +32,23 @@ namespace OpenSim.Region.Scripting
|
||||||
public interface IScript
|
public interface IScript
|
||||||
{
|
{
|
||||||
void Initialise(ScriptInfo scriptInfo);
|
void Initialise(ScriptInfo scriptInfo);
|
||||||
string getName();
|
string Name { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TestScript : IScript
|
public class TestScript : IScript
|
||||||
{
|
{
|
||||||
ScriptInfo script;
|
ScriptInfo script;
|
||||||
|
|
||||||
public string getName()
|
public string Name
|
||||||
{
|
{
|
||||||
return "TestScript 0.1";
|
get { return "TestScript 0.1"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(ScriptInfo scriptInfo)
|
public void Initialise(ScriptInfo scriptInfo)
|
||||||
{
|
{
|
||||||
script = scriptInfo;
|
script = scriptInfo;
|
||||||
script.events.OnFrame += new EventManager.OnFrameDelegate(events_OnFrame);
|
script.events.OnFrame += events_OnFrame;
|
||||||
script.events.OnNewPresence += new EventManager.OnNewPresenceDelegate(events_OnNewPresence);
|
script.events.OnNewPresence += events_OnNewPresence;
|
||||||
}
|
}
|
||||||
|
|
||||||
void events_OnNewPresence(ScenePresence presence)
|
void events_OnNewPresence(ScenePresence presence)
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace OpenSim.Region.Scripting
|
||||||
|
|
||||||
public void AddPreCompiledScript(IScript script)
|
public void AddPreCompiledScript(IScript script)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Verbose("Loading script " + script.getName());
|
MainLog.Instance.Verbose("Loading script " + script.Name);
|
||||||
ScriptInfo scriptInfo = new ScriptInfo(scene); // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
|
ScriptInfo scriptInfo = new ScriptInfo(scene); // 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);
|
||||||
scripts.Add(script);
|
scripts.Add(script);
|
||||||
|
|
Loading…
Reference in New Issue