aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorAdam Frisby2007-06-28 19:35:20 +0000
committerAdam Frisby2007-06-28 19:35:20 +0000
commit135e9b1f538ae77dfd8bf68139c960fb8e016c16 (patch)
tree91655f67e6e024415f6069977f54cb891670171a /OpenSim/Region/Environment
parent*Added UUIDNameRequest packet support (untested, but should work -- at least ... (diff)
downloadopensim-SC-135e9b1f538ae77dfd8bf68139c960fb8e016c16.zip
opensim-SC-135e9b1f538ae77dfd8bf68139c960fb8e016c16.tar.gz
opensim-SC-135e9b1f538ae77dfd8bf68139c960fb8e016c16.tar.bz2
opensim-SC-135e9b1f538ae77dfd8bf68139c960fb8e016c16.tar.xz
* Removed J# language support because it has issues with Mono.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/OpenSim.Region.Environment.csproj39
-rw-r--r--OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build24
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/JSharpScriptEngine.cs104
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs3
4 files changed, 27 insertions, 143 deletions
diff --git a/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj b/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj
index 0cfeda9..428f381 100644
--- a/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj
+++ b/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj
@@ -82,10 +82,6 @@
82 <HintPath>System.Xml.dll</HintPath> 82 <HintPath>System.Xml.dll</HintPath>
83 <Private>False</Private> 83 <Private>False</Private>
84 </Reference> 84 </Reference>
85 <Reference Include="VJSharpCodeProvider" >
86 <HintPath>VJSharpCodeProvider.dll</HintPath>
87 <Private>False</Private>
88 </Reference>
89 <Reference Include="XMLRPC.dll" > 85 <Reference Include="XMLRPC.dll" >
90 <HintPath>..\..\..\bin\XMLRPC.dll</HintPath> 86 <HintPath>..\..\..\bin\XMLRPC.dll</HintPath>
91 <Private>False</Private> 87 <Private>False</Private>
@@ -148,61 +144,58 @@
148 </ProjectReference> 144 </ProjectReference>
149 </ItemGroup> 145 </ItemGroup>
150 <ItemGroup> 146 <ItemGroup>
151 <Compile Include="RegionManager.cs">
152 <SubType>Code</SubType>
153 </Compile>
154 <Compile Include="EstateManager.cs"> 147 <Compile Include="EstateManager.cs">
155 <SubType>Code</SubType> 148 <SubType>Code</SubType>
156 </Compile> 149 </Compile>
157 <Compile Include="ParcelManager.cs"> 150 <Compile Include="ParcelManager.cs">
158 <SubType>Code</SubType> 151 <SubType>Code</SubType>
159 </Compile> 152 </Compile>
160 <Compile Include="Scenes\ScenePresence.Body.cs"> 153 <Compile Include="RegionManager.cs">
161 <SubType>Code</SubType> 154 <SubType>Code</SubType>
162 </Compile> 155 </Compile>
163 <Compile Include="Scenes\SceneEvents.cs"> 156 <Compile Include="Scenes\Entity.cs">
164 <SubType>Code</SubType> 157 <SubType>Code</SubType>
165 </Compile> 158 </Compile>
166 <Compile Include="Scenes\ScenePresence.Animations.cs"> 159 <Compile Include="Scenes\IScenePresenceBody.cs">
167 <SubType>Code</SubType> 160 <SubType>Code</SubType>
168 </Compile> 161 </Compile>
169 <Compile Include="Scenes\Scene.PacketHandlers.cs"> 162 <Compile Include="Scenes\Primitive.cs">
170 <SubType>Code</SubType> 163 <SubType>Code</SubType>
171 </Compile> 164 </Compile>
172 <Compile Include="Scenes\SceneObject.cs"> 165 <Compile Include="Scenes\Scene.cs">
173 <SubType>Code</SubType> 166 <SubType>Code</SubType>
174 </Compile> 167 </Compile>
175 <Compile Include="Scenes\Primitive.cs"> 168 <Compile Include="Scenes\Scene.PacketHandlers.cs">
176 <SubType>Code</SubType> 169 <SubType>Code</SubType>
177 </Compile> 170 </Compile>
178 <Compile Include="Scenes\IScenePresenceBody.cs"> 171 <Compile Include="Scenes\SceneBase.cs">
179 <SubType>Code</SubType> 172 <SubType>Code</SubType>
180 </Compile> 173 </Compile>
181 <Compile Include="Scenes\Entity.cs"> 174 <Compile Include="Scenes\SceneEvents.cs">
182 <SubType>Code</SubType> 175 <SubType>Code</SubType>
183 </Compile> 176 </Compile>
184 <Compile Include="Scenes\SceneBase.cs"> 177 <Compile Include="Scenes\SceneObject.cs">
185 <SubType>Code</SubType> 178 <SubType>Code</SubType>
186 </Compile> 179 </Compile>
187 <Compile Include="Scenes\ScenePresence.cs"> 180 <Compile Include="Scenes\ScenePresence.Animations.cs">
188 <SubType>Code</SubType> 181 <SubType>Code</SubType>
189 </Compile> 182 </Compile>
190 <Compile Include="Scenes\Scene.cs"> 183 <Compile Include="Scenes\ScenePresence.Body.cs">
191 <SubType>Code</SubType> 184 <SubType>Code</SubType>
192 </Compile> 185 </Compile>
193 <Compile Include="Scenes\scripting\ScriptManager.cs"> 186 <Compile Include="Scenes\ScenePresence.cs">
194 <SubType>Code</SubType> 187 <SubType>Code</SubType>
195 </Compile> 188 </Compile>
196 <Compile Include="Scenes\scripting\ScriptInfo.cs"> 189 <Compile Include="Scenes\scripting\Script.cs">
197 <SubType>Code</SubType> 190 <SubType>Code</SubType>
198 </Compile> 191 </Compile>
199 <Compile Include="Scenes\scripting\Script.cs"> 192 <Compile Include="Scenes\scripting\ScriptInfo.cs">
200 <SubType>Code</SubType> 193 <SubType>Code</SubType>
201 </Compile> 194 </Compile>
202 <Compile Include="Scenes\scripting\Engines\CSharpScriptEngine.cs"> 195 <Compile Include="Scenes\scripting\ScriptManager.cs">
203 <SubType>Code</SubType> 196 <SubType>Code</SubType>
204 </Compile> 197 </Compile>
205 <Compile Include="Scenes\scripting\Engines\JSharpScriptEngine.cs"> 198 <Compile Include="Scenes\scripting\Engines\CSharpScriptEngine.cs">
206 <SubType>Code</SubType> 199 <SubType>Code</SubType>
207 </Compile> 200 </Compile>
208 <Compile Include="Scenes\scripting\Engines\JScriptEngine.cs"> 201 <Compile Include="Scenes\scripting\Engines\JScriptEngine.cs">
diff --git a/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build b/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build
index fcfc623..2fa5e76 100644
--- a/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build
+++ b/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build
@@ -11,25 +11,24 @@
11 <resources prefix="OpenSim.Region.Environment" dynamicprefix="true" > 11 <resources prefix="OpenSim.Region.Environment" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="RegionManager.cs" />
15 <include name="EstateManager.cs" /> 14 <include name="EstateManager.cs" />
16 <include name="ParcelManager.cs" /> 15 <include name="ParcelManager.cs" />
17 <include name="Scenes/ScenePresence.Body.cs" /> 16 <include name="RegionManager.cs" />
18 <include name="Scenes/SceneEvents.cs" />
19 <include name="Scenes/ScenePresence.Animations.cs" />
20 <include name="Scenes/Scene.PacketHandlers.cs" />
21 <include name="Scenes/SceneObject.cs" />
22 <include name="Scenes/Primitive.cs" />
23 <include name="Scenes/IScenePresenceBody.cs" />
24 <include name="Scenes/Entity.cs" /> 17 <include name="Scenes/Entity.cs" />
18 <include name="Scenes/IScenePresenceBody.cs" />
19 <include name="Scenes/Primitive.cs" />
20 <include name="Scenes/Scene.cs" />
21 <include name="Scenes/Scene.PacketHandlers.cs" />
25 <include name="Scenes/SceneBase.cs" /> 22 <include name="Scenes/SceneBase.cs" />
23 <include name="Scenes/SceneEvents.cs" />
24 <include name="Scenes/SceneObject.cs" />
25 <include name="Scenes/ScenePresence.Animations.cs" />
26 <include name="Scenes/ScenePresence.Body.cs" />
26 <include name="Scenes/ScenePresence.cs" /> 27 <include name="Scenes/ScenePresence.cs" />
27 <include name="Scenes/Scene.cs" />
28 <include name="Scenes/scripting/ScriptManager.cs" />
29 <include name="Scenes/scripting/ScriptInfo.cs" />
30 <include name="Scenes/scripting/Script.cs" /> 28 <include name="Scenes/scripting/Script.cs" />
29 <include name="Scenes/scripting/ScriptInfo.cs" />
30 <include name="Scenes/scripting/ScriptManager.cs" />
31 <include name="Scenes/scripting/Engines/CSharpScriptEngine.cs" /> 31 <include name="Scenes/scripting/Engines/CSharpScriptEngine.cs" />
32 <include name="Scenes/scripting/Engines/JSharpScriptEngine.cs" />
33 <include name="Scenes/scripting/Engines/JScriptEngine.cs" /> 32 <include name="Scenes/scripting/Engines/JScriptEngine.cs" />
34 </sources> 33 </sources>
35 <references basedir="${project::get-base-directory()}"> 34 <references basedir="${project::get-base-directory()}">
@@ -52,7 +51,6 @@
52 <include name="../../../bin/OpenSim.Region.Terrain.BasicTerrain.dll" /> 51 <include name="../../../bin/OpenSim.Region.Terrain.BasicTerrain.dll" />
53 <include name="System.dll" /> 52 <include name="System.dll" />
54 <include name="System.Xml.dll" /> 53 <include name="System.Xml.dll" />
55 <include name="VJSharpCodeProvider.dll" />
56 <include name="../../../bin/XMLRPC.dll" /> 54 <include name="../../../bin/XMLRPC.dll" />
57 </references> 55 </references>
58 </csc> 56 </csc>
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/JSharpScriptEngine.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/JSharpScriptEngine.cs
deleted file mode 100644
index 51b1512..0000000
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/JSharpScriptEngine.cs
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.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 OpenSim 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.Text;
31
32// Compilation stuff
33using System.CodeDom;
34using System.CodeDom.Compiler;
35using Microsoft.VJSharp;
36
37namespace OpenSim.Region.Enviorment.Scripting
38{
39 public class JSharpScriptEngine : IScriptCompiler
40 {
41 public string FileExt()
42 {
43 return ".jsl";
44 }
45
46 private Dictionary<string, IScript> LoadDotNetScript(ICodeCompiler compiler, string filename)
47 {
48 CompilerParameters compilerParams = new CompilerParameters();
49 CompilerResults compilerResults;
50 compilerParams.GenerateExecutable = false;
51 compilerParams.GenerateInMemory = true;
52 compilerParams.IncludeDebugInformation = false;
53 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.dll");
54 compilerParams.ReferencedAssemblies.Add("OpenSim.Framework.dll");
55 compilerParams.ReferencedAssemblies.Add("libsecondlife.dll");
56 compilerParams.ReferencedAssemblies.Add("System.dll");
57
58 compilerResults = compiler.CompileAssemblyFromFile(compilerParams, filename);
59
60 if (compilerResults.Errors.Count > 0)
61 {
62 OpenSim.Framework.Console.MainLog.Instance.Error("Compile errors");
63 foreach (CompilerError error in compilerResults.Errors)
64 {
65 OpenSim.Framework.Console.MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
66 }
67 }
68 else
69 {
70 Dictionary<string, IScript> scripts = new Dictionary<string, IScript>();
71
72 foreach (Type pluginType in compilerResults.CompiledAssembly.GetExportedTypes())
73 {
74 Type testInterface = pluginType.GetInterface("IScript", true);
75
76 if (testInterface != null)
77 {
78 IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString());
79
80 string scriptName = "J#/" + script.getName();
81 Console.WriteLine("Script: " + scriptName + " loaded.");
82
83 if (!scripts.ContainsKey(scriptName))
84 {
85 scripts.Add(scriptName, script);
86 }
87 else
88 {
89 scripts[scriptName] = script;
90 }
91 }
92 }
93 return scripts;
94 }
95 return null;
96 }
97
98 public Dictionary<string, IScript> compile(string filename)
99 {
100 VJSharpCodeProvider jsharpProvider = new VJSharpCodeProvider();
101 return LoadDotNetScript(jsharpProvider.CreateCompiler(), filename);
102 }
103 }
104}
diff --git a/OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs b/OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs
index 576b7a5..eb1c1d9 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs
@@ -59,9 +59,6 @@ namespace OpenSim.Region.Enviorment.Scripting
59 59
60 JScriptEngine jscriptCompiler = new JScriptEngine(); 60 JScriptEngine jscriptCompiler = new JScriptEngine();
61 compilers.Add(jscriptCompiler.FileExt(), jscriptCompiler); 61 compilers.Add(jscriptCompiler.FileExt(), jscriptCompiler);
62
63 JSharpScriptEngine jsharpCompiler = new JSharpScriptEngine();
64 compilers.Add(jsharpCompiler.FileExt(), jsharpCompiler);
65 } 62 }
66 63
67 public void Compile(string filename) 64 public void Compile(string filename)