diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
3 files changed, 27 insertions, 20 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index e01d2e4..5eb3c5c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -284,22 +284,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
284 | // Remove from: Timers | 284 | // Remove from: Timers |
285 | m_Timer[engine].UnSetTimerEvents(localID, itemID); | 285 | m_Timer[engine].UnSetTimerEvents(localID, itemID); |
286 | 286 | ||
287 | // Remove from: HttpRequest | 287 | if(engine.World != null) |
288 | IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface<IHttpRequestModule>(); | 288 | { |
289 | if (iHttpReq != null) | 289 | // Remove from: HttpRequest |
290 | iHttpReq.StopHttpRequest(localID, itemID); | 290 | IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface<IHttpRequestModule>(); |
291 | if (iHttpReq != null) | ||
292 | iHttpReq.StopHttpRequest(localID, itemID); | ||
291 | 293 | ||
292 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); | 294 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); |
293 | if (comms != null) | 295 | if (comms != null) |
294 | comms.DeleteListener(itemID); | 296 | comms.DeleteListener(itemID); |
295 | 297 | ||
296 | IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); | 298 | IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); |
297 | if (xmlrpc != null) | 299 | if (xmlrpc != null) |
298 | { | 300 | { |
299 | xmlrpc.DeleteChannels(itemID); | 301 | xmlrpc.DeleteChannels(itemID); |
300 | xmlrpc.CancelSRDRequests(itemID); | 302 | xmlrpc.CancelSRDRequests(itemID); |
303 | } | ||
301 | } | 304 | } |
302 | |||
303 | // Remove Sensors | 305 | // Remove Sensors |
304 | m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); | 306 | m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); |
305 | } | 307 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d36d9a0..3f72e6a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -16965,7 +16965,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
16965 | default: | 16965 | default: |
16966 | if (c < ' ') | 16966 | if (c < ' ') |
16967 | { | 16967 | { |
16968 | t = "000" + String.Format("X", c); | 16968 | t = "000" + String.Format("{0:X}", c); |
16969 | sb.Append("\\u" + t.Substring(t.Length - 4)); | 16969 | sb.Append("\\u" + t.Substring(t.Length - 4)); |
16970 | } | 16970 | } |
16971 | else | 16971 | else |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6e28fe0..e156582 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -144,6 +144,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
144 | internal bool m_debuggerSafe = false; | 144 | internal bool m_debuggerSafe = false; |
145 | internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); | 145 | internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); |
146 | protected IUrlModule m_UrlModule = null; | 146 | protected IUrlModule m_UrlModule = null; |
147 | internal IConfig m_osslconfig; | ||
147 | 148 | ||
148 | public void Initialize( | 149 | public void Initialize( |
149 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) | 150 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) |
@@ -151,11 +152,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
151 | m_ScriptEngine = scriptEngine; | 152 | m_ScriptEngine = scriptEngine; |
152 | m_host = host; | 153 | m_host = host; |
153 | m_item = item; | 154 | m_item = item; |
155 | |||
156 | m_osslconfig = m_ScriptEngine.ConfigSource.Configs["OSSL"]; | ||
157 | if(m_osslconfig == null) | ||
158 | m_osslconfig = m_ScriptEngine.Config; | ||
159 | |||
154 | m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false); | 160 | m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false); |
155 | 161 | ||
156 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); | 162 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); |
157 | 163 | if (m_osslconfig.GetBoolean("AllowOSFunctions", false)) | |
158 | if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false)) | ||
159 | { | 164 | { |
160 | m_OSFunctionsEnabled = true; | 165 | m_OSFunctionsEnabled = true; |
161 | // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); | 166 | // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); |
@@ -166,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
166 | m_ScriptDistanceFactor = | 171 | m_ScriptDistanceFactor = |
167 | m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); | 172 | m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); |
168 | 173 | ||
169 | string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow"); | 174 | string risk = m_osslconfig.GetString("OSFunctionThreatLevel", "VeryLow"); |
170 | switch (risk) | 175 | switch (risk) |
171 | { | 176 | { |
172 | case "NoAccess": | 177 | case "NoAccess": |
@@ -266,7 +271,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
266 | { | 271 | { |
267 | m_host.AddScriptLPS(1); | 272 | m_host.AddScriptLPS(1); |
268 | if (!m_OSFunctionsEnabled) | 273 | if (!m_OSFunctionsEnabled) |
269 | OSSLError(String.Format("{0} permission denied. All OS functions are disabled.")); // throws | 274 | OSSLError("permission denied. All OS functions are disabled."); // throws |
270 | } | 275 | } |
271 | 276 | ||
272 | // Returns if the function is allowed. Throws a script exception if not allowed. | 277 | // Returns if the function is allowed. Throws a script exception if not allowed. |
@@ -292,8 +297,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
292 | FunctionPerms perms = new FunctionPerms(); | 297 | FunctionPerms perms = new FunctionPerms(); |
293 | m_FunctionPerms[function] = perms; | 298 | m_FunctionPerms[function] = perms; |
294 | 299 | ||
295 | string ownerPerm = m_ScriptEngine.Config.GetString("Allow_" + function, ""); | 300 | string ownerPerm = m_osslconfig.GetString("Allow_" + function, ""); |
296 | string creatorPerm = m_ScriptEngine.Config.GetString("Creators_" + function, ""); | 301 | string creatorPerm = m_osslconfig.GetString("Creators_" + function, ""); |
297 | if (ownerPerm == "" && creatorPerm == "") | 302 | if (ownerPerm == "" && creatorPerm == "") |
298 | { | 303 | { |
299 | // Default behavior | 304 | // Default behavior |