aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-11-03 19:11:09 +0000
committerJustin Clark-Casey (justincc)2009-11-03 19:11:09 +0000
commitaf0e5d097480de264e7501e7d5d35328be5640bb (patch)
tree4ca5cd796ed9618dc9134a6e5eee1f7e7912bee4 /OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
parentminor: remove some mono compiler warnings (diff)
parentFixed a couple of NREs in corner cases. (diff)
downloadopensim-SC_OLD-af0e5d097480de264e7501e7d5d35328be5640bb.zip
opensim-SC_OLD-af0e5d097480de264e7501e7d5d35328be5640bb.tar.gz
opensim-SC_OLD-af0e5d097480de264e7501e7d5d35328be5640bb.tar.bz2
opensim-SC_OLD-af0e5d097480de264e7501e7d5d35328be5640bb.tar.xz
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs')
-rw-r--r--OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs120
1 files changed, 0 insertions, 120 deletions
diff --git a/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs b/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
deleted file mode 100644
index 64b33d4..0000000
--- a/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using Nini.Config;
33using OpenSim.Region.Framework.Scenes;
34using OpenSim.Region.ScriptEngine.Shared;
35using OpenSim.ScriptEngine.Shared;
36using EventParams = OpenSim.ScriptEngine.Shared.EventParams;
37
38namespace OpenSim.ScriptEngine.Shared
39{
40 public struct RegionInfoStructure
41 {
42 public Scene Scene;
43 public IConfigSource ConfigSource;
44
45 public IScriptLoader ScriptLoader;
46 public Dictionary<string, IScriptEventProvider> EventProviders;
47 public Dictionary<string, IScriptExecutor> Executors;
48 public Dictionary<string, IScriptCompiler> Compilers;
49 public Dictionary<string, IScriptScheduler> Schedulers;
50 public Dictionary<string, IScriptCommandProvider> CommandProviders;
51
52 public void Executors_Execute(EventParams p)
53 {
54 // Execute a command on all executors
55 lock (Executors)
56 {
57 foreach (IScriptExecutor exec in Executors.Values)
58 {
59 exec.ExecuteCommand(p);
60 }
61 }
62 }
63 public void Executors_Execute(ScriptStructure scriptContainer, EventParams p)
64 {
65 // Execute a command on all executors
66 lock (Executors)
67 {
68 foreach (IScriptExecutor exec in Executors.Values)
69 {
70 exec.ExecuteCommand(ref scriptContainer, p);
71 }
72 }
73 }
74
75 public IScriptCompiler FindCompiler(ScriptMetaData scriptMetaData)
76 {
77 string compiler = "Compiler_LSL";
78 if (scriptMetaData.ContainsKey("Compiler"))
79 compiler = scriptMetaData["Compiler"];
80
81 lock (Compilers)
82 {
83 if (!Compilers.ContainsKey(compiler))
84 throw new Exception("Requested script compiler \"" + compiler + "\" does not exist.");
85
86 return Compilers[compiler];
87 }
88 }
89
90 public IScriptScheduler FindScheduler(ScriptMetaData scriptMetaData)
91 {
92 string scheduler = "Scheduler";
93 if (scriptMetaData.ContainsKey("Scheduler"))
94 scheduler = scriptMetaData["Scheduler"];
95
96 lock (Schedulers)
97 {
98 if (!Schedulers.ContainsKey(scheduler))
99 throw new Exception("Requested script scheduler \"" + scheduler + "\" does not exist.");
100
101 return Schedulers[scheduler];
102 }
103 }
104
105 //public Assembly[] GetCommandProviderAssemblies()
106 //{
107 // lock (CommandProviders)
108 // {
109 // Assembly[] ass = new Assembly[CommandProviders.Count];
110 // int i = 0;
111 // foreach (string key in CommandProviders.Keys)
112 // {
113 // ass[i] = CommandProviders[key].GetType().Assembly;
114 // i++;
115 // }
116 // return ass;
117 // }
118 //}
119 }
120} \ No newline at end of file