aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-21 21:47:00 +0000
committerMelanie Thielker2008-09-21 21:47:00 +0000
commit94aaf67dfaafbcbd4d871f674c465a34c1c1f332 (patch)
tree33476e5660a95bdf7d29d14beae67a6294af28a7 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
parent* minor: warnings removal (diff)
downloadopensim-SC-94aaf67dfaafbcbd4d871f674c465a34c1c1f332.zip
opensim-SC-94aaf67dfaafbcbd4d871f674c465a34c1c1f332.tar.gz
opensim-SC-94aaf67dfaafbcbd4d871f674c465a34c1c1f332.tar.bz2
opensim-SC-94aaf67dfaafbcbd4d871f674c465a34c1c1f332.tar.xz
Change the scirpt engine loading mechanism. Script engines are now
ordinary region modules and are able to coexist in one instance. See http://opensimulator.org/wiki/ScriptEngines for details. There were changes to OpenSim.ini.example, please note DefaultScriptEngine. Also see the User docs and FAQ on the Wiki. Default is DotNetEngine.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs50
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);