Difference between revisions of "Dataserver"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 13: Line 13:
! colspan="4" {{!}} Description
! colspan="4" {{!}} Description
{{!}}-
{{!}}-
{{!}} colspan="3" {{!}} {{LSLG|llGetNotecardLine}}
{{!}} colspan="3" {{!}} [[llGetNotecardLine]]
{{!}} {{LSLG|string}}
{{!}} {{LSLG|string}}
{{!}} colspan="4" {{!}} The line in the requested notecard, limited to 255 bytes.<br/>If {{LSLG|EOF}} the line requested is past the end of the notecard.
{{!}} colspan="4" {{!}} The line in the requested notecard, limited to 255 bytes.<br/>If {{LSLG|EOF}} the line requested is past the end of the notecard.
{{!}}-
{{!}}-
{{!}} colspan="3" {{!}} {{LSLG|llGetNumberOfNotecardLines}}
{{!}} colspan="3" {{!}} [[llGetNumberOfNotecardLines]]
{{!}} ({{LSLG|integer}})
{{!}} ({{LSLG|integer}})
{{!}} colspan="4" {{!}} The number of lines in the notecard requested.
{{!}} colspan="4" {{!}} The number of lines in the notecard requested.
{{!}}-
{{!}}-
{{!}} rowspan="7" {{!}} {{LSLG|llRequestAgentData}}
{{!}} rowspan="7" {{!}} [[llRequestAgentData]]
{{LSL Constants/llRequestAgentData}}
{{LSL Constants/llRequestAgentData}}
{{!}}-
{{!}}-
{{!}} {{LSLG|llRequestInventoryData}}
{{!}} rowspan="1" {{!}} [[llRequestInventoryData]]
{{!}} colspan="2" {{!}} Landmark
{{LSL Constants/llRequestInventoryData}}
{{!}} ({{LSLG|vector}})
{{!}} colspan="4" {{!}} global_position_of_landmark = {{LSLG|llGetRegionCorner}}() + (vector)data;
{{!}}-
{{!}}-
{{!}} rowspan="9" {{!}} {{LSLG|llRequestSimulatorData}}
{{!}} rowspan="9" {{!}} [[llRequestSimulatorData]]
{{LSL Constants/llRequestedSimulatorData}}
{{LSL Constants/llRequestedSimulatorData}}
{{!}}}
{{!}}}

Revision as of 01:44, 9 August 2007

Description

Event: dataserver( key queryid, string data ){ ; }

Triggered when task receives asynchronous data

• key queryid matches the return of the requesting function
• string data the requested data (cast as a string as necessary).
Function Input Decode Description
llGetNotecardLine string The line in the requested notecard, limited to 255 bytes.
If EOF the line requested is past the end of the notecard.
llGetNumberOfNotecardLines (integer) The number of lines in the notecard requested.
llRequestAgentData 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.
llRequestInventoryData Landmark (vector) The vector data received by dataserver is a global position as an offset from the current region's origin (<0,0,0>). To obtain the absolute global position of a landmark, add llGetRegionCorner() to the vector.
llRequestSimulatorData DATA_SIM_POS 5 (vector) The regions global position.
DATA_SIM_STATUS 6 string Value Description
"up" region currently up and running
"down" region currently down
"starting" region currently starting
"stopping" region currently stopping
"crashed" region has crashed
"unknown" region status unknown or unknown region
DATA_SIM_RATING 7 string Value Maturity rating
"PG" Parcel lght G.png General
"MATURE" Parcel lght M.png Moderate
"ADULT" Parcel lght A.png Adult
"UNKNOWN" rating or region unknown

Caveats


Examples

key kQuery;
integer iLine = 0;
default {
    
    state_entry() {
        llSay(0, "Reading notecard...");
        kQuery = llGetNotecardLine("My Notecard", iLine);
    }

    dataserver(key query_id, string data) {

        if (query_id == kQuery) {
            // this is a line of our notecard
            if (data == EOF) {    

                llSay(0, "No more lines in notecard, read " + (string)iLine + " lines.");

            } else {

                // increment line count
                llSay(0, "Line " + (string)iLine + ": " + data);
                
                //request next line
                ++iLine;
                kQuery = llGetNotecardLine("My Notecard", iLine);

            }
        }
    }
}

Deep Notes

Signature

event void dataserver( key queryid, string data );