Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

[BUG-230616] A user's scripts and attachments do not load in a region if they are teleported while their viewer is minimized. The server shows no attachments, scripts, script memory or timing. #8250

Closed
1 task
sl-service-account opened this issue Apr 25, 2021 · 1 comment

Comments

@sl-service-account
Copy link

sl-service-account commented Apr 25, 2021

Information

This repros with any viewer and any region version.

Log user A into region A. Make sure they are wearing visible scripted attachments be them prim or mesh.

Make a landmark for region B.

Rez a box, size to HUD size and drop landmark in.

Save the following script in the HUD:

key owner = NULL_KEY;
key my_key = NULL_KEY;
key request = NULL_KEY;
integer perms = 0x1004; //PERMISSION_TAKE_CONTROLS | PERMISSION_TELEPORT
string last_region;
default
{
    state_entry()
    {
        llSetLinkColor(LINK_THIS,<1.0,1.0,0.0>,ALL_SIDES);
        llRequestPermissions(llGetOwner(),!!llGetAttached() * perms);
    }
    on_rez(integer i)
    {
        if (llGetPermissions() == perms)
        {
            llSetTimerEvent(0.0);
            request = NULL_KEY;
            last_region = "";
            llSetLinkColor(LINK_THIS,<0.0,1.0,0.0>,ALL_SIDES);
        }
        else
        {
            llResetScript();
        }
    }
    run_time_permissions(integer i)
    {
        if (i == perms)
        {
            llSetLinkColor(LINK_THIS,<0.0,1.0,0.0>,ALL_SIDES);
        }
    }
    touch_end(integer i)
    {
        if (llGetAttached() && (llDetectedKey(0) == llGetOwner()))
        {
            if (llGetPermissions() == perms)
            {
                if (request)
                {
                    request = NULL_KEY;
                    llOwnerSay("dataserver interrupted...");
                }
                if (last_region)
                {
                    llSetTimerEvent(0.0);
                    last_region = "";
                    llSetLinkColor(LINK_THIS,<0.0,1.0,0.0>,ALL_SIDES);
                    llOwnerSay("countdown cancelled...");
                }
                else if (llGetInventoryNumber(INVENTORY_LANDMARK))
                {
                    my_key = llGetKey();
                    llOwnerSay("reading landmark data...");
                    if (request = llRequestInventoryData(llGetInventoryName(INVENTORY_LANDMARK,0)))
                    {
                        return;
                    }
                    llOwnerSay("llRequestInventoryData() returned '" + (string)request + "'");
                }
                else
                {
                    llOwnerSay("no landmarks in inventory...");
                }
            }
            else
            {
                llSetTimerEvent(0.0);
                request = NULL_KEY;
                last_region = "";
                llSetLinkColor(LINK_THIS,<1.0,1.0,0.0>,ALL_SIDES);
                llRequestPermissions(llGetOwner(),perms);
            }
        }
    }
    dataserver(key k, string data)
    {
        if ((k == request) && (k != NULL_KEY) && (my_key == llGetKey()))
        {
            request = NULL_KEY;
            if (data)
            {
                vector v = (vector)data;
                if ((v.x < 0.0) || (v.x >= 256.0) || (v.y < 0.0) || (v.y >= 256.0))
                {
                    llOwnerSay("Teleporting in 10 seconds. Minimize your viewer to desktop. Maximize your viewer any time after this amount of time has passed.");
                    last_region = llGetRegionName();
                    llSetTimerEvent(10.0);
                    llSetLinkColor(LINK_THIS,<1.0,0.0,0.0>,ALL_SIDES);
                }
                else
                {
                    llOwnerSay("Landmark destination must be in another region.");
                }
            }
            else
            {
                llOwnerSay("dataserver returned empty data");
            }
        }
    }
    timer()
    {
        llSetTimerEvent(0.0);
        if (llGetPermissions() == perms)
        {
            if (llGetAttached() && (my_key == llGetKey()) && (last_region == llGetRegionName()))
            {
                llOwnerSay("Teleporting...");
                integer start_time = llGetUnixTime();
                llTeleportAgent(llGetOwner(),llGetInventoryName(INVENTORY_LANDMARK,0),<128,128,128>,<1,0,0>);
                llSleep(1.0);
                if (last_region != llGetRegionName())
                {
                    llOwnerSay("Amount of time elapsed between teleport start and end is " + (string)(llGetUnixTime() - start_time) + " second(s).");
                }
                else
                {
                    llOwnerSay("Teleport interrupted.");
                }
                last_region = "";
            }
            llSetLinkColor(LINK_THIS,<0.0,1.0,0.0>,ALL_SIDES);
        }
        else
        {
            request = NULL_KEY;
            last_region = "";
            llSetLinkColor(LINK_THIS,<1.0,1.0,0.0>,ALL_SIDES);
            llRequestPermissions(llGetOwner(),!!llGetAttached() * perms);
        }
    }
}

Have user A take the HUD into their inventory and wear.

