* Optimized usings (the 'LL ate my scripts' commit)

* added some licensing info
This commit is contained in:
lbsa71
2007-07-03 14:37:29 +00:00
parent 73a5ec391a
commit 9b6b6d05d4
184 changed files with 705 additions and 1207 deletions

View File

@@ -26,13 +26,10 @@
*
*/
using System;
using System.Collections.Generic;
using System.Text;
// Compilation stuff
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using Microsoft.CSharp;
using OpenSim.Framework.Console;
namespace OpenSim.Region.Enviorment.Scripting
{
@@ -60,10 +57,10 @@ namespace OpenSim.Region.Enviorment.Scripting
if (compilerResults.Errors.Count > 0)
{
OpenSim.Framework.Console.MainLog.Instance.Error("Compile errors");
MainLog.Instance.Error("Compile errors");
foreach (CompilerError error in compilerResults.Errors)
{
OpenSim.Framework.Console.MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
}
}
else

View File

@@ -26,13 +26,10 @@
*
*/
using System;
using System.Collections.Generic;
using System.Text;
// Compilation stuff
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using Microsoft.JScript;
using OpenSim.Framework.Console;
namespace OpenSim.Region.Enviorment.Scripting
{
@@ -60,10 +57,10 @@ namespace OpenSim.Region.Enviorment.Scripting
if (compilerResults.Errors.Count > 0)
{
OpenSim.Framework.Console.MainLog.Instance.Error("Compile errors");
MainLog.Instance.Error("Compile errors");
foreach (CompilerError error in compilerResults.Errors)
{
OpenSim.Framework.Console.MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
}
}
else

View File

@@ -25,13 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Console;
using OpenSim.Framework;
using OpenSim.Region.Environment;
using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Enviorment.Scripting
@@ -54,7 +47,7 @@ namespace OpenSim.Region.Enviorment.Scripting
public void Initialise(ScriptInfo scriptInfo)
{
script = scriptInfo;
script.events.OnFrame += new OpenSim.Region.Environment.Scenes.EventManager.OnFrameDelegate(events_OnFrame);
script.events.OnFrame += new EventManager.OnFrameDelegate(events_OnFrame);
script.events.OnNewPresence += new EventManager.OnNewPresenceDelegate(events_OnNewPresence);
}

View File

@@ -25,12 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Enviorment.Scripting
{
@@ -52,7 +48,7 @@ namespace OpenSim.Region.Enviorment.Scripting
{
world = scene;
events = world.eventManager;
logger = OpenSim.Framework.Console.MainLog.Instance;
logger = MainLog.Instance;
}
}
}

View File

@@ -25,16 +25,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Enviorment.Scripting
{
public class ScriptManager
{
List<IScript> scripts = new List<IScript>();
OpenSim.Region.Environment.Scenes.Scene scene;
Scene scene;
Dictionary<string, IScriptCompiler> compilers = new Dictionary<string, IScriptCompiler>();
private void LoadFromCompiler(Dictionary<string, IScript> compiledscripts)
@@ -42,14 +42,14 @@ namespace OpenSim.Region.Enviorment.Scripting
foreach (KeyValuePair<string, IScript> script in compiledscripts)
{
ScriptInfo scriptInfo = new ScriptInfo(scene); // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
OpenSim.Framework.Console.MainLog.Instance.Verbose("Loading " + script.Key);
MainLog.Instance.Verbose("Loading " + script.Key);
script.Value.Initialise(scriptInfo);
scripts.Add(script.Value);
}
OpenSim.Framework.Console.MainLog.Instance.Verbose("Finished loading " + compiledscripts.Count.ToString() + " script(s)");
MainLog.Instance.Verbose("Finished loading " + compiledscripts.Count.ToString() + " script(s)");
}
public ScriptManager(OpenSim.Region.Environment.Scenes.Scene world)
public ScriptManager(Scene world)
{
scene = world;
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Enviorment.Scripting
break;
default:
OpenSim.Framework.Console.MainLog.Instance.Error("Unknown script command");
MainLog.Instance.Error("Unknown script command");
break;
}
}