aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorMelanie2012-07-20 22:12:02 +0100
committerMelanie2012-07-20 22:12:02 +0100
commit03ff782c3cbefc7ed8582445a1c89f36e643b117 (patch)
tree474fce6662c1d5e54f59289c1a2183ef727251d7 /OpenSim/Region/ScriptEngine/Shared/Api
parentMerge branch 'master' into careminster (diff)
parentEnables support for UUIDs to be returned in lists from (diff)
downloadopensim-SC-03ff782c3cbefc7ed8582445a1c89f36e643b117.zip
opensim-SC-03ff782c3cbefc7ed8582445a1c89f36e643b117.tar.gz
opensim-SC-03ff782c3cbefc7ed8582445a1c89f36e643b117.tar.bz2
opensim-SC-03ff782c3cbefc7ed8582445a1c89f36e643b117.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs16
-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
4 files changed, 39 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 4bd3dff..7844c75 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
@@ -200,24 +200,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
200 for (int i = 0; i < result.Length; i++) 200 for (int i = 0; i < result.Length; i++)
201 { 201 {
202 if (result[i] is string) 202 if (result[i] is string)
203 {
203 llist[i] = new LSL_String((string)result[i]); 204 llist[i] = new LSL_String((string)result[i]);
205 }
204 else if (result[i] is int) 206 else if (result[i] is int)
207 {
205 llist[i] = new LSL_Integer((int)result[i]); 208 llist[i] = new LSL_Integer((int)result[i]);
209 }
206 else if (result[i] is float) 210 else if (result[i] is float)
211 {
207 llist[i] = new LSL_Float((float)result[i]); 212 llist[i] = new LSL_Float((float)result[i]);
213 }
214 else if (result[i] is UUID)
215 {
216 llist[i] = new LSL_Key(result[i].ToString());
217 }
208 else if (result[i] is OpenMetaverse.Vector3) 218 else if (result[i] is OpenMetaverse.Vector3)
209 { 219 {
210 OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i]; 220 OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i];
211 llist[i] = new LSL_Vector(vresult.X,vresult.Y,vresult.Z); 221 llist[i] = new LSL_Vector(vresult.X, vresult.Y, vresult.Z);
212 } 222 }
213 else if (result[i] is OpenMetaverse.Quaternion) 223 else if (result[i] is OpenMetaverse.Quaternion)
214 { 224 {
215 OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i]; 225 OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i];
216 llist[i] = new LSL_Rotation(qresult.X,qresult.Y,qresult.Z,qresult.W); 226 llist[i] = new LSL_Rotation(qresult.X, qresult.Y, qresult.Z, qresult.W);
217 } 227 }
218 else 228 else
219 { 229 {
220 MODError(String.Format("unknown list element returned by {0}",fname)); 230 MODError(String.Format("unknown list element {1} returned by {0}", fname, result[i].GetType().Name));
221 } 231 }
222 } 232 }
223 233
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 29d0342..bf77dc5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -3322,5 +3322,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3322 InitLSL(); 3322 InitLSL();
3323 ((LSL_Api)m_LSL_Api).DetachFromAvatar(); 3323 ((LSL_Api)m_LSL_Api).DetachFromAvatar();
3324 } 3324 }
3325
3326 /// <summary>
3327 /// Checks if thing is a UUID.
3328 /// </summary>
3329 /// <param name="thing"></param>
3330 /// <returns>1 if thing is a valid UUID, 0 otherwise</returns>
3331 public LSL_Integer osIsUUID(string thing)
3332 {
3333 CheckThreatLevel(ThreatLevel.None, "osIsUUID");
3334 m_host.AddScriptLPS(1);
3335
3336 UUID test;
3337 return UUID.TryParse(thing, out test) ? 1 : 0;
3338 }
3325 } 3339 }
3326} 3340}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 1facc96..24bdf0c 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}