Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008025opensim[REGION] Scripting Enginepublic2016-09-18 18:332016-09-19 06:11
ReporterAaack 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionsuspended 
PlatformMono-Linux x64OSUbuntuOS Version14.04 LTS
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0008025: Logical NOT (!=) isn't working properly comparing keys.
DescriptionBy accident I discovered if you compare two UUIDs with a logical NOT it acts like a logical EQUAL (==).
I've been able to reproduce the error with the following script:

(It's the core of a ban list test I was doing)

//add your UUID here
list people =[
            "ec7cbc7c-d909-47ad-a98e-c05713c57ffe",
            "95de498a-fd79-46f5-9b5a-ab30cb671931",
            "ad61c6bc-6089-4ad9-86f5-9b84c5f64676"
            ];
integer banned = FALSE;
check(key who)
{
    integer index = 0;
    while (index < llGetListLength(people))
    {
        llSay(0, (string)who + " = " + llList2String(people, index));
        if (who != llList2Key(people, index)) //Changing the comparission from not (!=) to equal (==) won't change the result
        {
            banned = TRUE;
        }
        ++index;
    }
}
default
{

    touch_start(integer total_number)
    {
        check(llDetectedKey(0));
        if(banned == TRUE)
        {
            llSay(0, "You're banned");
        }
        else
        {
            llSay(0, "You're not banned");
        }
        llResetScript();
    }
}
Steps To ReproduceCreate a prim, drop the script I posted above and add your UUID to test.

Click on it and observe the result.

Change the not of line 13 for an equal (==).

Click on it and observe it throws the exact same result.
Additional InformationWhile NOT is working weird, EQUAL works as expected. So currently the way i found to circumvent this issue is just turn around the comparison.
TagsNo tags attached.
Git Revision or version numberOSgrid 0.9.0.0 (Dev) b9380c0: 2016-09-10
Run Mode Grid (Multiple Regions per Sim)
Physics EngineODE
Script Engine
EnvironmentMono / Linux64
Mono VersionOther
ViewerFirestorm 4.7.9 (50527)
Attached Files

- Relationships

-  Notes
(0031137)
Aaack (reporter)
2016-09-18 19:52

Dan found the identical result in SL. Im suspending it until i can talk with ubit.
(0031138)
tglion (reporter)
2016-09-18 23:18

Mhhh, if the touching avatar is in the list, the result should always the same:
"You're banned"
Thats correct in both cases. It does not matter if you compare with == or !=, if the toucher is in the list.

But I know there is an other issue in opensim with keys. In opensim keys is represented internally always as strings, so the behavior is not same as in SL.
But this is difficult to fix, because it is neccessary to redesign the whole script-engine for keys handling as separate key-datatype.
(0031139)
UbitUmarov (administrator)
2016-09-19 05:02

Checked != and seems working as expected.
like tglion said the issue is on that script logic.
not sure what are the current runtime differences with SL but == and != and not on those, and SL also handles keys as strings in some cases, if I remember
(0031140)
tglion (reporter)
2016-09-19 06:11

Not exactly. SL handles keys as seperate data-type if I remember it corre tly. See mantis 7380 there is the hint, that I remember.
The main problem is comparing NULL_KEY differs between key and string on SL. In opensim is key the same as string. But this is off topic to this report. :-)

- Issue History
Date Modified Username Field Change
2016-09-18 18:33 Aaack New Issue
2016-09-18 19:52 Aaack Note Added: 0031137
2016-09-18 19:52 Aaack Resolution open => suspended
2016-09-18 23:18 tglion Note Added: 0031138
2016-09-19 05:02 UbitUmarov Note Added: 0031139
2016-09-19 06:11 tglion Note Added: 0031140


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker