aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
diff options
context:
space:
mode:
authorTedd Hansen2008-11-08 17:35:48 +0000
committerTedd Hansen2008-11-08 17:35:48 +0000
commit9511a8c76370f21e839114007dcd2b25c69b009a (patch)
treeb63323dfd96ecd1cc3cd560939bd66bb43ec9c1c /OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
parent* Added IClientIM to IClientCore interfaces (diff)
downloadopensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.zip
opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.gz
opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.bz2
opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.xz
Work in progress on SECS stuff. Have been holding it off until after 0.6 release. Still messy as hell and doesn't really work yet. Will undergo dramatic changes. AND MOST IMPORTANTLY: Will be conformed to work in coop with todays DNE and XEngine, hopefully one day providing a common interface for all components.
Diffstat (limited to 'OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs')
-rw-r--r--OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs94
1 files changed, 94 insertions, 0 deletions
diff --git a/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs b/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
new file mode 100644
index 0000000..834fac3
--- /dev/null
+++ b/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
@@ -0,0 +1,94 @@
1using System;
2using System.Collections.Generic;
3using System.Reflection;
4using log4net;
5using Nini.Config;
6using OpenSim.Region.Environment.Scenes;
7using OpenSim.Region.ScriptEngine.Shared;
8using OpenSim.ScriptEngine.Shared;
9using EventParams=OpenSim.ScriptEngine.Shared.EventParams;
10
11namespace OpenSim.ScriptEngine.Shared
12{
13 public struct RegionInfoStructure
14 {
15 public Scene Scene;
16 public IConfigSource ConfigSource;
17
18 public IScriptLoader ScriptLoader;
19 public Dictionary<string, IScriptEventProvider> EventProviders;
20 public Dictionary<string, IScriptExecutor> Executors;
21 public Dictionary<string, IScriptCompiler> Compilers;
22 public Dictionary<string, IScriptScheduler> Schedulers;
23 public Dictionary<string, IScriptCommandProvider> CommandProviders;
24 public ILog Logger;
25
26 public void Executors_Execute(EventParams p)
27 {
28 // Execute a command on all executors
29 lock (Executors)
30 {
31 foreach (IScriptExecutor exec in Executors.Values)
32 {
33 exec.ExecuteCommand(p);
34 }
35 }
36 }
37 public void Executors_Execute(ScriptStructure scriptContainer, EventParams p)
38 {
39 // Execute a command on all executors
40 lock (Executors)
41 {
42 foreach (IScriptExecutor exec in Executors.Values)
43 {
44 exec.ExecuteCommand(ref scriptContainer, p);
45 }
46 }
47 }
48
49 public IScriptCompiler FindCompiler(ScriptMetaData scriptMetaData)
50 {
51 string compiler = "Compiler_LSL";
52 if (scriptMetaData.ContainsKey("Compiler"))
53 compiler = scriptMetaData["Compiler"];
54
55 lock (Compilers)
56 {
57 if (!Compilers.ContainsKey(compiler))
58 throw new Exception("Requested script compiler \"" + compiler + "\" does not exist.");
59
60 return Compilers[compiler];
61 }
62 }
63
64 public IScriptScheduler FindScheduler(ScriptMetaData scriptMetaData)
65 {
66 string scheduler = "Scheduler";
67 if (scriptMetaData.ContainsKey("Scheduler"))
68 scheduler = scriptMetaData["Scheduler"];
69
70 lock (Schedulers)
71 {
72 if (!Schedulers.ContainsKey(scheduler))
73 throw new Exception("Requested script scheduler \"" + scheduler + "\" does not exist.");
74
75 return Schedulers[scheduler];
76 }
77 }
78
79 //public Assembly[] GetCommandProviderAssemblies()
80 //{
81 // lock (CommandProviders)
82 // {
83 // Assembly[] ass = new Assembly[CommandProviders.Count];
84 // int i = 0;
85 // foreach (string key in CommandProviders.Keys)
86 // {
87 // ass[i] = CommandProviders[key].GetType().Assembly;
88 // i++;
89 // }
90 // return ass;
91 // }
92 //}
93 }
94} \ No newline at end of file