Difference between revisions of "DATA ONLINE"

From Second Life Wiki
Jump to navigation Jump to search
m
m (<lsl> tag to <source>)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{LSL Constant
{{LSL Constant
|inject-1={{Issues/SVC-6831}}
|name=DATA_ONLINE
|name=DATA_ONLINE
|type=integer
|type=integer
Line 7: Line 8:
|text=
|text=
|pb=
|pb=
|examples
|examples=<source lang="lsl2">key queryID; // the id key
 
default
{
    state_entry()
    {
        key id = llGetOwner(); // get the owner key
        queryID = llRequestAgentData( id, DATA_ONLINE ); // returns if the owner is online or not
    }
   
    dataserver( key query, string info )
    {
        // find the correct query id
        if( query == queryID )
        {
            string message;
           
            // convert the info to an actual message
            if( info == "1" )
            {
                message = "Online";
            }
           
            else if( info == "0" )
            {
                message = "Offline";
            }
           
            // display that they are online or offline in owner say.
            llOwnerSay( "The owner of this object is: " + message );
        }
    }
}</source>
|constants=
|constants=
{{!}}
{{!}}

Latest revision as of 14:31, 23 January 2015

Description

Constant: integer DATA_ONLINE = 1;

The integer constant DATA_ONLINE has the value 1

Used with llRequestAgentData to return a string that contains the integer boolean for if the user is online (or not). TRUE if online, FALSE if offline.

Caveats


Related Articles

Constants

DATA_ONLINE 1 (integerboolean If the requested agent is online
DATA_NAME 2 string The requested agent's legacy name
DATA_BORN 3 string The account creation/"born on" date as a string in an ISO 8601 format of YYYY-MM-DD.
DATA_RATING 4 llCSV2List() Deprecated: Returns [0, 0, 0, 0, 0, 0]
Used to return: [pos_behavior, neg_behavior, pos_appearance, neg_appearance, pos_building, neg_building]
DATA_PAYINFO 8 (integermask Flag Description
PAYMENT_INFO_ON_FILE 0x1 If payment info is on file.
PAYMENT_INFO_USED 0x2 If payment info has been used.

Functions

•  llRequestAgentData

Events

•  dataserver

Examples

key queryID; // the id key 

default
{
    state_entry()
    {
        key id = llGetOwner(); // get the owner key
        queryID = llRequestAgentData( id, DATA_ONLINE ); // returns if the owner is online or not
    }
    
    dataserver( key query, string info )
    {
        // find the correct query id
        if( query == queryID )
        {
            string message;
            
            // convert the info to an actual message
            if( info == "1" ) 
            {
                message = "Online";
            }
            
            else if( info == "0" )
            {
                message = "Offline";
            }
            
            // display that they are online or offline in owner say.
            llOwnerSay( "The owner of this object is: " + message );
        }
    }
}

Deep Notes

All Issues

~ Search JIRA for related Issues
   llRequestAgentData with DATA_ONLINE parameter has a delay of up to 10 minutes in reporting offline status

Signature

integer DATA_ONLINE = 1;