diff options
author | Mic Bowman | 2012-07-20 10:25:50 -0700 |
---|---|---|
committer | Mic Bowman | 2012-07-20 10:25:50 -0700 |
commit | 644fb6b013b8c8598c42d19cee67201911f31c2e (patch) | |
tree | 02f173b9e6ff2a83c09b264e6082bf61cba6cf18 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation | |
parent | Fix the order of operations on detach. The object must always be serialized (diff) | |
download | opensim-SC-644fb6b013b8c8598c42d19cee67201911f31c2e.zip opensim-SC-644fb6b013b8c8598c42d19cee67201911f31c2e.tar.gz opensim-SC-644fb6b013b8c8598c42d19cee67201911f31c2e.tar.bz2 opensim-SC-644fb6b013b8c8598c42d19cee67201911f31c2e.tar.xz |
Implements a very useful OSSL function to test a string to see
if it is a UUID. The function is osIsUUID().
Thanks SignpostMarv!
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 4137397..e0b4db6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3274,5 +3274,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3274 | InitLSL(); | 3274 | InitLSL(); |
3275 | ((LSL_Api)m_LSL_Api).DetachFromAvatar(); | 3275 | ((LSL_Api)m_LSL_Api).DetachFromAvatar(); |
3276 | } | 3276 | } |
3277 | |||
3278 | /// <summary> | ||
3279 | /// Checks if thing is a UUID. | ||
3280 | /// </summary> | ||
3281 | /// <param name="thing"></param> | ||
3282 | /// <returns>1 if thing is a valid UUID, 0 otherwise</returns> | ||
3283 | public LSL_Integer osIsUUID(string thing) | ||
3284 | { | ||
3285 | CheckThreatLevel(ThreatLevel.None, "osIsUUID"); | ||
3286 | m_host.AddScriptLPS(1); | ||
3287 | |||
3288 | UUID test; | ||
3289 | return UUID.TryParse(thing, out test) ? 1 : 0; | ||
3290 | } | ||
3277 | } | 3291 | } |
3278 | } \ No newline at end of file | 3292 | } \ No newline at end of file |