Accept teleport permissions. HUD turns from yellow to green.

Log user B (your alt) into the location in region B at the location of the landmark.

Have user B rez a box and size to HUD size and save the following script in the HUD:

key last_agent = NULL_KEY;
list LAST_DETAILS;
default
{
    state_entry()
    {
        llSensorRepeat("",NULL_KEY,AGENT,20.0,PI,5.0);
    }
    on_rez(integer i)
    {
        last_agent = NULL_KEY;
    }
    sensor(integer i)
    {
        if (llGetAttached() && (llVecDist(llGetPos(),llDetectedPos(0)) <= 20.0))
        {
            key dk = llDetectedKey(0);
            if (llGetAgentSize(dk))
            {
                list D = llGetObjectDetails(dk,[OBJECT_RUNNING_SCRIPT_COUNT,OBJECT_TOTAL_SCRIPT_COUNT,OBJECT_SCRIPT_MEMORY,OBJECT_SCRIPT_TIME,OBJECT_ATTACHED_SLOTS_AVAILABLE]);
                if (dk == last_agent)
                {
                    if (llDumpList2String(llDeleteSubList(D,3,3),",") == llDumpList2String(llDeleteSubList(LAST_DETAILS,3,3),","))
                    {
                        return;
                    }
                }
                last_agent = dk;
                LAST_DETAILS = D;
                llOwnerSay("Details for secondlife:///app/agent/" + (string)dk + "/about:" +
                    "\nRunning Scripts: " + llList2String(D,0) + "/" + llList2String(D,1) +
                    "\nScript Memory: " + llList2String(D,2) +
                    "\nScript Timing: " + llList2String(D,3) +
                    "\nAvailable Attach Slots: " + llList2String(D,4));
            }
        }
    }
}

Have user B take the HUD into their inventory and wear.

Have user A click their HUD. It should turn red.

User A should receive the ownersay "Teleporting in 10 seconds. Minimize your viewer to desktop. Maximize your viewer any time after this amount of time has passed.".

Minimize user A's viewer to desktop and wait longer than 10 seconds.

This assumes user A has been teleported to the landmark's location.

Verify this with user B's viewer instance. Maximize user B's viewer if it wasn't already and look at user A.

Note of interest: User B should see user A's name tag only. No visible attachments.

User B's HUD should also have reported that the server also sees no attachments, no scripts, no script memory or timing.

Note of interest: Maximize user A's viewer. User B should now be able to see user A's attachments and user B's HUD should now report that user A's attachments and scripts have loaded into the region. User A's HUD will mention the amount of time the teleport took to complete, which will be affected by this bug due to the script not being loaded in the region after the teleport was made.

Testing

What my alt's HUD reported when I was teleported to their location with my viewer minimized:

[22:48:40] agent details (sensor): Details for Lucia Nightfire:
Running Scripts: 0/0
Script Memory: 0
Script Timing: 0.000000
Available Attach Slots: 38

What my alt's HUD reported after I maximized my viewer 2.5 minutes later:

[22:51:10] agent details (sensor): Details for Lucia Nightfire:
Running Scripts: 97/99
Script Memory: 5037932
Script Timing: 0.000862
Available Attach Slots: 2

What my own TP HUD said before the TP:

[2021/04/24 22:48:23] Landmark Teleport HUD Test: reading landmark data...
[2021/04/24 22:48:24] Landmark Teleport HUD Test: Teleporting in 10 seconds. Minimize your viewer to desktop. Maximize your viewer any time after this amount of time has passed.
[2021/04/24 22:48:35] Landmark Teleport HUD Test: Teleporting...

What it said after I maximized my viewer:

[2021/04/24 22:51:06] Landmark Teleport HUD Test: Amount of time elapsed between teleport start and end is 152 second(s).

Other Information

While an avatar is stuck in this state, they cannot be moved by bumping, pushes, or with physical or keyframe motion objects.

Links

Related

Original Jira Fields
Field Value
Issue BUG-230616
Summary A user's scripts and attachments do not load in a region if they are teleported while their viewer is minimized. The server shows no attachments, scripts, script memory or timing.
Type Bug
Priority Unset
Status Closed
Resolution Triaged
Reporter Lucia Nightfire (lucia.nightfire)
Created at 2021-04-25T05:55:43Z
Updated at 2023-05-16T22:02:52Z
{
  'Build Id': 'unset',
  'Business Unit': ['Platform'],
  'Date of First Response': '2022-12-06T17:05:56.677-0600',
  'ReOpened Count': 0.0,
  'Severity': 'Unset',
  'System': 'SL Viewer',
  'Target Viewer Version': 'viewer-development',
  'What just happened?': 'This repros with any viewer and any region version.\r\n',
  'What were you doing when it happened?': '?',
  'What were you expecting to happen instead?': '?',
}
@sl-service-account
Copy link
Author

Henri Beauchamp commented at 2022-12-06T23:05:57Z

See my pull request for a fix to this viewer-side bug: secondlife/viewer#26

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant