diff options
author | Tedd Hansen | 2007-08-22 18:09:38 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-08-22 18:09:38 +0000 |
commit | 5a86fd2c31ce0ede9825657c969ccaa1ef423d5c (patch) | |
tree | 66e62accbaf1b20242b82920537d40d156f0bf00 /OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | |
parent | Added Scene.GetSceneObjectPart(uint localID) (diff) | |
download | opensim-SC_OLD-5a86fd2c31ce0ede9825657c969ccaa1ef423d5c.zip opensim-SC_OLD-5a86fd2c31ce0ede9825657c969ccaa1ef423d5c.tar.gz opensim-SC_OLD-5a86fd2c31ce0ede9825657c969ccaa1ef423d5c.tar.bz2 opensim-SC_OLD-5a86fd2c31ce0ede9825657c969ccaa1ef423d5c.tar.xz |
(Untested) Scripts are individually loaded into objects (on rez), and event fired likewise. Bugfixes coming in next commit.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index 32353ce..92afcf3 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
42 | class EventManager | 42 | class EventManager |
43 | { | 43 | { |
44 | private ScriptEngine myScriptEngine; | 44 | private ScriptEngine myScriptEngine; |
45 | public IScriptHost TEMP_OBJECT_ID; | 45 | //public IScriptHost TEMP_OBJECT_ID; |
46 | public EventManager(ScriptEngine _ScriptEngine) | 46 | public EventManager(ScriptEngine _ScriptEngine) |
47 | { | 47 | { |
48 | myScriptEngine = _ScriptEngine; | 48 | myScriptEngine = _ScriptEngine; |
@@ -51,19 +51,47 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
51 | // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager | 51 | // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager |
52 | 52 | ||
53 | // Hook up a test event to our test form | 53 | // Hook up a test event to our test form |
54 | myScriptEngine.Log.Verbose("ScriptEngine", "EventManager Hooking up dummy-event: touch_start"); | 54 | //myScriptEngine.Log.Verbose("ScriptEngine", "EventManager Hooking up to server events"); |
55 | // TODO: REPLACE THIS WITH A REAL TOUCH_START EVENT IN SERVER | ||
56 | myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); | 55 | myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); |
57 | //myScriptEngine.World.touch_start += new TempWorldInterfaceEventDelegates.touch_start(touch_start); | 56 | myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript); |
57 | |||
58 | } | 58 | } |
59 | 59 | ||
60 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 60 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
61 | { | 61 | { |
62 | // Add to queue for all scripts in ObjectID object | 62 | // Add to queue for all scripts in ObjectID object |
63 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); | 63 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); |
64 | myScriptEngine.myEventQueueManager.AddToObjectQueue(TEMP_OBJECT_ID, "touch_start", new object[] { (int)0 }); | 64 | myScriptEngine.myEventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] { (int)1 }); |
65 | } | 65 | } |
66 | public void OnRezScript(uint localID, LLUUID itemID, string script) | ||
67 | { | ||
68 | // TODO: Add code to compile script and wire up script to object | ||
69 | // Either the script is a stand-alone entity with a reference to public host, | ||
70 | // Or the host has a reference to the script because it was in its inventory. | ||
66 | 71 | ||
72 | //myScriptEngine.myScriptManager.StartScript( | ||
73 | // Path.Combine("ScriptEngines", "Default.lsl"), | ||
74 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() | ||
75 | //); | ||
76 | myScriptEngine.myScriptManager.StartScript( | ||
77 | localID, | ||
78 | itemID, | ||
79 | script | ||
80 | ); | ||
81 | |||
82 | } | ||
83 | public void OnDeRezScript(uint localID, LLUUID itemID) | ||
84 | { | ||
85 | //myScriptEngine.myScriptManager.StartScript( | ||
86 | // Path.Combine("ScriptEngines", "Default.lsl"), | ||
87 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() | ||
88 | //); | ||
89 | myScriptEngine.myScriptManager.StopScript( | ||
90 | localID, | ||
91 | itemID | ||
92 | ); | ||
93 | |||
94 | } | ||
67 | 95 | ||
68 | // TODO: Replace placeholders below | 96 | // TODO: Replace placeholders below |
69 | // These needs to be hooked up to OpenSim during init of this class | 97 | // These needs to be hooked up to OpenSim during init of this class |