secondlife / jira-archive

2 stars 0 forks source link

[BUG-227362] Scripted non-physical object becomes physical for no apparent reason. #5671

Open sl-service-account opened 5 years ago

sl-service-account commented 5 years ago

What just happened?

A scripted linkset that should not become physical for any reason suddenly becomes physical for about a second when clicked in rapid succession.

What were you doing when it happened?

I'm scripting an object to be placed inside a residential building. It is a type of security orb that is more reasonable than most. This script looks for objects clicked with the word "door" and if someone clicks it more than 5 times, that avatar will be banned after being told to stop several times. It also has an access list (notecard) and means to allow group access or anyone, or nobody but the owner.

What were you expecting to happen instead?

I'm expecting the object to not move at all! Nowhere in the script is the object being told to become physical.

Other information

A copy paste of the script inside the object: Repo this by simply creating a cube, new script, copy paste this script into the new script (you know how to do this, why am i explaining that ;p). Also make sure to create a notecard in the object and put a random name in it like "governor linden" or your own.

The script:


list clicks;
string prefixDoor   = "door";
integer NOT_FOUND   = -1;
list gWhiteList     = [];
string gCard;
integer gLine;
key gQuery;
list gWho           = ["Me Only","Group","List","Group+List","Everyone"];
integer gAccess     = 2;
integer gDChnl;

default
{
    state_entry()
    {
        if(llGetInventoryNumber(INVENTORY_NOTECARD) == 1)
        {
            gCard = llGetInventoryName(INVENTORY_NOTECARD,0);
            gQuery = llGetNotecardLine(gCard, 0);
        }
        else
        {
            llOwnerSay("The whitelist notecard is missing.");
        }
    }

    changed(integer change)
    {
        if (change & CHANGED_INVENTORY)
        {
            llResetScript();
        }
    }

     dataserver(key QID, string data)
    {
        if(gQuery == QID)
        {
            if (data != EOF)
            {

                gWhiteList += [llStringTrim(data,STRING_TRIM)];
                gQuery = llGetNotecardLine(gCard, ++gLine);

            }
            else
            {
                state running;
            }
        }
    }
}

