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

From Second Life Wiki
Jump to navigation Jump to search
(Brushed up and changed sort word)
Line 1: Line 1:
{{LSL Header}}
{{LSL Header}}
== NTP over HTTP v1.1 ==
== NTP over HTTP v1.1 ==
<code><pre><nowiki>key http_id;
<lsl>
key http_id;
string timezone = "America/Los_Angeles"; // See http://uk.php.net/manual/en/timezones.php  
string timezone = "America/Los_Angeles"; // See http://uk.php.net/manual/en/timezones.php  
                                         // for full list of supported timezones.
                                         // for full list of supported timezones.
Line 20: Line 21:
         }
         }
     }
     }
}</nowiki></pre></code>
}
</lsl>


[[Category:LSL Library|{{SUBPAGENAME}}]]
 
{{LSLC|Library}}{{LSLC|Examples}}
{{LSLC|Library|NTP over HTTP}}
{{#vardefine:sort|NTP over HTTP v1.1}}
{{LSLC|Examples|NTP over HTTP}}

Revision as of 07:33, 11 December 2007

NTP over HTTP v1.1

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

} </lsl>