diff options
author | Adam Frisby | 2007-07-05 00:24:40 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-05 00:24:40 +0000 |
commit | c570b107f890180bcaf5e5a030525af04feab1d4 (patch) | |
tree | e7cbc1355c3654307d40f54a97cab32d93e275d3 /OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/OpenSimJVM.cs | |
parent | * Added Java support back into Sugilite (although it still needs a calling ho... (diff) | |
download | opensim-SC-c570b107f890180bcaf5e5a030525af04feab1d4.zip opensim-SC-c570b107f890180bcaf5e5a030525af04feab1d4.tar.gz opensim-SC-c570b107f890180bcaf5e5a030525af04feab1d4.tar.bz2 opensim-SC-c570b107f890180bcaf5e5a030525af04feab1d4.tar.xz |
* Java engine fully back in Sugilite
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/OpenSimJVM.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/OpenSimJVM.cs | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/OpenSimJVM.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/OpenSimJVM.cs index 7ed734b..aaa1609 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/OpenSimJVM.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/OpenSimJVM.cs | |||
@@ -38,7 +38,7 @@ using OpenSim.Region.Environment.Scenes; | |||
38 | 38 | ||
39 | namespace OpenSim.Scripting.EmbeddedJVM | 39 | namespace OpenSim.Scripting.EmbeddedJVM |
40 | { | 40 | { |
41 | public class OpenSimJVM : IScript | 41 | public class JVMScript : IScript |
42 | { | 42 | { |
43 | private List<Thread> _threads = new List<Thread>(); | 43 | private List<Thread> _threads = new List<Thread>(); |
44 | private BlockingQueue<CompileInfo> CompileScripts = new BlockingQueue<CompileInfo>(); | 44 | private BlockingQueue<CompileInfo> CompileScripts = new BlockingQueue<CompileInfo>(); |
@@ -47,7 +47,7 @@ namespace OpenSim.Scripting.EmbeddedJVM | |||
47 | 47 | ||
48 | ScriptInfo scriptInfo; | 48 | ScriptInfo scriptInfo; |
49 | 49 | ||
50 | public OpenSimJVM() | 50 | public JVMScript() |
51 | { | 51 | { |
52 | 52 | ||
53 | } | 53 | } |
@@ -55,37 +55,27 @@ namespace OpenSim.Scripting.EmbeddedJVM | |||
55 | public void Initialise(ScriptInfo info) | 55 | public void Initialise(ScriptInfo info) |
56 | { | 56 | { |
57 | scriptInfo = info; | 57 | scriptInfo = info; |
58 | } | ||
59 | |||
60 | public string getName() | ||
61 | { | ||
62 | return "JVM Scripting Engine"; | ||
63 | } | ||
64 | 58 | ||
65 | public bool Init(Scene world) | ||
66 | { | ||
67 | Console.WriteLine("Creating OpenSim JVM scripting engine"); | ||
68 | _mainMemory = new MainMemory(); | 59 | _mainMemory = new MainMemory(); |
69 | Thread.GlobalMemory = this._mainMemory; | 60 | Thread.GlobalMemory = this._mainMemory; |
70 | Thread.World = world; | 61 | Thread.World = info.world; |
71 | compileThread = new System.Threading.Thread(new ThreadStart(CompileScript)); | 62 | compileThread = new System.Threading.Thread(new ThreadStart(CompileScript)); |
72 | compileThread.IsBackground = true; | 63 | compileThread.IsBackground = true; |
73 | compileThread.Start(); | 64 | compileThread.Start(); |
74 | return true; | 65 | |
75 | } | 66 | } |
76 | 67 | ||
77 | public string GetName() | 68 | public string getName() |
78 | { | 69 | { |
79 | return "OpenSimJVM"; | 70 | return "JVM Scripting Engine"; |
80 | } | 71 | } |
81 | 72 | ||
82 | public void LoadScript(string script, string scriptName, uint entityID) | 73 | public void LoadScript(string script) |
83 | { | 74 | { |
84 | Console.WriteLine("OpenSimJVM - loading new script: " + scriptName); | 75 | Console.WriteLine("OpenSimJVM - loading new script: " + script); |
85 | CompileInfo comp = new CompileInfo(); | 76 | CompileInfo comp = new CompileInfo(); |
86 | comp.entityId = entityID; | ||
87 | comp.script = script; | 77 | comp.script = script; |
88 | comp.scriptName = scriptName; | 78 | comp.scriptName = script; |
89 | this.CompileScripts.Enqueue(comp); | 79 | this.CompileScripts.Enqueue(comp); |
90 | } | 80 | } |
91 | 81 | ||
@@ -96,7 +86,6 @@ namespace OpenSim.Scripting.EmbeddedJVM | |||
96 | CompileInfo comp = this.CompileScripts.Dequeue(); | 86 | CompileInfo comp = this.CompileScripts.Dequeue(); |
97 | string script = comp.script; | 87 | string script = comp.script; |
98 | string scriptName = comp.scriptName; | 88 | string scriptName = comp.scriptName; |
99 | uint entityID = comp.entityId; | ||
100 | try | 89 | try |
101 | { | 90 | { |
102 | //need to compile the script into a java class file | 91 | //need to compile the script into a java class file |
@@ -127,7 +116,6 @@ namespace OpenSim.Scripting.EmbeddedJVM | |||
127 | 116 | ||
128 | Thread newThread = new Thread(); | 117 | Thread newThread = new Thread(); |
129 | this._threads.Add(newThread); | 118 | this._threads.Add(newThread); |
130 | newThread.EntityId = entityID; | ||
131 | newThread.currentClass = class1; | 119 | newThread.currentClass = class1; |
132 | newThread.scriptInfo = scriptInfo; | 120 | newThread.scriptInfo = scriptInfo; |
133 | 121 | ||
@@ -165,7 +153,6 @@ namespace OpenSim.Scripting.EmbeddedJVM | |||
165 | { | 153 | { |
166 | public string script; | 154 | public string script; |
167 | public string scriptName; | 155 | public string scriptName; |
168 | public uint entityId; | ||
169 | 156 | ||
170 | public CompileInfo() | 157 | public CompileInfo() |
171 | { | 158 | { |