diff options
author | lbsa71 | 2007-08-16 17:08:03 +0000 |
---|---|---|
committer | lbsa71 | 2007-08-16 17:08:03 +0000 |
commit | 25fd8d02738e61e81f93ac784b02ab84697ee528 (patch) | |
tree | db1dda71b3aa86770fa90ae84d4ac361a6fd84c7 /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler | |
parent | Deleted old inventoryCache.cs (diff) | |
download | opensim-SC_OLD-25fd8d02738e61e81f93ac784b02ab84697ee528.zip opensim-SC_OLD-25fd8d02738e61e81f93ac784b02ab84697ee528.tar.gz opensim-SC_OLD-25fd8d02738e61e81f93ac784b02ab84697ee528.tar.bz2 opensim-SC_OLD-25fd8d02738e61e81f93ac784b02ab84697ee528.tar.xz |
* Introduced IScriptHost as an interface to fetching object data from scripts.
* This meant introducing AbsolutePosition on all objects (since SimChat wants that)
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | 23 |
2 files changed, 21 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 13e3f2e..eea2094 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -229,6 +229,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
229 | // Add namespace, class name and inheritance | 229 | // Add namespace, class name and inheritance |
230 | Return = "namespace SecondLife {\r\n"; | 230 | Return = "namespace SecondLife {\r\n"; |
231 | Return += "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass {\r\n"; | 231 | Return += "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass {\r\n"; |
232 | Return += "public Script( OpenSim.Region.Environment.Scenes.Scripting.IScriptHost host ) : base( host ) { }\r\n"; | ||
232 | Return += Script; | 233 | Return += Script; |
233 | Return += "} }\r\n"; | 234 | Return += "} }\r\n"; |
234 | 235 | ||
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index 062060f..565bfb7 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | |||
@@ -2,6 +2,10 @@ using System; | |||
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; | 4 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; |
5 | using libsecondlife; | ||
6 | using OpenSim.Region.Environment.Scenes; | ||
7 | using OpenSim.Region.Environment.Scenes.Scripting; | ||
8 | using OpenSim.Framework.Console; | ||
5 | 9 | ||
6 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | 10 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL |
7 | { | 11 | { |
@@ -11,11 +15,17 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
11 | internal OpenSim.Region.Environment.Scenes.Scene World; | 15 | internal OpenSim.Region.Environment.Scenes.Scene World; |
12 | private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); | 16 | private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); |
13 | 17 | ||
14 | 18 | IScriptHost m_host; | |
19 | |||
20 | public LSL_BaseClass( IScriptHost host ) | ||
21 | { | ||
22 | m_host = host; | ||
23 | } | ||
24 | |||
15 | public void Start(OpenSim.Region.Environment.Scenes.Scene _World, string FullScriptID) | 25 | public void Start(OpenSim.Region.Environment.Scenes.Scene _World, string FullScriptID) |
16 | { | 26 | { |
17 | World = _World; | 27 | World = _World; |
18 | Console.WriteLine("ScriptEngine", "LSL_BaseClass.Start() called. FullScriptID: " + FullScriptID); | 28 | MainLog.Instance.Notice( "ScriptEngine", "LSL_BaseClass.Start() called. FullScriptID: " + FullScriptID + ": Hosted by [" + m_host.Name + ":" + m_host.UUID + "@"+m_host.AbsolutePosition +"]"); |
19 | 29 | ||
20 | return; | 30 | return; |
21 | } | 31 | } |
@@ -59,8 +69,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
59 | //Common.SendToDebug("INTERNAL FUNCTION llSay(" + (int)channelID + ", \"" + (string)text + "\");"); | 69 | //Common.SendToDebug("INTERNAL FUNCTION llSay(" + (int)channelID + ", \"" + (string)text + "\");"); |
60 | Console.WriteLine("llSay Channel " + channelID + ", Text: \"" + text + "\""); | 70 | Console.WriteLine("llSay Channel " + channelID + ", Text: \"" + text + "\""); |
61 | //type for say is 1 | 71 | //type for say is 1 |
62 | //World.SimChat(enc.GetBytes(text), 1, World.Objects[World.ConvertLocalIDToFullID(MY_OBJECT_ID)], MY_OBJECT_NAME, World.Objects[World.ConvertLocalIDToFullID(MY_OBJECT_ID)]); | 72 | |
73 | LLVector3 fromPos = m_host.AbsolutePosition; // Position of parent | ||
74 | string fromName = m_host.Name; // Name of script parent | ||
75 | LLUUID fromUUID = m_host.UUID; // UUID of parent | ||
76 | |||
77 | World.SimChat( Helpers.StringToField( text ), 1, fromPos, fromName, fromUUID ); | ||
63 | } | 78 | } |
79 | |||
64 | public void llShout(int channelID, string text) | 80 | public void llShout(int channelID, string text) |
65 | { | 81 | { |
66 | Console.WriteLine("llShout Channel " + channelID + ", Text: \"" + text + "\""); | 82 | Console.WriteLine("llShout Channel " + channelID + ", Text: \"" + text + "\""); |
@@ -68,6 +84,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
68 | //World.SimChat(enc.GetBytes(text), 2, World.Objects[World.ConvertLocalIDToFullID(MY_OBJECT_ID)], MY_OBJECT_NAME, World.Objects[World.ConvertLocalIDToFullID(MY_OBJECT_ID)]); | 84 | //World.SimChat(enc.GetBytes(text), 2, World.Objects[World.ConvertLocalIDToFullID(MY_OBJECT_ID)], MY_OBJECT_NAME, World.Objects[World.ConvertLocalIDToFullID(MY_OBJECT_ID)]); |
69 | 85 | ||
70 | } | 86 | } |
87 | |||
71 | public int llListen(int channelID, string name, string ID, string msg) { return 0; } | 88 | public int llListen(int channelID, string name, string ID, string msg) { return 0; } |
72 | public void llListenControl(int number, int active) { return; } | 89 | public void llListenControl(int number, int active) { return; } |
73 | public void llListenRemove(int number) { return; } | 90 | public void llListenRemove(int number) { return; } |