Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llHTTPRequest server side scripting

Quince Farber
Registered User
Join date: 14 Jan 2005
Posts: 9
05-17-2006 16:40
hi I was wondering if any one has a good example of the script that would be used by a server to handle a sls llHTTPRequest. I'm excited by the possibility of storing / accessing data out side of sl. But I've never used html post/get before, I"m not sure if I should be using php + mySQL, or some other mix, cgi + mySQL, extra. Quick and easy development is important.
Sator Canetti
Frustrated Catgirl
Join date: 20 Sep 2005
Posts: 130
05-18-2006 13:04
From: Quince Farber
hi I was wondering if any one has a good example of the script that would be used by a server to handle a sls llHTTPRequest. I'm excited by the possibility of storing / accessing data out side of sl. But I've never used html post/get before, I"m not sure if I should be using php + mySQL, or some other mix, cgi + mySQL, extra. Quick and easy development is important.


Whichever language/storage you prefer that can manage post/get data should be sufficent.
_____________________
"Have gone to commit suicide. Intend to return from grave Friday. Feed cat." -- A memo by Spider Jerusalem in Transmetropolitan

"Some people are like Slinkies; not really good for anything, but they still bring a smile to your face when you push them down a flight of stairs."

If you're reading this signature, I've probably just disagreed with you. Welcome to the club :D
Quince Farber
Registered User
Join date: 14 Jan 2005
Posts: 9
05-18-2006 18:46
Well I was hoping for the formating. A working demo, gose a long way to learning how some thing works.
Nekosune Smails
Registered User
Join date: 8 Apr 2006
Posts: 3
05-22-2006 18:18
www.irresponsiblecybernetics.com/~nekosune/where.php just shows wwhere I am on the preview updating every 5 min

Here is the LSL code I used :
CODE

default
{
state_entry()
{
llSetTimerEvent(300);
}

touch_start(integer total_number)
{
llSay(0, "Touched.");
}
timer()
{
llHTTPRequest("http://www.irresponsiblecybernetics.com/~nekosune/is.php",[],"");
}
}




and here is the php code I used for the URL the script calls
CODE

<?
$fp=fopen("loc.txt","w");
$region=$HTTP_X_SECONDLIFE_REGION;
$location=$HTTP_X_SECONDLIFE_LOCAL_POSITION;
$reg=explode(" ",$region);
$region=$reg[0];
fputs($fp,$region.$location);
?>



all where.php does is read out loc.txt
Auris Surface
Registered User
Join date: 7 Jun 2005
Posts: 9
About llHTTPRequest restrictions ...
05-25-2006 02:37
From: Nekosune Smails
www.irresponsiblecybernetics.com/~nekosune/where.php just shows wwhere I am on the preview updating every 5 min

Here is the LSL code I used :
CODE

default
{
state_entry()
{
llSetTimerEvent(300);
}

touch_start(integer total_number)
{
llSay(0, "Touched.");
}
timer()
{
llHTTPRequest("http://www.irresponsiblecybernetics.com/~nekosune/is.php",[],"");
}
}




and here is the php code I used for the URL the script calls
CODE

<?
$fp=fopen("loc.txt","w");
$region=$HTTP_X_SECONDLIFE_REGION;
$location=$HTTP_X_SECONDLIFE_LOCAL_POSITION;
$reg=explode(" ",$region);
$region=$reg[0];
fputs($fp,$region.$location);
?>



all where.php does is read out loc.txt



I would like to ask in wiki(http://secondlife.com/badgeo/wakka.php?wakka=llHTTPRequest) it is written :
----
You can do a maximum of 20 consequtive requests, after that no more requests can be done for a time. One request per 4 seconds seem to be safe.
----
and
----
HTTP requests made using llHTTPRequest are throttled based on the script owner making the requests. The limitiation seems to be per region also.
----

did you encountered some limitation from practical side during using this script? for how long are you using this script?
Also I want to ask, how do you make this script work all time? is it working in some object, that you are always wearing while in world?
thanx in advance
Anna Bobbysocks
Registered User
Join date: 29 Jun 2005
Posts: 373
05-25-2006 03:41
sure hope they have a gridwide throttle of somesort.
SiRiS Asturias
Chaotic Coder
Join date: 27 Sep 2005
Posts: 93
06-12-2006 07:18
They do have a pretty restrictive throttling:

/20/d4/96884/4.html#post1068764/20/d4/96884/4.html#post1068764

Enjoy! :p
_____________________
Proud founder of:
S3 - Self Storage Systems
S3storage.net (Coming Soon!)

SLBoutique.com
SLExchange.com - Find What You Need, When You Need It.

"Light travels faster than sound. This is why some people appear bright, until you hear them speak."