aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorMic Bowman2012-07-20 10:25:50 -0700
committerMic Bowman2012-07-20 10:25:50 -0700
commit644fb6b013b8c8598c42d19cee67201911f31c2e (patch)
tree02f173b9e6ff2a83c09b264e6082bf61cba6cf18 /OpenSim/Region/ScriptEngine/Shared
parentFix the order of operations on detach. The object must always be serialized (diff)
downloadopensim-SC_OLD-644fb6b013b8c8598c42d19cee67201911f31c2e.zip
opensim-SC_OLD-644fb6b013b8c8598c42d19cee67201911f31c2e.tar.gz
opensim-SC_OLD-644fb6b013b8c8598c42d19cee67201911f31c2e.tar.bz2
opensim-SC_OLD-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')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
3 files changed, 26 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
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index b5416c8..c9403eb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -276,5 +276,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
276 276
277 void osSetTerrainTexture(int level, LSL_Key texture); 277 void osSetTerrainTexture(int level, LSL_Key texture);
278 void osSetTerrainTextureHeight(int corner, double low, double high); 278 void osSetTerrainTextureHeight(int corner, double low, double high);
279
280 /// <summary>
281 /// Checks if thing is a UUID.
282 /// </summary>
283 /// <param name="thing"></param>
284 /// <returns>1 if thing is a valid UUID, 0 otherwise</returns>
285 LSL_Integer osIsUUID(string thing);
279 } 286 }
280} 287}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index b40bdf0..99995a7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -930,5 +930,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
930 { 930 {
931 m_OSSL_Functions.osSetTerrainTextureHeight(corner, low, high); 931 m_OSSL_Functions.osSetTerrainTextureHeight(corner, low, high);
932 } 932 }
933
934 public LSL_Integer osIsUUID(string thing)
935 {
936 return m_OSSL_Functions.osIsUUID(thing);
937 }
933 } 938 }
934} 939}