Difference between revisions of "User:SignpostMarv Martin/LSL/SL NTPoHTTP v1.1 client"

From Second Life Wiki
Jump to navigation Jump to search
(added cat)
m (<lsl> tag to <source>)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<code><pre><nowiki>key http_id;
{{LSL Header}}
string timezone = "America/Los_Angeles"; // See http://uk.php.net/manual/en/timezones.php for full list of supported timezones.
<source lang="lsl2">
string format = "llGetWallClock"; // "llGetWallClock", "RFC 2822" and "ISO 8601" are the supported formats.
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
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 15: Line 20:
         }
         }
     }
     }
}</nowiki></pre></code>
}
</source>


[[Category:LSL Library|{{PAGENAME}}]]
 
{{LSLC|Library|SLNTP over HTTP}}
{{LSLC|Examples|SLNTP over HTTP}}

Latest revision as of 17:03, 24 January 2015

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);
        }
    }
}