diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index 5a9385f..4a4e808 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -65,31 +65,36 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
65 | myScriptEngine = _ScriptEngine; | 65 | myScriptEngine = _ScriptEngine; |
66 | ReadConfig(); | 66 | ReadConfig(); |
67 | 67 | ||
68 | // Hook up to events from OpenSim | ||
69 | // We may not want to do it because someone is controlling us and will deliver events to us | ||
70 | if (performHookUp) | 68 | if (performHookUp) |
71 | { | 69 | { |
72 | myScriptEngine.Log.Info("[" + myScriptEngine.ScriptEngineName + "]: Hooking up to server events"); | ||
73 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | ||
74 | myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end; | ||
75 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | 70 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; |
76 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | 71 | } |
77 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; | 72 | } |
78 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; | 73 | |
79 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; | 74 | public void HookUpEvents() |
80 | myScriptEngine.World.EventManager.OnScriptControlEvent += control; | 75 | { |
81 | myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; | 76 | // Hook up to events from OpenSim |
82 | myScriptEngine.World.EventManager.OnScriptColliding += collision; | 77 | // We may not want to do it because someone is controlling us and will deliver events to us |
83 | myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; | ||
84 | |||
85 | // TODO: HOOK ALL EVENTS UP TO SERVER! | ||
86 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); | ||
87 | if (money != null) | ||
88 | { | ||
89 | money.OnObjectPaid+=HandleObjectPaid; | ||
90 | } | ||
91 | 78 | ||
79 | myScriptEngine.Log.Info("[" + myScriptEngine.ScriptEngineName + "]: Hooking up to server events"); | ||
80 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | ||
81 | myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end; | ||
82 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | ||
83 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; | ||
84 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; | ||
85 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; | ||
86 | myScriptEngine.World.EventManager.OnScriptControlEvent += control; | ||
87 | myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; | ||
88 | myScriptEngine.World.EventManager.OnScriptColliding += collision; | ||
89 | myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; | ||
90 | |||
91 | // TODO: HOOK ALL EVENTS UP TO SERVER! | ||
92 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); | ||
93 | if (money != null) | ||
94 | { | ||
95 | money.OnObjectPaid+=HandleObjectPaid; | ||
92 | } | 96 | } |
97 | |||
93 | } | 98 | } |
94 | 99 | ||
95 | public void ReadConfig() | 100 | public void ReadConfig() |
@@ -187,8 +192,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
187 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); | 192 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); |
188 | } | 193 | } |
189 | 194 | ||
190 | public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez) | 195 | public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine) |
191 | { | 196 | { |
197 | if (engine != "DotNetEngine") | ||
198 | return; | ||
199 | |||
192 | myScriptEngine.Log.Debug("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + | 200 | myScriptEngine.Log.Debug("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + |
193 | script.Length); | 201 | script.Length); |
194 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script, startParam, postOnRez); | 202 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script, startParam, postOnRez); |