aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Region/Scenes/scripting/ScriptManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.Region/Scenes/scripting/ScriptManager.cs')
-rw-r--r--OpenSim/OpenSim.Region/Scenes/scripting/ScriptManager.cs66
1 files changed, 0 insertions, 66 deletions
diff --git a/OpenSim/OpenSim.Region/Scenes/scripting/ScriptManager.cs b/OpenSim/OpenSim.Region/Scenes/scripting/ScriptManager.cs
deleted file mode 100644
index ff5c115..0000000
--- a/OpenSim/OpenSim.Region/Scenes/scripting/ScriptManager.cs
+++ /dev/null
@@ -1,66 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting
6{
7 public class ScriptManager
8 {
9 List<IScript> scripts = new List<IScript>();
10 OpenSim.Region.Scenes.Scene scene;
11 Dictionary<string, IScriptCompiler> compilers = new Dictionary<string, IScriptCompiler>();
12
13 private void LoadFromCompiler(Dictionary<string, IScript> compiledscripts)
14 {
15 foreach (KeyValuePair<string, IScript> script in compiledscripts)
16 {
17 ScriptInfo scriptInfo = new ScriptInfo(scene); // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
18 OpenSim.Framework.Console.MainLog.Instance.Verbose("Loading " + script.Key);
19 script.Value.Initialise(scriptInfo);
20 scripts.Add(script.Value);
21 }
22 OpenSim.Framework.Console.MainLog.Instance.Verbose("Finished loading " + compiledscripts.Count.ToString() + " script(s)");
23 }
24
25 public ScriptManager(OpenSim.Region.Scenes.Scene world)
26 {
27 scene = world;
28
29 // Defualt Engines
30 CSharpScriptEngine csharpCompiler = new CSharpScriptEngine();
31 compilers.Add(csharpCompiler.fileExt(),csharpCompiler);
32 }
33
34 public void Compile(string filename)
35 {
36 foreach (KeyValuePair<string, IScriptCompiler> compiler in compilers)
37 {
38 if (filename.EndsWith(compiler.Key))
39 {
40 LoadFromCompiler(compiler.Value.compile(filename));
41 break;
42 }
43 }
44 }
45
46 public void RunScriptCmd(string[] args)
47 {
48 switch (args[0])
49 {
50 case "load":
51 Compile(args[1]);
52 break;
53
54 default:
55 OpenSim.Framework.Console.MainLog.Instance.Error("Unknown script command");
56 break;
57 }
58 }
59 }
60
61 interface IScriptCompiler
62 {
63 Dictionary<string,IScript> compile(string filename);
64 string fileExt();
65 }
66}