• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-1853
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Unassigned
Reporter: chorazin allen
Votes: 133
Watchers: 25
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

State of not-running scripts is not preserved over a region restart

Created: 16/Mar/08 06:16 AM   Updated: 16/Nov/09 05:48 AM
Return to search
Component/s: Scripts
Affects Version/s: 1.19.0 Server, 1.20.0 Server, 1.24 Server
Fix Version/s: None

Environment: Server-side issue on main grid
Issue Links:
Duplicate
Parent/Child
 
Relates
 

Linden Lab Issue ID: DEV-14012


 Description  « Hide
Put two scripts in an object.
Counter
integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
    }
}
Start/Stop
default
{
    state_entry()
    {
    }

    touch_start(integer total_number)
    {
        integer running=llGetScriptState("Counter");
        
        if (running)
        {
            llSetScriptState("Counter",FALSE);
            llOwnerSay("Script stopped");
        }
        else
        {
            llSetScriptState("Counter",TRUE);
            llOwnerSay("Script started");
        }
    }
}

Touch the object to see that the Counter script is started and stopped as expected. Let it run for a while, stop it, and note the last value displayed.

Now restart the region.

When the region is back, return to the object and touch it to restart the Counter.

The Counter script, which was stopped, has lost all state and will begin counting from 0 rather than the total it had previously.

Implications: This is a major headache for those situations where scripts would be stopped because they're not needed at the time or are stopped to reduce peformance impact. If a restart happens whilst they're stopped they do not resume in the same state that they were stopped.

Update 20080328...

This includes any granted Permissions, so in the crude example below, the script will lose the granted Debit permission over a restart if the script was not running at the time. Of course, if the script's owner isn't around to re-grant the permissions things get nasty.

A really good script would detect that it's unexpectedly lost permissions it had been previously granted. Most won't and will carry on regardless, which could be real nasty in the case of a script that thinks it has the Debit permission to (for example) pay out the prize in a competition.

Modified version of Counter script (I know this is crude ):-

Modified Counter
integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
        llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
        llGiveMoney(llGetOwner(),1);
    }
}


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
chorazin allen made changes - 28/Mar/08 01:52 AM
Field Original Value New Value
Description Put two scripts in an object.

Script 1: Counter

integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
    }
}

Script 2 : Start/Stop

default
{
    state_entry()
    {
    }

    touch_start(integer total_number)
    {
        integer running=llGetScriptState("Counter");
        
        if (running)
        {
            llSetScriptState("Counter",FALSE);
            llOwnerSay("Script stopped");
        }
        else
        {
            llSetScriptState("Counter",TRUE);
            llOwnerSay("Script started");
        }
    }
}

Touch the object to see that the Counter script is started and stopped as expected. Let it run for a while, stop it, and note the last value displayed.

Now restart the region.

When the region is back, return to the object and touch it to restart the Counter.

The Counter script, which was stopped, has lost all state and will begin counting from 0 rather than the total it had previously.

Implications: This is a major headache for those situations where scripts would be stopped because they're not needed at the time or are stopped to reduce peformance impact. If a restart happens whilst they're stopped they do not resume in the same state that they were stopped.
Put two scripts in an object.

Script 1: Counter

integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
    }
}

Script 2 : Start/Stop

default
{
    state_entry()
    {
    }

    touch_start(integer total_number)
    {
        integer running=llGetScriptState("Counter");
        
        if (running)
        {
            llSetScriptState("Counter",FALSE);
            llOwnerSay("Script stopped");
        }
        else
        {
            llSetScriptState("Counter",TRUE);
            llOwnerSay("Script started");
        }
    }
}

Touch the object to see that the Counter script is started and stopped as expected. Let it run for a while, stop it, and note the last value displayed.

Now restart the region.

When the region is back, return to the object and touch it to restart the Counter.

The Counter script, which was stopped, has lost all state and will begin counting from 0 rather than the total it had previously.

Implications: This is a major headache for those situations where scripts would be stopped because they're not needed at the time or are stopped to reduce peformance impact. If a restart happens whilst they're stopped they do not resume in the same state that they were stopped.

---

Update 20080328...

This includes any granted Permissions, so in the crude example below, the script will lose the granted Debit permission over a restart if the script was not running at the time. Of course, if the script's owner isn't around to re-grant the permissions things get nasty.

A really good script would detect that it's unexpectedly lost permissions it had been previously granted. Most won't and will carry on regardless, which could be real nasty in the case of a script that thinks it has the Debit permission to (for example) pay out the prize in a competition.

Modified version of Counter script (I know this is crude :-) ):-

integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
        llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
        llGiveMoney(llGetOwner(),1);
    }
}
chorazin allen made changes - 10/Apr/08 08:38 PM
Affects Version/s 1.20.0 Server [ 10280 ]
lindenrobot made changes - 18/Apr/08 12:38 PM
Linden Lab Issue ID DEV-14012
Irene Ikarus made changes - 21/Apr/08 09:40 AM
Link This issue Relates to SVC-26 [ SVC-26 ]
Harleen Gretzky made changes - 21/Apr/08 11:49 AM
Link This issue duplicates SVC-26 [ SVC-26 ]
Harleen Gretzky made changes - 21/Apr/08 11:49 AM
Link This issue Relates to SVC-26 [ SVC-26 ]
Ralph Doctorow made changes - 20/Jul/08 12:23 PM
Link This issue is related to by SVC-2558 [ SVC-2558 ]
Scouse Linden made changes - 25/Jul/08 08:29 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Finish [ 2 ]
Scouse Linden made changes - 25/Jul/08 08:31 AM
Priority Critical [ 2 ] Low [ 5 ]
chorazin allen made changes - 31/Jul/08 12:24 AM
Link This issue is related to by SVC-2721 [ SVC-2721 ]
Periapse Linden made changes - 26/Sep/08 02:50 PM
Resolution Won't Finish [ 2 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Darien Caldwell made changes - 26/Sep/08 05:11 PM
Environment n/a - server-side issue on main grid Server-side issue on main grid
Affects Version/s 1.24 Server [ 10351 ]
Priority Low [ 5 ] Major [ 3 ]
Strife Onizuka made changes - 12/Oct/08 12:49 PM
Description Put two scripts in an object.

Script 1: Counter

integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
    }
}

Script 2 : Start/Stop

default
{
    state_entry()
    {
    }

    touch_start(integer total_number)
    {
        integer running=llGetScriptState("Counter");
        
        if (running)
        {
            llSetScriptState("Counter",FALSE);
            llOwnerSay("Script stopped");
        }
        else
        {
            llSetScriptState("Counter",TRUE);
            llOwnerSay("Script started");
        }
    }
}

Touch the object to see that the Counter script is started and stopped as expected. Let it run for a while, stop it, and note the last value displayed.

Now restart the region.

When the region is back, return to the object and touch it to restart the Counter.

The Counter script, which was stopped, has lost all state and will begin counting from 0 rather than the total it had previously.

Implications: This is a major headache for those situations where scripts would be stopped because they're not needed at the time or are stopped to reduce peformance impact. If a restart happens whilst they're stopped they do not resume in the same state that they were stopped.

---

Update 20080328...

This includes any granted Permissions, so in the crude example below, the script will lose the granted Debit permission over a restart if the script was not running at the time. Of course, if the script's owner isn't around to re-grant the permissions things get nasty.

A really good script would detect that it's unexpectedly lost permissions it had been previously granted. Most won't and will carry on regardless, which could be real nasty in the case of a script that thinks it has the Debit permission to (for example) pay out the prize in a competition.

Modified version of Counter script (I know this is crude :-) ):-

integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
        llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
        llGiveMoney(llGetOwner(),1);
    }
}
Put two scripts in an object.

{code:title=Counter}
integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
    }
}
{code}
{code:title=Start/Stop}
default
{
    state_entry()
    {
    }

    touch_start(integer total_number)
    {
        integer running=llGetScriptState("Counter");
        
        if (running)
        {
            llSetScriptState("Counter",FALSE);
            llOwnerSay("Script stopped");
        }
        else
        {
            llSetScriptState("Counter",TRUE);
            llOwnerSay("Script started");
        }
    }
}
{code}

Touch the object to see that the Counter script is started and stopped as expected. Let it run for a while, stop it, and note the last value displayed.

Now restart the region.

When the region is back, return to the object and touch it to restart the Counter.

The Counter script, which was stopped, has lost all state and will begin counting from 0 rather than the total it had previously.

Implications: This is a major headache for those situations where scripts would be stopped because they're not needed at the time or are stopped to reduce peformance impact. If a restart happens whilst they're stopped they do not resume in the same state that they were stopped.

---

Update 20080328...

This includes any granted Permissions, so in the crude example below, the script will lose the granted Debit permission over a restart if the script was not running at the time. Of course, if the script's owner isn't around to re-grant the permissions things get nasty.

A really good script would detect that it's unexpectedly lost permissions it had been previously granted. Most won't and will carry on regardless, which could be real nasty in the case of a script that thinks it has the Debit permission to (for example) pay out the prize in a competition.

Modified version of Counter script (I know this is crude :-) ):-
{code:title=Modified Counter}
integer count;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
        llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
    }
    
    timer()
    {
        count++;
        llOwnerSay((string)count);
        llGiveMoney(llGetOwner(),1);
    }
}
{code}
Sue Linden made changes - 13/Nov/08 12:07 PM
Workflow jira-2007-12-22a [ 53484 ] jira-2008-11-14 [ 81665 ]
Sue Linden made changes - 13/Nov/08 04:35 PM
Workflow jira-2008-11-14 [ 81665 ] jira-2008-11-14a [ 88718 ]
Harleen Gretzky made changes - 02/Jun/09 10:03 AM
Link This issue is original of duplicate SVC-4329 [ SVC-4329 ]
Harleen Gretzky made changes - 06/Jul/09 01:16 PM
Link This issue is original of duplicate SVC-4497 [ SVC-4497 ]
Strife Onizuka made changes - 13/Jul/09 11:59 AM
Link This issue parent of SVC-2721 [ SVC-2721 ]
Strife Onizuka made changes - 13/Jul/09 12:00 PM
Link This issue is related to by SVC-2721 [ SVC-2721 ]