Difference between revisions of "User:SignpostMarv Martin/LSL/SL NTPoHTTP v1.1 client"
Jump to navigation
Jump to search
Huney Jewell (talk | contribs) m (Add tags to show entry in TOC) |
|||
Line 1: | Line 1: | ||
{{LSL Header}} | {{LSL Header}} | ||
== NTP over HTTP v1.1 == | |||
<code><pre><nowiki>key http_id; | <code><pre><nowiki>key http_id; | ||
string timezone = "America/Los_Angeles"; // See http://uk.php.net/manual/en/timezones.php for full list of supported timezones. | string timezone = "America/Los_Angeles"; // See http://uk.php.net/manual/en/timezones.php | ||
string format = "llGetWallClock"; // "llGetWallClock", "RFC 2822" and "ISO 8601" are the supported formats. | // for full list of supported timezones. | ||
string format = "llGetWallClock"; // "llGetWallClock", "RFC 2822" and "ISO 8601" | |||
// are the supported formats. | |||
default | default | ||
{ | { | ||
state_entry() | state_entry() | ||
{ | { | ||
http_id = llHTTPRequest("http://services.slopenid.net/SLNTPoHTTP/" + llEscapeURL(format) + "/" + (string)llGetUnixTime() + "/" + timezone + "/",[],""); | http_id = llHTTPRequest("http://services.slopenid.net/SLNTPoHTTP/" + llEscapeURL(format) + "/" | ||
+ (string)llGetUnixTime() + "/" + timezone + "/",[],""); | |||
} | } | ||
http_response(key q,integer s,list m,string r) | http_response(key q,integer s,list m,string r) | ||
Line 20: | Line 23: | ||
[[Category:LSL Library|{{SUBPAGENAME}}]] | [[Category:LSL Library|{{SUBPAGENAME}}]] | ||
{{LSLC|Library}}{{LSLC|Examples}} | |||
{{#vardefine:sort|NTP over HTTP v1.1}} |
Revision as of 03:59, 7 September 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
NTP over HTTP v1.1
key http_id;
string timezone = "America/Los_Angeles"; // See http://uk.php.net/manual/en/timezones.php
// for full list of supported timezones.
string format = "llGetWallClock"; // "llGetWallClock", "RFC 2822" and "ISO 8601"
// are the supported formats.
default
{
state_entry()
{
http_id = llHTTPRequest("http://services.slopenid.net/SLNTPoHTTP/" + llEscapeURL(format) + "/"
+ (string)llGetUnixTime() + "/" + timezone + "/",[],"");
}
http_response(key q,integer s,list m,string r)
{
if(q == http_id)
{
llOwnerSay(r);
}
}
}