mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
* Java engine fully back in Sugilite
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
@@ -6,7 +6,8 @@
|
||||
<ProjectGuid>{DCBA491C-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Region.Environment</AssemblyName>
|
||||
@@ -15,9 +16,11 @@
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<AppDesignerFolder>
|
||||
</AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Region.Environment</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
@@ -28,7 +31,8 @@
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
@@ -37,7 +41,8 @@
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
@@ -46,7 +51,8 @@
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
@@ -55,34 +61,36 @@
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Axiom.MathLib.dll" >
|
||||
<Reference Include="Axiom.MathLib.dll">
|
||||
<HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Db4objects.Db4o.dll" >
|
||||
<Reference Include="Db4objects.Db4o.dll">
|
||||
<HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="libsecondlife.dll" >
|
||||
<Reference Include="libsecondlife.dll">
|
||||
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.JScript" >
|
||||
<Reference Include="Microsoft.JScript">
|
||||
<HintPath>Microsoft.JScript.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" >
|
||||
<Reference Include="System">
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml">
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="XMLRPC.dll" >
|
||||
<Reference Include="XMLRPC.dll">
|
||||
<HintPath>..\..\..\bin\XMLRPC.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
@@ -92,55 +100,55 @@
|
||||
<Name>OpenSim.Framework</Name>
|
||||
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Framework\Communications\OpenSim.Framework.Communications.csproj">
|
||||
<Name>OpenSim.Framework.Communications</Name>
|
||||
<Project>{CB52B7E7-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Framework\Console\OpenSim.Framework.Console.csproj">
|
||||
<Name>OpenSim.Framework.Console</Name>
|
||||
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Framework\GenericConfig\Xml\OpenSim.Framework.GenericConfig.Xml.csproj">
|
||||
<Name>OpenSim.Framework.GenericConfig.Xml</Name>
|
||||
<Project>{C74E4A30-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Framework\Servers\OpenSim.Framework.Servers.csproj">
|
||||
<Name>OpenSim.Framework.Servers</Name>
|
||||
<Project>{2CC71860-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Caches\OpenSim.Region.Caches.csproj">
|
||||
<Name>OpenSim.Region.Caches</Name>
|
||||
<Project>{61FCCDB3-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Capabilities\OpenSim.Region.Capabilities.csproj">
|
||||
<Name>OpenSim.Region.Capabilities</Name>
|
||||
<Project>{39038E85-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Physics\Manager\OpenSim.Region.Physics.Manager.csproj">
|
||||
<Name>OpenSim.Region.Physics.Manager</Name>
|
||||
<Project>{F4FF31EB-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Terrain.BasicTerrain\OpenSim.Region.Terrain.BasicTerrain.csproj">
|
||||
<Name>OpenSim.Region.Terrain.BasicTerrain</Name>
|
||||
<Project>{C9E0F891-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -192,6 +200,7 @@
|
||||
<Compile Include="Scenes\ScenePresence.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Scenes\scripting\Engines\JVMEngine\JavaEngine.cs" />
|
||||
<Compile Include="Scenes\scripting\Script.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -281,4 +290,4 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using OpenSim.Region.Environment.Scripting;
|
||||
using OpenSim.Scripting.EmbeddedJVM;
|
||||
|
||||
namespace OpenSim.Region.Environment.Scripting
|
||||
{
|
||||
public class JavaEngine : IScriptCompiler
|
||||
{
|
||||
public string FileExt()
|
||||
{
|
||||
return ".java";
|
||||
}
|
||||
|
||||
public Dictionary<string, IScript> compile(string filename)
|
||||
{
|
||||
JVMScript script = new JVMScript();
|
||||
Dictionary<string, IScript> returns = new Dictionary<string, IScript>();
|
||||
|
||||
script.LoadScript(filename);
|
||||
|
||||
returns.Add(filename, script);
|
||||
|
||||
return returns;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ using OpenSim.Region.Environment.Scenes;
|
||||
|
||||
namespace OpenSim.Scripting.EmbeddedJVM
|
||||
{
|
||||
public class OpenSimJVM : IScript
|
||||
public class JVMScript : IScript
|
||||
{
|
||||
private List<Thread> _threads = new List<Thread>();
|
||||
private BlockingQueue<CompileInfo> CompileScripts = new BlockingQueue<CompileInfo>();
|
||||
@@ -47,7 +47,7 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||
|
||||
ScriptInfo scriptInfo;
|
||||
|
||||
public OpenSimJVM()
|
||||
public JVMScript()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -55,6 +55,14 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||
public void Initialise(ScriptInfo info)
|
||||
{
|
||||
scriptInfo = info;
|
||||
|
||||
_mainMemory = new MainMemory();
|
||||
Thread.GlobalMemory = this._mainMemory;
|
||||
Thread.World = info.world;
|
||||
compileThread = new System.Threading.Thread(new ThreadStart(CompileScript));
|
||||
compileThread.IsBackground = true;
|
||||
compileThread.Start();
|
||||
|
||||
}
|
||||
|
||||
public string getName()
|
||||
@@ -62,30 +70,12 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||
return "JVM Scripting Engine";
|
||||
}
|
||||
|
||||
public bool Init(Scene world)
|
||||
public void LoadScript(string script)
|
||||
{
|
||||
Console.WriteLine("Creating OpenSim JVM scripting engine");
|
||||
_mainMemory = new MainMemory();
|
||||
Thread.GlobalMemory = this._mainMemory;
|
||||
Thread.World = world;
|
||||
compileThread = new System.Threading.Thread(new ThreadStart(CompileScript));
|
||||
compileThread.IsBackground = true;
|
||||
compileThread.Start();
|
||||
return true;
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return "OpenSimJVM";
|
||||
}
|
||||
|
||||
public void LoadScript(string script, string scriptName, uint entityID)
|
||||
{
|
||||
Console.WriteLine("OpenSimJVM - loading new script: " + scriptName);
|
||||
Console.WriteLine("OpenSimJVM - loading new script: " + script);
|
||||
CompileInfo comp = new CompileInfo();
|
||||
comp.entityId = entityID;
|
||||
comp.script = script;
|
||||
comp.scriptName = scriptName;
|
||||
comp.scriptName = script;
|
||||
this.CompileScripts.Enqueue(comp);
|
||||
}
|
||||
|
||||
@@ -96,7 +86,6 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||
CompileInfo comp = this.CompileScripts.Dequeue();
|
||||
string script = comp.script;
|
||||
string scriptName = comp.scriptName;
|
||||
uint entityID = comp.entityId;
|
||||
try
|
||||
{
|
||||
//need to compile the script into a java class file
|
||||
@@ -127,7 +116,6 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||
|
||||
Thread newThread = new Thread();
|
||||
this._threads.Add(newThread);
|
||||
newThread.EntityId = entityID;
|
||||
newThread.currentClass = class1;
|
||||
newThread.scriptInfo = scriptInfo;
|
||||
|
||||
@@ -165,7 +153,6 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||
{
|
||||
public string script;
|
||||
public string scriptName;
|
||||
public uint entityId;
|
||||
|
||||
public CompileInfo()
|
||||
{
|
||||
|
||||
@@ -50,7 +50,6 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||
private StackFrame currentFrame;
|
||||
public int excutionCounter = 0;
|
||||
public bool running = false;
|
||||
public uint EntityId = 0;
|
||||
|
||||
public ScriptInfo scriptInfo;
|
||||
|
||||
|
||||
@@ -59,6 +59,9 @@ namespace OpenSim.Region.Environment.Scripting
|
||||
|
||||
JScriptEngine jscriptCompiler = new JScriptEngine();
|
||||
compilers.Add(jscriptCompiler.FileExt(), jscriptCompiler);
|
||||
|
||||
JavaEngine javaCompiler = new JavaEngine();
|
||||
compilers.Add(javaCompiler.FileExt(), javaCompiler);
|
||||
}
|
||||
|
||||
public void Compile(string filename)
|
||||
|
||||
Reference in New Issue
Block a user