aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Scripting.EmbeddedJVM
diff options
context:
space:
mode:
authorMW2007-04-11 12:13:21 +0000
committerMW2007-04-11 12:13:21 +0000
commit5ad6d5a939fb7bf0fdfdc6925d4afed306e08641 (patch)
tree8bcf302b69297a27ab254d087f73fe88fecab464 /OpenSim.Scripting.EmbeddedJVM
parentChanged so that a bin\ScriptEngines\ directory will be searched for scripting... (diff)
downloadopensim-SC_OLD-5ad6d5a939fb7bf0fdfdc6925d4afed306e08641.zip
opensim-SC_OLD-5ad6d5a939fb7bf0fdfdc6925d4afed306e08641.tar.gz
opensim-SC_OLD-5ad6d5a939fb7bf0fdfdc6925d4afed306e08641.tar.bz2
opensim-SC_OLD-5ad6d5a939fb7bf0fdfdc6925d4afed306e08641.tar.xz
First basic test script now works in the jvm scripting engine.
For it to work you need to have a java sdk installed and the javac.exe somewhere in the environment Path variable. Then To test, copy the text from bin/script1.text into a note card and then add that note to a prim.
Diffstat (limited to 'OpenSim.Scripting.EmbeddedJVM')
-rw-r--r--OpenSim.Scripting.EmbeddedJVM/Interpreter.cs3
-rw-r--r--OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs4
-rw-r--r--OpenSim.Scripting.EmbeddedJVM/InterpreterMethods.cs3
-rw-r--r--OpenSim.Scripting.EmbeddedJVM/OpenSimJVM.cs7
4 files changed, 11 insertions, 6 deletions
diff --git a/OpenSim.Scripting.EmbeddedJVM/Interpreter.cs b/OpenSim.Scripting.EmbeddedJVM/Interpreter.cs
index aeeee0a..b94248c 100644
--- a/OpenSim.Scripting.EmbeddedJVM/Interpreter.cs
+++ b/OpenSim.Scripting.EmbeddedJVM/Interpreter.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Scripting.EmbeddedJVM
49 else 49 else
50 { 50 {
51 // Console.WriteLine("No parent function so ending program"); 51 // Console.WriteLine("No parent function so ending program");
52 this._mThread.stack.StackFrames.Pop();
52 run = false; 53 run = false;
53 } 54 }
54 handled = true; 55 handled = true;
@@ -71,6 +72,7 @@ namespace OpenSim.Scripting.EmbeddedJVM
71 else 72 else
72 { 73 {
73 // Console.WriteLine("No parent function so ending program"); 74 // Console.WriteLine("No parent function so ending program");
75 this._mThread.stack.StackFrames.Pop();
74 run = false; 76 run = false;
75 } 77 }
76 handled = true; 78 handled = true;
@@ -88,6 +90,7 @@ namespace OpenSim.Scripting.EmbeddedJVM
88 else 90 else
89 { 91 {
90 // Console.WriteLine("No parent function so ending program"); 92 // Console.WriteLine("No parent function so ending program");
93 this._mThread.stack.StackFrames.Pop();
91 run = false; 94 run = false;
92 } 95 }
93 handled = true; 96 handled = true;
diff --git a/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs b/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs
index 673970a..8c895af 100644
--- a/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs
+++ b/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs
@@ -274,11 +274,11 @@ namespace OpenSim.Scripting.EmbeddedJVM
274 if (flcom1 is Float && flcom2 is Float) 274 if (flcom1 is Float && flcom2 is Float)
275 { 275 {
276 Int compres = new Int(); 276 Int compres = new Int();
277 if (((Float)flcom1).mValue > ((Float)flcom2).mValue) 277 if (((Float)flcom1).mValue < ((Float)flcom2).mValue)
278 { 278 {
279 compres.mValue = -1; 279 compres.mValue = -1;
280 } 280 }
281 else if (((Float)flcom1).mValue < ((Float)flcom2).mValue) 281 else if (((Float)flcom1).mValue > ((Float)flcom2).mValue)
282 { 282 {
283 compres.mValue = 1; 283 compres.mValue = 1;
284 } 284 }
diff --git a/OpenSim.Scripting.EmbeddedJVM/InterpreterMethods.cs b/OpenSim.Scripting.EmbeddedJVM/InterpreterMethods.cs
index e025293..dc3402e 100644
--- a/OpenSim.Scripting.EmbeddedJVM/InterpreterMethods.cs
+++ b/OpenSim.Scripting.EmbeddedJVM/InterpreterMethods.cs
@@ -71,11 +71,12 @@ namespace OpenSim.Scripting.EmbeddedJVM
71 BaseType bs1 = this._mThread.currentFrame.OpStack.Pop(); 71 BaseType bs1 = this._mThread.currentFrame.OpStack.Pop();
72 if (bs1 is Int) 72 if (bs1 is Int)
73 { 73 {
74 Console.WriteLine("get entity pos for " + ((Int)bs1).mValue); 74 //Console.WriteLine("get entity pos for " + ((Int)bs1).mValue);
75 //should get the position of the entity from the IScriptAPI 75 //should get the position of the entity from the IScriptAPI
76 OSVector3 vec3 = Thread.OpenSimScriptAPI.GetEntityPosition((uint)((Int)bs1).mValue); 76 OSVector3 vec3 = Thread.OpenSimScriptAPI.GetEntityPosition((uint)((Int)bs1).mValue);
77 Float pos = new Float(); 77 Float pos = new Float();
78 pos.mValue = vec3.X; 78 pos.mValue = vec3.X;
79 // Console.WriteLine("returned x value " + vec3.X.ToString());
79 this._mThread.currentFrame.OpStack.Push(pos); 80 this._mThread.currentFrame.OpStack.Push(pos);
80 } 81 }
81 this._mThread.PC += 2; 82 this._mThread.PC += 2;
diff --git a/OpenSim.Scripting.EmbeddedJVM/OpenSimJVM.cs b/OpenSim.Scripting.EmbeddedJVM/OpenSimJVM.cs
index 77a92e5..b47bb50 100644
--- a/OpenSim.Scripting.EmbeddedJVM/OpenSimJVM.cs
+++ b/OpenSim.Scripting.EmbeddedJVM/OpenSimJVM.cs
@@ -66,10 +66,11 @@ namespace OpenSim.Scripting.EmbeddedJVM
66 tw.Close(); 66 tw.Close();
67 67
68 //now compile 68 //now compile
69 System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(@"C:\Program Files\Java\jdk1.6.0_01\bin\javac.exe", "*.java"); 69 System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("javac.exe", "*.java");
70 psi.RedirectStandardOutput = true; 70 // psi.RedirectStandardOutput = true;
71 psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; 71 psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
72 psi.UseShellExecute = false; 72 psi.UseShellExecute = false;
73
73 System.Diagnostics.Process javacomp; 74 System.Diagnostics.Process javacomp;
74 javacomp = System.Diagnostics.Process.Start(psi); 75 javacomp = System.Diagnostics.Process.Start(psi);
75 javacomp.WaitForExit(); 76 javacomp.WaitForExit();
@@ -91,7 +92,7 @@ namespace OpenSim.Scripting.EmbeddedJVM
91 //now delete the created files 92 //now delete the created files
92 System.IO.File.Delete(scriptName + ".java"); 93 System.IO.File.Delete(scriptName + ".java");
93 System.IO.File.Delete(scriptName + ".class"); 94 System.IO.File.Delete(scriptName + ".class");
94 this.OnFrame(); 95 //this.OnFrame();
95 } 96 }
96 catch (Exception e) 97 catch (Exception e)
97 { 98 {