state running
{
    state_entry()
    {
        gDChnl = (integer) ("0xF" + llGetSubString(llGetOwner(),0,6));
    }

    changed(integer change)
    {
        if (change & CHANGED_INVENTORY)
        {
            llResetScript();
        }
    }

    touch_start(integer total_number)
    {
        llResetTime();
        integer idx = llListFindList(gWhiteList,[llDetectedName(0)]);
        if (llDetectedKey(0) != llGetOwner())
        {
            if ((gAccess == 4) ||
                ((gAccess == 3) && (~idx || llSameGroup(llDetectedKey(0)))) ||
                ((gAccess == 2) && (~idx)) ||
                ((gAccess == 1) && (llSameGroup(llDetectedKey(0)))))
            {
                state OK;
            }
                else {
                    llSay(-27,"NOTOK");
                     key id = llDetectedKey(0);
                     //Get link-number and obj-name
                     integer link = llDetectedLinkNumber(0);
                     string objName = llGetLinkName(link);
                     if (llSubStringIndex(objName, prefixDoor) == 0) {
                         integer links = llGetObjectPrimCount(llGetKey());
                         //Find corresponding link-number of door
                         string target = llGetSubString(objName, llStringLength(prefixDoor), -1);
                         //Iterate thru linkset and find all corresponding doors
                         integer z;
                         for (z = 0; z <= links; z++) {
                             string objName = llGetLinkName(z);
                             if (~llSubStringIndex(objName, target)) {
                                 integer i = llListFindList(clicks, [id]);
                             if (i == -1) clicks = clicks + [id, 1];
                             else {
                                integer total = llList2Integer(clicks, ++i) + 1;
                                clicks = llListReplaceList(clicks, [total], i, i);
                                if (total == 2)
                                {
                                    llDialog(id, "\n\n\n       Please stop...\n\n\n", [ ] , gDChnl);
                                }
                                else if (total == 3)
                                {
                                    llDialog(id, "\n\n\n       Seriously, stop it...\n\n\n", [ ] , gDChnl);
                                }
                                else if (total == 4)
                                {
                                    llDialog(id, "\n\n\n       Last chance...\n\n\n", [ ] , gDChnl);
                                }
                                else if (total == 5)
                                {
                                    llDialog(id, "\n\n\n       I warned you...\n\n\n", [ ] , gDChnl);
                                    llAddToLandBanList(llDetectedKey(0),0.0);
                                    //llResetScript();
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    touch_end(integer num)
    {
        if(llDetectedKey(0) == llGetOwner())
        {
            if (llGetTime() < 3.0 )
            {
                state OK;
            }
            else if (llGetTime() >= 3.0 )
            {
                llListen(gDChnl,"","","");
                llDialog(llGetOwner(),"Who should have access?",gWho,gDChnl);
            }
        }
    }

    listen(integer channel, string name, key id, string msg)
    {
        gAccess = llListFindList(gWho,[msg]);
        string temp;
        if (gAccess == 0)
        {
            temp = "you only.";
        }
        else if (gAccess == 1)
        {
            temp = "group members only.";
        }
        else if (gAccess == 2)
        {
            temp = " \n" + llDumpList2String(gWhiteList," \n");
        }
        else if (gAccess == 3)
        {
            temp = "this group and " + " \n" +llDumpList2String(gWhiteList, " \n");
        }
        else
        {
            temp = "everyone.";
        }
        llOwnerSay("Access has been granted to " + temp);
    }
}

state OK
{
    state_entry()
    {
        llSay(-27,"OK"); 
        state running;
    }

    changed(integer change)
    {
        if (change & CHANGED_INVENTORY)
        {
            llResetScript();
        }
    }
} 

Attachments

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-227362 | | Summary | Scripted non-physical object becomes physical for no apparent reason. | | Type | Bug | | Priority | Unset | | Status | Needs More Info | | Resolution | Unresolved | | Reporter | CaithLynnSayes (caithlynnsayes) | | Created at | 2019-07-21T09:05:16Z | | Updated at | 2019-07-23T22:59:54Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2019-07-21T18:20:01.014-0500', "Is there anything you'd like to add?": 'A copy paste of the script inside the object:\r\nRepo this by simply creating a cube, new script, copy paste this script into the new script (you know how to do this, why am i explaining that ;p). Also make sure to create a notecard in the object and put a random name in it like "governor linden" or your own.\r\n\r\nThe script:\r\n\r\nlist clicks;\r\nstring prefixDoor = "door";\r\ninteger NOT_FOUND = -1;\r\nlist gWhiteList = [];\r\nstring gCard;\r\ninteger gLine;\r\nkey gQuery;\r\nlist gWho = ["Me Only","Group","List","Group+List","Everyone"];\r\ninteger gAccess = 2;\r\ninteger gDChnl;\r\n\r\ndefault\r\n{\r\n state_entry()\r\n {\r\n if(llGetInventoryNumber(INVENTORY_NOTECARD) == 1)\r\n {\r\n gCard = llGetInventoryName(INVENTORY_NOTECARD,0);\r\n gQuery = llGetNotecardLine(gCard, 0);\r\n }\r\n else\r\n {\r\n llOwnerSay("The whitelist notecard is missing.");\r\n }\r\n }\r\n\r\n changed(integer change)\r\n {\r\n if (change & CHANGED_INVENTORY)\r\n {\r\n llResetScript();\r\n }\r\n }\r\n \r\n dataserver(key QID, string data)\r\n {\r\n if(gQuery == QID)\r\n {\r\n if (data != EOF)\r\n {\r\n\r\n gWhiteList += [llStringTrim(data,STRING_TRIM)];\r\n gQuery = llGetNotecardLine(gCard, ++gLine);\r\n\r\n }\r\n else\r\n {\r\n state running;\r\n }\r\n }\r\n }\r\n}\r\n\r\nstate running\r\n{\r\n state_entry()\r\n {\r\n gDChnl = (integer) ("0xF" + llGetSubString(llGetOwner(),0,6));\r\n }\r\n\r\n changed(integer change)\r\n {\r\n if (change & CHANGED_INVENTORY)\r\n {\r\n llResetScript();\r\n }\r\n }\r\n \r\n touch_start(integer total_number)\r\n {\r\n llResetTime();\r\n integer idx = llListFindList(gWhiteList,[llDetectedName(0)]);\r\n if (llDetectedKey(0) != llGetOwner())\r\n {\r\n if ((gAccess == 4) ||\r\n ((gAccess == 3) && (~idx || llSameGroup(llDetectedKey(0)))) ||\r\n ((gAccess == 2) && (~idx)) ||\r\n ((gAccess == 1) && (llSameGroup(llDetectedKey(0)))))\r\n {\r\n state OK;\r\n }\r\n else {\r\n llSay(-27,"NOTOK");\r\n key id = llDetectedKey(0);\r\n //Get link-number and obj-name\r\n integer link = llDetectedLinkNumber(0);\r\n string objName = llGetLinkName(link);\r\n if (llSubStringIndex(objName, prefixDoor) == 0) {\r\n integer links = llGetObjectPrimCount(llGetKey());\r\n //Find corresponding link-number of door\r\n string target = llGetSubString(objName, llStringLength(prefixDoor), -1);\r\n //Iterate thru linkset and find all corresponding doors\r\n integer z;\r\n for (z = 0; z <= links; z++) {\r\n string objName = llGetLinkName(z);\r\n if (~llSubStringIndex(objName, target)) {\r\n integer i = llListFindList(clicks, [id]);\r\n if (i == -1) clicks = clicks + [id, 1];\r\n else {\r\n integer total = llList2Integer(clicks, ++i) + 1;\r\n clicks = llListReplaceList(clicks, [total], i, i);\r\n if (total == 2)\r\n {\r\n llDialog(id, "\\n\\n\\n Please stop...\\n\\n\\n", [ ] , gDChnl);\r\n }\r\n else if (total == 3)\r\n {\r\n llDialog(id, "\\n\\n\\n Seriously, stop it...\\n\\n\\n", [ ] , gDChnl);\r\n }\r\n else if (total == 4)\r\n {\r\n llDialog(id, "\\n\\n\\n Last chance...\\n\\n\\n", [ ] , gDChnl);\r\n }\r\n else if (total == 5)\r\n {\r\n llDialog(id, "\\n\\n\\n I warned you...\\n\\n\\n", [ ] , gDChnl);\r\n llAddToLandBanList(llDetectedKey(0),0.0);\r\n //llResetScript();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n \r\n touch_end(integer num)\r\n {\r\n if(llDetectedKey(0) == llGetOwner())\r\n {\r\n if (llGetTime() < 3.0 )\r\n {\r\n state OK;\r\n }\r\n else if (llGetTime() >= 3.0 )\r\n {\r\n llListen(gDChnl,"","","");\r\n llDialog(llGetOwner(),"Who should have access?",gWho,gDChnl);\r\n }\r\n }\r\n }\r\n\r\n listen(integer channel, string name, key id, string msg)\r\n {\r\n gAccess = llListFindList(gWho,[msg]);\r\n string temp;\r\n if (gAccess == 0)\r\n {\r\n temp = "you only.";\r\n }\r\n else if (gAccess == 1)\r\n {\r\n temp = "group members only.";\r\n }\r\n else if (gAccess == 2)\r\n {\r\n temp = " \\n" + llDumpList2String(gWhiteList," \\n");\r\n }\r\n else if (gAccess == 3)\r\n {\r\n temp = "this group and " + " \\n" +llDumpList2String(gWhiteList, " \\n");\r\n }\r\n else\r\n {\r\n temp = "everyone.";\r\n }\r\n llOwnerSay("Access has been granted to " + temp);\r\n }\r\n}\r\n\r\nstate OK\r\n{\r\n state_entry()\r\n {\r\n llSay(-27,"OK"); \r\n state running;\r\n }\r\n\r\n changed(integer change)\r\n {\r\n if (change & CHANGED_INVENTORY)\r\n {\r\n llResetScript();\r\n }\r\n }\r\n}', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'System': 'SL Simulator', 'Target Viewer Version': 'viewer-development', 'What just happened?': 'A scripted linkset that should not become physical for any reason suddenly becomes physical for about a second when clicked in rapid succession.', 'What were you doing when it happened?': 'I\'m scripting an object to be placed inside a residential building. It is a type of security orb that is more reasonable than most. This script looks for objects clicked with the word "door" and if someone clicks it more than 5 times, that avatar will be banned after being told to stop several times. It also has an access list (notecard) and means to allow group access or anyone, or nobody but the owner.', 'What were you expecting to happen instead?': "I'm expecting the object to not move at all! Nowhere in the script is the object being told to become physical.", } ```
sl-service-account commented 5 years ago

Lucia Nightfire commented at 2019-07-21T23:20:01Z

Make sure you use code tags when posting scripts by starting and ending the code block with "code" in {} brackets.

I had to add a bracket at the end of your touch_start() event for the script to compile.

I was unable to repro the changing of physics.

Since you're using Firestorm, make sure you don't have Physical checked in Prefs > Firestorm > Build1 > Physical which will create a physical box on rez.

 

sl-service-account commented 5 years ago

Whirly Fizzle commented at 2019-07-23T15:56:27Z

I can't reproduce this on Firestorm.

sl-service-account commented 5 years ago

Caleb Linden commented at 2019-07-23T22:59:50Z

I wasn't able to reproduce this issue either. But I can try it again. Could you share that link set similar to the one in the clip to me?