aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
index 88b6091..d4facdd 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Reflection;
29using System.Collections; 30using System.Collections;
30using System.Collections.Generic; 31using System.Collections.Generic;
31using System.Runtime.Remoting.Lifetime; 32using System.Runtime.Remoting.Lifetime;
@@ -59,6 +60,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
59 internal uint m_localID; 60 internal uint m_localID;
60 internal UUID m_itemID; 61 internal UUID m_itemID;
61 internal bool m_MODFunctionsEnabled = false; 62 internal bool m_MODFunctionsEnabled = false;
63 internal IScriptModuleComms m_comms = null;
62 64
63 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) 65 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
64 { 66 {
@@ -69,6 +71,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
69 71
70 if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false)) 72 if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false))
71 m_MODFunctionsEnabled = true; 73 m_MODFunctionsEnabled = true;
74
75 m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>();
76 if (m_comms == null)
77 m_MODFunctionsEnabled = false;
72 } 78 }
73 79
74 public override Object InitializeLifetimeService() 80 public override Object InitializeLifetimeService()
@@ -110,12 +116,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
110 wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message); 116 wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
111 } 117 }
112 118
113 public string modSendCommand(string modules, string command, string k) 119 public string modSendCommand(string module, string command, string k)
114 { 120 {
115 if (!m_MODFunctionsEnabled) 121 if (!m_MODFunctionsEnabled)
116 return ""; 122 {
123 MODShoutError("Module command functions not enabled");
124 return UUID.Zero.ToString();;
125 }
126
127 UUID req = UUID.Random();
128
129 m_comms.RaiseEvent(m_itemID, req.ToString(), module, command, k);
117 130
118 return ""; 131 return req.ToString();
119 } 132 }
120 } 133 }
121} 134}