• 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-3254
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: Strife Onizuka
Votes: 10
Watchers: 4
Operations

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

LSL: CHANGED_REGION_START

Created: 16/Oct/08 08:48 PM   Updated: 18/Sep/09 08:39 PM
Component/s: Scripts
Affects Version/s: None
Fix Version/s: None

Issue Links:
Relates
 

Sub-Tasks  All   Open   
 Sub-Task Progress: 

 Description  « Hide
CHANGED_REGION_START would be a changed event flag that would allow scripts to detect when their containing region has been brought online.

This feature suggestion has another name, CHANGED_REGION_RESTART and was suggested in conjunction with SVC-1086. The problem with CHANGED_REGION_RESTART is that the name is a misnomer. Since the script isn't running during a restart there are two distinct events, the simulation being stopped and it being started. Restart is commonly accepted to mean an event where the time between stop and start is a short period (or it could be interpreted to mean that things are reset back to their initial state!) but the use of this event would be to indicate when a simulation was started. By using the _START nomenclature and not _RESTART, we can later add _STOP without causing confusion; additionally we can later also add _RESTART in conjunction with the _STOP as to tell the script that the interruption is only planned to be a short one.

To state it another way:

  • CHANGED_REGION_START - fired when a region comes online
  • CHANGED_REGION_STOP - fired a 30 seconds before the script is stopped before the region goes offline.
  • CHANGED_REGION_RESTART - fired in conjunction with CHANGED_REGION_STOP to indicate that the region will be back up shortly.

--------------------------

Edit:

  • CHANGED_REGION_START - fired when a region comes online
  • CHANGED_REGION_SHUTDOWN - fired a 30 seconds before the script is stopped before the region is shutdown.
  • CHANGED_REGION_CRASHED or CHANGED_REGION_HARD_SHUTDOWN - fired in conjunction with CHANGED_REGION_START to indicate that the region was brought down without CHANGED_REGION_SHUTDOWN.


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
kelly linden added a comment - 29/Oct/08 07:15 PM
I agree with the name change to CHANGED_REGION_START.

_RESTART is not currently feasible since regions simply do not know if they will be coming back.

_STOP I'm really hesitant about since the only time it would work is on a planned and pre-announced stop, even then I'm not sure how much knowledge the sim really has that it is shutting down. I suspect very little which may make this unduly difficult. Even then it wouldn't get every stop - crashes and immediate shut downs offer no time to give scripts extra cycles. I think the inconsistency would lead to scripter frustration.


Ilana Debevec added a comment - 29/Oct/08 08:48 PM
I agree that _RESTART would be darned near impossible and when you get down to it, what's the diff between _RESTART and _START

_STOP is another matter, if nothing else it could be triggered on the restart messages (5, 4, 3, 2, 1, seconds) for 'controlled' shutdowns, on a crash, yeah, no way to do that but...

does a sim know if it had crashed when it comes back up??? then a _CRASHED in addition to a _START could be useful (script: ok I'm gonna start up but oh crap I crashed, better check on a,b,c..etc..)


Strife Onizuka added a comment - 30/Oct/08 12:58 AM - edited
I like the _CRASHED idea. How about _SHUTDOWN instead of _STOP, no confusing a shutdown with a crash then.

This aspect is just pie in the sky, ideas thrown out to get us all thinking. My priority is to get the constant renamed before it hits the main grid (and we get stuck with it).


Gordon Wendt added a comment - 30/Oct/08 01:02 AM
It seems like everything except for _START have issues but even _START would be great to have.

Ilana Debevec added a comment - 01/Nov/08 04:10 PM
I think CHANGED_REGION_SHUTDOWN would better be triggered from the restart messages sent to the sim. Yes you would get one at 5,4,3,2,1 min, 45, 30, 15, etc seconds... just need to pass the 'countdown' to the event handler. Also somethign for 'shutdown cancelled' (-1 for the countdown) for the 'never mind' situations where a restart is cancelled/postponed.

kelly linden added a comment - 02/Feb/09 01:53 PM
I broke the constant name change of _RESTART to _START from the rest of this, since I can do that part now but not the rest.

Strife Onizuka added a comment - 01/Mar/09 09:59 AM
I have no problem with that. I saw the change hit the Trunk along with all of HTTP, I've updated the wiki accordingly (though some work is still needed on the individual pages). Good work all around, thanks for your efforts.

Vampaerus Wysznik added a comment - 18/Mar/09 06:41 AM
I think _START and _STOP is all that's needed. (I don't see a big diff between stop/shutdown I just like shorter words

but "crashed" and other anomalies can be determined by the scripter given just start and stop and a global variable. I'm alittle confused how it would be possible for a region to be started for the very first time and there be any scripted object already in it??? But if so, the script would receive only a START event and the global would be null. During scheduled maintenance, the script would receive a STOP and can set the global to indicate this. So when the script gets a START, if the global is set it knows it has just experienced a restart. The global could even store a timestamp to calculate if the restart was short lived. If a script receives a START and the global is anything other than the stop indicator, it knows a crash occurred and can attempt to figure out what to do about that. How to handle this condition would vary dramatically by the script's purpose. I don't think it is realistic to expect the server to issue a CRASHED event...seeing as it just crashed it may not have state for that.

At any rate, I would really really like to see at least one STOP event triggered by the "This server is going down in X minutes" mechanism. It would help with http-in in that your dyndns solution could be notified to switch to an "offline" page or fallback server. I assume vendor creators would also find it very valuable to temporarily suspend transactions during "iffy" periods.


Ilana Debevec added a comment - 18/Sep/09 08:39 PM
actually, I think just four(three) are needed

CHANGED_REGION_START
CHANGED_REGION_CRASHED
CHANGED_REGION_SHUTDOWN
CHANGED_REGION_SHUTDOWNCANCELLED

_START and _CRASH are an either/or... either the region is _STARTing after a normal shutdown or the region or _CRASHED and is coming up after an abnormal shutdown, you get one or the other, not both.

_SHUTDOWN comes at the 2 minute warning for a manual restart (since you can get either a 2 or 5 minute delay, choose the common one)

_SHUTDOWNCANCELLED is.. well, if you "DELAY" the restart LESS THAN 2 MINUTES BEFORE the restart goes off, you get a _SHUTDOWNCANCELLED.. since that one is, but you may get another one in an hour, which will give you the 2 minute warning _SHUTDOWN