Jump to content

llOpenRemoteDataChannel


Shihan Feiri
 Share

You are about to reply to a thread that has been inactive for 3381 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have recently written a long post in this forum about mysql-php-lsl communication with very concrete examples. Have a look at this discussion: http://community.secondlife.com/t5/LSL-Scripting/The-Impossible/td-p/2884582 and specifically at message 10 of eleven in this post.

As far as I know these are the only concrete examples available that use the updated PHP5 mysqli functions for the http_server LSL functions with "http-get". The method "http-get" requires less PHP scripting skills and is therefore easier to work with than the method "post".

Link to comment
Share on other sites

Thank you Estelle, but this is simple collecting data from database. I try to find working sample  wher you from web page manage inworld object.

For now, I'm still in dark with so manny "solution".

If someone have time to teach me this part inworld, I am open to arange this class.

Link to comment
Share on other sites

Edit: Script changed to contain link to this discussion. The body only shows the beginning of the header of the website, not the actual content of the website. So llRequestUrl seems to be indeed the better method.

I have never tested this but use one of the LSL scripts that I have in my examples. Change the link of the outgoing http-request the website that you want to read from.

Then in the the http-response event, read the body of the website.

Something like this:

 

key requestKey;



default
{
state_entry()
{
llSetText("Click to read website.",
<1.0,1.0,1.0>, 1.0);

}

on_rez(integer startParam)
{
llResetScript();
}

changed(integer change)
{
if (change & (CHANGED_OWNER))
llResetScript();
}


touch_end(integer int)
{

llSetText("Reading website", <1.0,0.0,0.0>, 1.0);

// start communication with database
string body = "";

//llEscapeURL is not really necessary but I have the habit to use it with all data I send to an URL
string URL = "http://community.secondlife.com/t5/LSL-Scripting/llOpenRemoteDataChannel/m-p/2887018/highlight/false#M26796";

//define a list to contain the parameters of the http request.
list parameters = [HTTP_METHOD, "GET"];

//send the request
requestKey = llHTTPRequest(URL, parameters, body);

//Use this for debugging:
//llOwnerSay(URL);

}

// Catching reply from webserver
http_response(key request_id, integer status, list metadata, string body)
{
if (request_id == requestKey)
llOwnerSay(body);



llSetText("Click to read website.",
<1.0,1.0,1.0>, 1.0);

}

}

 

Play with it, see what you get. Change the method to "post" [mainly a different parameter list) and see what you get.

Link to comment
Share on other sites

Most of the answers to your questions are in the link of your message:

"When a region is (re)started all HTTP server URLs are automatically released and invalidated"

"Removing the prim/script will release all URLs previous assigned."

From these statements I would deduct that all URLs are removed from the sim with a reset of the script. If this assumption is true, then the example on the page of llReleaseUrl does indeed not make sense.

llReleaseUrl seems to make only sense if you need several URLs for your script but you need only one of these URLs for a process. Then you call for each process the specific URL and release all others.

That is the only scenario, how llReleaseUrl would make sense to me.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3381 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...