From 79dc1a4f7d4196d14bd51cb0839b9dd8c644cab7 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Mon, 13 Aug 2007 20:55:07 +0000 Subject: Common script for all objects (Default.lsl). ScriptEngine touch_start event now works, but llSay only outputs to server console. --- .../ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | 2 +- .../DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 2 +- .../DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 2c514fc..6fe111f 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs @@ -18,7 +18,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL // Output assembly name - string OutFile = Path.GetFileNameWithoutExtension(LSOFileName) + ".dll"; + string OutFile = Path.Combine("ScriptEngines", Path.GetFileNameWithoutExtension(LSOFileName) + ".dll"); Common.SendToDebug("Reading source code into memory"); // TODO: Add error handling diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 6b0afa9..5c5ac92 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs @@ -162,7 +162,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL // void dataserver(key query_id, string data) { //cache = Regex.Replace(cache, @"([^a-zA-Z_]\s*)((?!if|switch|for)[a-zA-Z_]+\s*\([^\)]*\)[^{]*{)", "$1" + "" + "$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); //Console.WriteLine("Replacing using statename: " + current_statename); - cache = Regex.Replace(cache, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1" + current_statename + "_$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); + cache = Regex.Replace(cache, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"public $1" + current_statename + "_event_$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); } ret += cache; diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index 5c67ffe..5fa25fb 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs @@ -7,7 +7,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL { public class LSL_BaseClass : LSL_BuiltIn_Commands_Interface { - public UInt32 State = 0; + public string State = "default"; internal OpenSim.Region.Environment.Scenes.Scene World; public void Start(OpenSim.Region.Environment.Scenes.Scene _World, string FullScriptID) @@ -46,17 +46,18 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL public Axiom.Math.Vector3 llRot2Left(Axiom.Math.Quaternion r) { return new Axiom.Math.Vector3(); } public Axiom.Math.Vector3 llRot2Up(Axiom.Math.Quaternion r) { return new Axiom.Math.Vector3(); } public Axiom.Math.Quaternion llRotBetween(Axiom.Math.Vector3 start, Axiom.Math.Vector3 end) { return new Axiom.Math.Quaternion(); } - public void llWhisper(UInt16 channelID, string text) + public void llWhisper(int channelID, string text) { - Common.SendToDebug("INTERNAL FUNCTION llWhisper(" + channelID + ", \"" + text + "\");"); - Common.SendToLog("llWhisper Channel " + channelID + ", Text: \"" + text + "\""); + //Common.SendToDebug("INTERNAL FUNCTION llWhisper(" + channelID + ", \"" + text + "\");"); + Console.WriteLine("llWhisper Channel " + channelID + ", Text: \"" + text + "\""); } //public void llSay(UInt32 channelID, string text) - public void llSay(object channelID, object text) + public void llSay(int channelID, string text) { //TODO: DO SOMETHING USEFUL HERE - Common.SendToDebug("INTERNAL FUNCTION llSay(" + (UInt32)channelID + ", \"" + (string)text + "\");"); - Common.SendToLog("llSay Channel " + (UInt32)channelID + ", Text: \"" + (string)text + "\""); + //Common.SendToDebug("INTERNAL FUNCTION llSay(" + (UInt32)channelID + ", \"" + (string)text + "\");"); + Console.WriteLine("llSay Channel " + channelID + ", Text: \"" + text + "\""); + //World.SimChat( } public void llShout(UInt16 channelID, string text) { return; } public UInt32 llListen(UInt16 channelID, string name, string ID, string msg) { return 0; } -- cgit v1.1