Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006098opensim[REGION] Script Functionspublic2012-07-18 06:442014-07-29 13:41
ReporterSignpostMarv 
Assigned Tocmickeyb 
PrioritynormalSeverityminorReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Versionmaster (dev code) 
Summary0006098: OSSL (and by extension, LSL) lacks a means to check if a value is a UUID
DescriptionI noticed that if one defines `key foo` then foo is equal to string.Empty, not UUID.Zero.toString(), so doing checks for if(foo == NULL_KEY) become a bit annoying.

Which got me thinking to the greater problem of strings and keys being interchangeable in a lot of circumstances, but no way for an LSL script to be 100% certain that something of type key was a valid UUID.

The current implementation accepts all types as input which I'm guessing *may* be a bit too much. Will be filing a second patch that accepts string as input as an alternative.
Steps To Reproducedefault
{
    state_entry()
    {
        llOwnerSay(llList2CSV([
            osIsUUID(0),
            osIsUUID(0.0),
            osIsUUID("foo"),
            osIsUUID(NULL_KEY),
            osIsUUID(ZERO_VECTOR),
            osIsUUID(ZERO_ROTATION)
        ]));
    }
}
TagsNo tags attached.
Git Revision or version numbereb590
Run ModeStandalone (1 Region)
Physics EngineBasicPhysics
Environment.NET / Windows32
Mono VersionNone
Viewer
Attached Filespatch file icon osIsUUID.patch [^] (2,843 bytes) 2012-07-18 06:44 [Show Content]
patch file icon osIsUUID-strings-only.patch [^] (5,741 bytes) 2012-07-18 06:50 [Show Content]
patch file icon osIsUUID-final.patch [^] (6,804 bytes) 2012-07-20 02:38 [Show Content]

- Relationships

-  Notes
(0021813)
SignpostMarv (reporter)
2012-07-18 06:50

// LSL script that uses the second patch

default
{
    state_entry()
    {
        llOwnerSay(llList2CSV([
            osIsUUID((string)0),
            osIsUUID((string)0.0),
            osIsUUID("foo"),
            osIsUUID(NULL_KEY),
            osIsUUID((string)ZERO_VECTOR),
            osIsUUID((string)ZERO_ROTATION)
        ]));
    }
}
(0021814)
SignpostMarv (reporter)
2012-07-18 06:53

¬_¬ just realised I forgot to put threat level and lps in ¬_¬

I'll patch that in based on feedback of which implementation to go with and what the script level should be (I'm thinking None or VeryLow ?)
(0021845)
melanie (administrator)
2012-07-20 01:39

Threat level for this would be "none" as determining if a UUID is valid is really basic LSL capbility.

The string only version is the one that should go in, we don't need the extra boxing. "object" as parameter to OSSL/LSL api functions should be avoided.
(0021846)
SignpostMarv (reporter)
2012-07-20 02:38

final patch posted based on feedback.
(0021849)
cmickeyb (administrator)
2012-07-20 10:51

Applied in commit 644fb6b013b8c8598c42d19cee67201911f31c2e

- Issue History
Date Modified Username Field Change
2012-07-18 06:44 SignpostMarv New Issue
2012-07-18 06:44 SignpostMarv File Added: osIsUUID.patch
2012-07-18 06:50 SignpostMarv File Added: osIsUUID-strings-only.patch
2012-07-18 06:50 SignpostMarv Note Added: 0021813
2012-07-18 06:50 SignpostMarv Status new => patch included
2012-07-18 06:53 SignpostMarv Note Added: 0021814
2012-07-18 09:11 cmickeyb Assigned To => cmickeyb
2012-07-18 09:11 cmickeyb Status patch included => assigned
2012-07-20 01:39 melanie Note Added: 0021845
2012-07-20 02:38 SignpostMarv File Added: osIsUUID-final.patch
2012-07-20 02:38 SignpostMarv Note Added: 0021846
2012-07-20 10:51 cmickeyb Note Added: 0021849
2012-07-20 10:51 cmickeyb Status assigned => resolved
2012-07-20 10:51 cmickeyb Fixed in Version => master (dev code)
2012-07-20 10:51 cmickeyb Resolution open => fixed
2014-07-29 13:41 chi11ken Status resolved => closed


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker