diff options
author | David Rowe | 2014-01-24 15:44:12 -0800 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-01-31 00:21:22 +0000 |
commit | 13bb9ea6826f9141704c1baf9f2366ae38c06245 (patch) | |
tree | c52bb5aef46fe8a0eca9fb10e95794688baff602 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | Updated methods for handling LSL script errors, deprecated, and not implemented (diff) | |
download | opensim-SC_OLD-13bb9ea6826f9141704c1baf9f2366ae38c06245.zip opensim-SC_OLD-13bb9ea6826f9141704c1baf9f2366ae38c06245.tar.gz opensim-SC_OLD-13bb9ea6826f9141704c1baf9f2366ae38c06245.tar.bz2 opensim-SC_OLD-13bb9ea6826f9141704c1baf9f2366ae38c06245.tar.xz |
Updated ShoutError() calls to use new LSL error methods
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 65 |
1 files changed, 27 insertions, 38 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1aa094b..f56010a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
261 | if ((item = GetScriptByName(name)) != UUID.Zero) | 261 | if ((item = GetScriptByName(name)) != UUID.Zero) |
262 | m_ScriptEngine.ResetScript(item); | 262 | m_ScriptEngine.ResetScript(item); |
263 | else | 263 | else |
264 | ShoutError("llResetOtherScript: script "+name+" not found"); | 264 | Error("llResetOtherScript", "Script " + name + " not found"); |
265 | } | 265 | } |
266 | 266 | ||
267 | public LSL_Integer llGetScriptState(string name) | 267 | public LSL_Integer llGetScriptState(string name) |
@@ -275,7 +275,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
275 | return m_ScriptEngine.GetScriptState(item) ?1:0; | 275 | return m_ScriptEngine.GetScriptState(item) ?1:0; |
276 | } | 276 | } |
277 | 277 | ||
278 | ShoutError("llGetScriptState: script "+name+" not found"); | 278 | Error("llGetScriptState", "Script " + name + " not found"); |
279 | 279 | ||
280 | // If we didn't find it, then it's safe to | 280 | // If we didn't find it, then it's safe to |
281 | // assume it is not running. | 281 | // assume it is not running. |
@@ -298,7 +298,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
298 | } | 298 | } |
299 | else | 299 | else |
300 | { | 300 | { |
301 | ShoutError("llSetScriptState: script "+name+" not found"); | 301 | Error("llSetScriptState", "Script " + name + " not found"); |
302 | } | 302 | } |
303 | } | 303 | } |
304 | 304 | ||
@@ -3320,7 +3320,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3320 | IEmailModule emailModule = m_ScriptEngine.World.RequestModuleInterface<IEmailModule>(); | 3320 | IEmailModule emailModule = m_ScriptEngine.World.RequestModuleInterface<IEmailModule>(); |
3321 | if (emailModule == null) | 3321 | if (emailModule == null) |
3322 | { | 3322 | { |
3323 | ShoutError("llEmail: email module not configured"); | 3323 | Error("llEmail", "Email module not configured"); |
3324 | return; | 3324 | return; |
3325 | } | 3325 | } |
3326 | 3326 | ||
@@ -3334,7 +3334,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3334 | IEmailModule emailModule = m_ScriptEngine.World.RequestModuleInterface<IEmailModule>(); | 3334 | IEmailModule emailModule = m_ScriptEngine.World.RequestModuleInterface<IEmailModule>(); |
3335 | if (emailModule == null) | 3335 | if (emailModule == null) |
3336 | { | 3336 | { |
3337 | ShoutError("llGetNextEmail: email module not configured"); | 3337 | Error("llGetNextEmail", "Email module not configured"); |
3338 | return; | 3338 | return; |
3339 | } | 3339 | } |
3340 | Email email; | 3340 | Email email; |
@@ -3734,7 +3734,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3734 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 | 3734 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 |
3735 | && !m_automaticLinkPermission) | 3735 | && !m_automaticLinkPermission) |
3736 | { | 3736 | { |
3737 | ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); | 3737 | Error("llCreateLink", "PERMISSION_CHANGE_LINKS permission not set"); |
3738 | return; | 3738 | return; |
3739 | } | 3739 | } |
3740 | 3740 | ||
@@ -3789,7 +3789,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3789 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 | 3789 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 |
3790 | && !m_automaticLinkPermission) | 3790 | && !m_automaticLinkPermission) |
3791 | { | 3791 | { |
3792 | ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); | 3792 | Error("llBreakLink", "PERMISSION_CHANGE_LINKS permission not set"); |
3793 | return; | 3793 | return; |
3794 | } | 3794 | } |
3795 | 3795 | ||
@@ -4403,11 +4403,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4403 | 4403 | ||
4404 | if (message == string.Empty) | 4404 | if (message == string.Empty) |
4405 | { | 4405 | { |
4406 | ShoutError("Trying to use llTextBox with empty message."); | 4406 | Error("llTextBox", "Empty message"); |
4407 | } | 4407 | } |
4408 | else if (message.Length > 512) | 4408 | else if (message.Length > 512) |
4409 | { | 4409 | { |
4410 | ShoutError("Trying to use llTextBox with message over 512 characters."); | 4410 | Error("llTextBox", "Message more than 512 characters"); |
4411 | } | 4411 | } |
4412 | else | 4412 | else |
4413 | { | 4413 | { |
@@ -6861,15 +6861,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6861 | m_host.ParentGroup.ScriptSetVolumeDetect(detect != 0); | 6861 | m_host.ParentGroup.ScriptSetVolumeDetect(detect != 0); |
6862 | } | 6862 | } |
6863 | 6863 | ||
6864 | /// <summary> | ||
6865 | /// This is a depecated function so this just replicates the result of | ||
6866 | /// invoking it in SL | ||
6867 | /// </summary> | ||
6868 | public void llRemoteLoadScript(string target, string name, int running, int start_param) | 6864 | public void llRemoteLoadScript(string target, string name, int running, int start_param) |
6869 | { | 6865 | { |
6870 | m_host.AddScriptLPS(1); | 6866 | m_host.AddScriptLPS(1); |
6871 | // Report an error as it does in SL | 6867 | Deprecated("llRemoteLoadScript", "Use llRemoteLoadScriptPin instead"); |
6872 | ShoutError("Deprecated. Please use llRemoteLoadScriptPin instead."); | ||
6873 | ScriptSleep(3000); | 6868 | ScriptSleep(3000); |
6874 | } | 6869 | } |
6875 | 6870 | ||
@@ -7951,9 +7946,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7951 | } | 7946 | } |
7952 | catch (InvalidCastException e) | 7947 | catch (InvalidCastException e) |
7953 | { | 7948 | { |
7954 | ShoutError(string.Format( | 7949 | Error(originFunc, string.Format("Error running rule #{0}: arg #{1} - ", rulesParsed, idx - idxStart) + e.Message); |
7955 | "{0} error running rule #{1}: arg #{2} ", | ||
7956 | originFunc, rulesParsed, idx - idxStart) + e.Message); | ||
7957 | } | 7950 | } |
7958 | finally | 7951 | finally |
7959 | { | 7952 | { |
@@ -10050,7 +10043,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10050 | presence = World.GetScenePresence(agentID); | 10043 | presence = World.GetScenePresence(agentID); |
10051 | } | 10044 | } |
10052 | } | 10045 | } |
10053 | else ShoutError("The argument of PARCEL_MEDIA_COMMAND_AGENT must be a key"); | 10046 | else Error("llParcelMediaCommandList", "The argument of PARCEL_MEDIA_COMMAND_AGENT must be a key"); |
10054 | ++i; | 10047 | ++i; |
10055 | } | 10048 | } |
10056 | break; | 10049 | break; |
@@ -10081,7 +10074,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10081 | url = (LSL_String)commandList.Data[i + 1]; | 10074 | url = (LSL_String)commandList.Data[i + 1]; |
10082 | update = true; | 10075 | update = true; |
10083 | } | 10076 | } |
10084 | else ShoutError("The argument of PARCEL_MEDIA_COMMAND_URL must be a string."); | 10077 | else Error("llParcelMediaCommandList", "The argument of PARCEL_MEDIA_COMMAND_URL must be a string"); |
10085 | ++i; | 10078 | ++i; |
10086 | } | 10079 | } |
10087 | break; | 10080 | break; |
@@ -10094,7 +10087,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10094 | texture = (LSL_String)commandList.Data[i + 1]; | 10087 | texture = (LSL_String)commandList.Data[i + 1]; |
10095 | update = true; | 10088 | update = true; |
10096 | } | 10089 | } |
10097 | else ShoutError("The argument of PARCEL_MEDIA_COMMAND_TEXTURE must be a string or key."); | 10090 | else Error("llParcelMediaCommandList", "The argument of PARCEL_MEDIA_COMMAND_TEXTURE must be a string or a key"); |
10098 | ++i; | 10091 | ++i; |
10099 | } | 10092 | } |
10100 | break; | 10093 | break; |
@@ -10106,7 +10099,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10106 | { | 10099 | { |
10107 | time = (float)(LSL_Float)commandList.Data[i + 1]; | 10100 | time = (float)(LSL_Float)commandList.Data[i + 1]; |
10108 | } | 10101 | } |
10109 | else ShoutError("The argument of PARCEL_MEDIA_COMMAND_TIME must be a float."); | 10102 | else Error("llParcelMediaCommandList", "The argument of PARCEL_MEDIA_COMMAND_TIME must be a float"); |
10110 | ++i; | 10103 | ++i; |
10111 | } | 10104 | } |
10112 | break; | 10105 | break; |
@@ -10120,7 +10113,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10120 | update = true; | 10113 | update = true; |
10121 | } | 10114 | } |
10122 | 10115 | ||
10123 | else ShoutError("The argument of PARCEL_MEDIA_COMMAND_AUTO_ALIGN must be an integer."); | 10116 | else Error("llParcelMediaCommandList", "The argument of PARCEL_MEDIA_COMMAND_AUTO_ALIGN must be an integer"); |
10124 | ++i; | 10117 | ++i; |
10125 | } | 10118 | } |
10126 | break; | 10119 | break; |
@@ -10133,7 +10126,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10133 | mediaType = (LSL_String)commandList.Data[i + 1]; | 10126 | mediaType = (LSL_String)commandList.Data[i + 1]; |
10134 | update = true; | 10127 | update = true; |
10135 | } | 10128 | } |
10136 | else ShoutError("The argument of PARCEL_MEDIA_COMMAND_TYPE must be a string."); | 10129 | else Error("llParcelMediaCommandList", "The argument of PARCEL_MEDIA_COMMAND_TYPE must be a string"); |
10137 | ++i; | 10130 | ++i; |
10138 | } | 10131 | } |
10139 | break; | 10132 | break; |
@@ -10146,7 +10139,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10146 | description = (LSL_String)commandList.Data[i + 1]; | 10139 | description = (LSL_String)commandList.Data[i + 1]; |
10147 | update = true; | 10140 | update = true; |
10148 | } | 10141 | } |
10149 | else ShoutError("The argument of PARCEL_MEDIA_COMMAND_DESC must be a string."); | 10142 | else Error("llParcelMediaCommandList", "The argument of PARCEL_MEDIA_COMMAND_DESC must be a string"); |
10150 | ++i; | 10143 | ++i; |
10151 | } | 10144 | } |
10152 | break; | 10145 | break; |
@@ -10162,9 +10155,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10162 | height = (LSL_Integer)commandList.Data[i + 2]; | 10155 | height = (LSL_Integer)commandList.Data[i + 2]; |
10163 | update = true; | 10156 | update = true; |
10164 | } | 10157 | } |
10165 | else ShoutError("The second argument of PARCEL_MEDIA_COMMAND_SIZE must be an integer."); | 10158 | else Error("llParcelMediaCommandList", "The second argument of PARCEL_MEDIA_COMMAND_SIZE must be an integer"); |
10166 | } | 10159 | } |
10167 | else ShoutError("The first argument of PARCEL_MEDIA_COMMAND_SIZE must be an integer."); | 10160 | else Error("llParcelMediaCommandList", "The first argument of PARCEL_MEDIA_COMMAND_SIZE must be an integer"); |
10168 | i += 2; | 10161 | i += 2; |
10169 | } | 10162 | } |
10170 | break; | 10163 | break; |
@@ -10336,7 +10329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10336 | 10329 | ||
10337 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) | 10330 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) |
10338 | { | 10331 | { |
10339 | ShoutError("No permissions to track the camera"); | 10332 | Error("llGetCameraPos", "No permissions to track the camera"); |
10340 | return Vector3.Zero; | 10333 | return Vector3.Zero; |
10341 | } | 10334 | } |
10342 | 10335 | ||
@@ -10359,7 +10352,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10359 | 10352 | ||
10360 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) | 10353 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) |
10361 | { | 10354 | { |
10362 | ShoutError("No permissions to track the camera"); | 10355 | Error("llGetCameraRot", "No permissions to track the camera"); |
10363 | return Quaternion.Identity; | 10356 | return Quaternion.Identity; |
10364 | } | 10357 | } |
10365 | 10358 | ||
@@ -10382,14 +10375,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10382 | ScriptSleep(2000); | 10375 | ScriptSleep(2000); |
10383 | } | 10376 | } |
10384 | 10377 | ||
10385 | /// <summary> | ||
10386 | /// The SL implementation shouts an error, it is deprecated | ||
10387 | /// This duplicates SL | ||
10388 | /// </summary> | ||
10389 | public void llRefreshPrimURL() | 10378 | public void llRefreshPrimURL() |
10390 | { | 10379 | { |
10391 | m_host.AddScriptLPS(1); | 10380 | m_host.AddScriptLPS(1); |
10392 | ShoutError("llRefreshPrimURL - not yet supported"); | 10381 | Deprecated("llRefreshPrimURL"); |
10393 | ScriptSleep(20000); | 10382 | ScriptSleep(20000); |
10394 | } | 10383 | } |
10395 | 10384 | ||
@@ -11346,7 +11335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11346 | if (assetID == UUID.Zero) | 11335 | if (assetID == UUID.Zero) |
11347 | { | 11336 | { |
11348 | // => complain loudly, as specified by the LSL docs | 11337 | // => complain loudly, as specified by the LSL docs |
11349 | ShoutError("Notecard '" + name + "' could not be found."); | 11338 | Error("llGetNumberOfNotecardLines", "Notecard '" + name + "' could not be found"); |
11350 | 11339 | ||
11351 | return UUID.Zero.ToString(); | 11340 | return UUID.Zero.ToString(); |
11352 | } | 11341 | } |
@@ -11368,7 +11357,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11368 | { | 11357 | { |
11369 | if (a == null || a.Type != 7) | 11358 | if (a == null || a.Type != 7) |
11370 | { | 11359 | { |
11371 | ShoutError("Notecard '" + name + "' could not be found."); | 11360 | Error("llGetNumberOfNotecardLines", "Notecard '" + name + "' could not be found"); |
11372 | return; | 11361 | return; |
11373 | } | 11362 | } |
11374 | 11363 | ||
@@ -11399,7 +11388,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11399 | if (assetID == UUID.Zero) | 11388 | if (assetID == UUID.Zero) |
11400 | { | 11389 | { |
11401 | // => complain loudly, as specified by the LSL docs | 11390 | // => complain loudly, as specified by the LSL docs |
11402 | ShoutError("Notecard '" + name + "' could not be found."); | 11391 | Error("llGetNotecardLine", "Notecard '" + name + "' could not be found"); |
11403 | 11392 | ||
11404 | return UUID.Zero.ToString(); | 11393 | return UUID.Zero.ToString(); |
11405 | } | 11394 | } |
@@ -11422,7 +11411,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11422 | { | 11411 | { |
11423 | if (a == null || a.Type != 7) | 11412 | if (a == null || a.Type != 7) |
11424 | { | 11413 | { |
11425 | ShoutError("Notecard '" + name + "' could not be found."); | 11414 | Error("llGetNotecardLine", "Notecard '" + name + "' could not be found"); |
11426 | return; | 11415 | return; |
11427 | } | 11416 | } |
11428 | 11417 | ||