Logoff

From Second Life Wiki
Jump to navigation Jump to search
Emblem-important-yellow.png LSL Feature Request
The described event does not exist. This article is a feature request.

Description

Event: logoff( ){ ; }

logoff() Sent as a result of the user quitting the Second Life client/viewer


Specification

Currently there is no way to tell if a logs off from Second Life other than a CONSTANT online status check. This impedes the ability of external data services that serve other users as well

Caveats

This function would require another few seconds to execute before the client shuts down in order to execute.


Examples

<lsl> default {

   on_rez(integer start_param)
   {
       llResetScript();
   }
   state_entry()
   {
       llHTTPRequest("http://www.example.com/online.php?key="+(string)llGetOwner()+"&online=TRUE",[],"");
   }
   logoff()
   {
       llHTTPRequest("http://www.example.com/online.php?key="+(string)llGetOwner()+"&online=FALSE",[],"");
   }

} </lsl>

Deep Notes

Signature


Comments

If the simulator crashes, the event still won't get called (nor will attach). As a way of detecting user disconnect, this doesn't cover all the bases. That said, why should a script be giving this information? A user may not want the script to be able to track them. I consider this to be pretty invasive. -- Strife (talk