15 Apr 2006

llHTTPRequest pt 2

Filed under: Scripting, General SL Stuff — Stella Trenchmouth @ 1:50 am

My new favorite LSL function just popped up on the preview grid yesterday and I’ve been going nuts with it. I’ve already worked out the basics of a nice request handler class for PHP 5 to simplify service creation, a bit similar to how xajax handles itself. And it’s a bit more robust, falling back on email when the web response would be too long. Since 1) UTF-8 can be pretty hard to predict byte-wise, and 2) there’s a 2kb limit on http responses, it’ll try to convert the response to UTF-8 first and gauge whether to send via the response (under 2kb), or chop it up into object emails (a 1000 char limit) and only send a flag & the number of mails being sent over http. Theoretically, it’ll take size limitations completely out of the picture.

Haven’t fully tested it yet, but so far, it’s aces - extend the base class with a new method, pass a “method” parameter via the POST with it’s name, along with any parameters, and then it’s 2 lines of code to shoot it off. Rewriting my Eldora dilation tracker with this already, and have several other test scripts in my preview AVs inventory. Soon as it gets tuned up a bit (and i learn more details of in-world usage restrictions - # of requests per minute, caching, etc.), it’ll be released public. It’s strictly PHP5, but shouldn’t take much to work into PHP4 (might already work, but I don’t use PHP4 anymore to test).

As for the LSL side of things, there’s a lot to tweak. Handling multiple emails from a particularly large response in particular - so far, everything’s come back in order, but I expect it’s very possible to receive the emails out of order, and there’s no checking to make sure everything’s reassembled proper.

This stuff (web connectivity) is what drew me into SL, and it’s already changing everything. I can get to my world (which may or may not be a mysql database) from SL directly now through these little pseudo-services, not just over passive email. Keep a central store of item prices and have my vendors load them on_rez, or periodically update; have a prim check my RSS feeds for new posts; implement my own llName2Key() function; do some heavy string parsing or use real arrays and more than 16kb of memory space… There’s a whole lot in LSL that I just don’t bother with due to it’s limitations and, while will surely have it’s own limitations, it’ll be more controllable than a mess of laggy in-world scripts trying to fake it.

Anyway. Hopefully I’ll have this framework done by the time 1.9.1 hits the main grid. Expect it’ll be freely available here & in-world (maybe L$1 for metrics’ sake) around then.

Totally psyched.

30 Apr 2006

procrastination is hot

Filed under: Primpop Stuff — Stella Trenchmouth @ 2:44 am

Too much time spent:
1) playing with the awesome things in Suffugium (open soon)
2) playing with the awesome things in 1.9.1 Preview (llHTTPRequest()ing my floppy witches hat off under nice lights)
3) playing with Avimator, one of the best things to happen to SL

to have gotten anything *too* useful done. Currently rebuilding the junk shop in Eldora, going for a fitting car trunk shop. Getting a preliminary start on the SL “service” library in php5 mentioned previously, and then deciding it’d be better to wait out any major changes (and there’s no emailing from the preview grid, bit of a damper). Changing my dilation tracker to work for any sim i can drop an antenna in, and thusly breaking it. Generally just picking at things and drooling at others.

So here, I’ve cut you some (of my) slack:


(Just testing video, really. But on the off chance you’re all “GIMME CHAIR NOW,” they’re available in the Pp shops hidden in Eldora & Suffugium).

I’ve also made a set of blingy silver teeth caps, done up as a scripted gesture with a gang sign animation. I should probably be ashamed, but it really was funny the first few times. And that’s what it’s all a-bout, dih-din.


music is better