|
Dytska Vieria
+/- .00004™
Join date: 13 Dec 2006
Posts: 768
|
12-27-2007 14:17
In this thread: /139/fa/105821/1.htmlAnd this thread: /54/ee/107278/1.htmlIs talk about first implementing LSL function to get key from an avatar name and second is off-world website to get information. Is there still no name2key function in LSL? If so, is there a JIRA request to put some votes on for it? Thank you!
_____________________
+/- 0.00004
|
|
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
|
12-27-2007 15:11
there is not currently a name2key function in LSL, however there are ways around this with llHTTPRequest. The special people at w-hat.com have made a database of peoples' UUIDs and names to allow this function to work. Not everyone is in there, but a lot of people are. refer to them for what you are looking for. they even provide you the LSL scripting needed to implement this into your scripting
|
|
Dytska Vieria
+/- .00004™
Join date: 13 Dec 2006
Posts: 768
|
12-27-2007 16:02
I have the script working most of the time, however sometimes there is a problem that sometimes in dataserver, the QueryID does not match the key from llRequestAgentData in the http_response event and sometimes the AVKeyRequest key does not match the request_id in http_response! It is not NULL_KEY, but some other key! Here are snippits of code with much removed for clarity. Maybe I do something wrong - such as not supposed to trigger events inside events? It would be so much easier to simply have something like: llInstantMessage(llName2Key(Name),"Hello"  ; Instead of all this and more! for (j=0; j < llGetListLength(NotifyList); j++) { AVSearchName = llList2String(NotifyList,j); AVKeyRequest = llHTTPRequest(AVKeyQueryURL + "=" + llEscapeURL(AVSearchName), [], ""); }
dataserver(key QueryID, string Data) { if (QueryID == AVQuery) { if (Data == "1" || IMOffline == TRUE) { llInstantMessage(AVNotifyKey, IMMessage); } } }
http_response(key request_id, integer status, list metadata, string body) { if (request_id == AVKeyRequest) { list temp = llCSV2List(body); if ((integer) llList2String(temp, 1) != -1) { AVNotifyKey = (key) llList2String(temp,1); AVQuery = llRequestAgentData(AVNotifyKey, DATA_ONLINE); } } }
_____________________
+/- 0.00004
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-28-2007 01:32
just a fun thing I tried, it doesn't work (it needs an intermediate proxy to work) integer gIntWorkCode = 42; string gStrSearchUrl = "?q=world.secondlife.com/resident/ intitle:\"";
default{ state_entry(){ //-- added for testing to show it was running llOwnerSay( gStrSearchUrl ); } link_message( integer vIntSender, integer vIntWorkCode, string vStrName, key vKeyAvatar ){ if (gIntWorkCode == vIntWorkCode){ llHTTPRequest( "http://secondlife.com/app/search/search.php" + llEscapeURL( gStrSearchUrl + vStrName ) + "\"", [HTTP_METHOD, "GET"], "" ); } }
//-- touch is just for testing purposes touch_start( integer vNull ){ llOwnerSay( "Touched" ); llHTTPRequest( "http://secondlife.com/app/search/search.php" + llEscapeURL( gStrSearchUrl + llDetectedName( 0 ) ) + "\"" , [HTTP_METHOD, "GET"], ""); }
http_response(key request_id, integer status, list metadata, string vStrData){ key vKeyReturn; integer vIntIndex = llSubStringIndex( vStrData, "\"><span class=\"l\"><b>" ); if (~vIntIndex){ vKeyReturn = llGetSubString( vStrData, vIntIndex - 37, vIntIndex -1 ); }else{ vKeyReturn = "Not Found"; } llMessageLinked( LINK_THIS, 0, "", vKeyReturn ); llOwnerSay( (string)vKeyReturn );
//-- added to test to show what was returned by the request llOwnerSay( vStrData ); } }
currently you'll get nothing back, with a message about cache control. I'm presuming this means LL blocked access from the Sim servers to the main website, since this is where script http requests originate from (unlike search from the viewer which originates from your local machine. instead of calling the search directly, you could pass it to a proxying server, which then makes the request on the actual address for you. that should eliminate any blocking. you could also use a php enabled server to get and parse the page for you, both solutions are viable... I'd demonstrate it, but opening up my own personal server for this would cause too much problem on my currently limited bandwidth if alot of people wanted to play with it, and worse some might errantly rely on it... the above is provided solely as something individuals can play with and see, and maybe someone will pass the idea along to the various name2key database providers, as this should most likely eliminate their need to store av keys at all... at the overhead cost of making/parsing the request.... or at the very least it could be used on a per case basis to add to their database if space is less of an issue than proccessing time
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|