mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
Implements a very useful OSSL function to test a string to see
if it is a UUID. The function is osIsUUID(). Thanks SignpostMarv!
This commit is contained in:
@@ -3274,5 +3274,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
InitLSL();
|
||||
((LSL_Api)m_LSL_Api).DetachFromAvatar();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if thing is a UUID.
|
||||
/// </summary>
|
||||
/// <param name="thing"></param>
|
||||
/// <returns>1 if thing is a valid UUID, 0 otherwise</returns>
|
||||
public LSL_Integer osIsUUID(string thing)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osIsUUID");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
UUID test;
|
||||
return UUID.TryParse(thing, out test) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,5 +276,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
|
||||
void osSetTerrainTexture(int level, LSL_Key texture);
|
||||
void osSetTerrainTextureHeight(int corner, double low, double high);
|
||||
|
||||
/// <summary>
|
||||
/// Checks if thing is a UUID.
|
||||
/// </summary>
|
||||
/// <param name="thing"></param>
|
||||
/// <returns>1 if thing is a valid UUID, 0 otherwise</returns>
|
||||
LSL_Integer osIsUUID(string thing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -930,5 +930,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
m_OSSL_Functions.osSetTerrainTextureHeight(corner, low, high);
|
||||
}
|
||||
|
||||
public LSL_Integer osIsUUID(string thing)
|
||||
{
|
||||
return m_OSSL_Functions.osIsUUID(thing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user