Codi Bliss
Born again newbie
Join date: 31 Dec 2004
Posts: 52
|
02-24-2005 16:47
Every so often I get a key listed on my list maker instead of an identified av. Under what circumstances does this happen and how can I identify who this key belongs too?
Can anyone help?
|
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
|
02-24-2005 16:54
I hit it occasionally myself. I believe it's when an avatar has just arrived in the sim, and hasnt yet been added to the sim's local name/key DB.
-Adam
|
Masakazu Kojima
ケロ
Join date: 23 Apr 2004
Posts: 232
|
02-24-2005 19:32
If you want to look up keys manually, you can use this script. Just drop it in a prim, and then click on it to activate it (it will turn green). Then just say "/1lookup (key)", eg: /1lookup a27b84f0-2757-4176-9579-43a181d4a5a0 When you're done, click it again to turn it off (it will turn red). Hopefully it's clear enough that you can adapt whatever you're using to fall back on llRequestAgentData() if llKey2Name() or llDetectedName() fail, though given the clunky interface, it's often more trouble than it's worth. // This code is public domain. // - CONFIGURATION - integer USE_IMS = TRUE; // if true, send IMs (3 second delay), if false, use whispers (no delay) vector COLOR_ACTIVE = <0,1,0>; // color when we are listening (<red, green, blue>, 0.0 - 1.0) vector COLOR_INACTIVE = <1,0,0>; // color when we are not listening integer LISTEN_CHANNEL = 1; // channel to listen for commands on string COMMAND_LOOKUP = "lookup"; // command to lookup a key float DATASERVER_TIMEOUT = 30.0; // how many seconds to wait for a response from the dataserver
// - GLOBAL VARIABLES - integer listen_id; // the id returned by llListen, so we can turn it on and off key query_id = NULL_KEY; // the query_id returned by llRequestAgentData, so we know what to wait for key agent_id = NULL_KEY; // the agent id we are looking up integer active = FALSE; // whether we're listening for commands or not
// set whether to listen for commands or not set_active(integer new_active) { active = new_active; if ( active ) { llSetColor( COLOR_ACTIVE, ALL_SIDES ); llListenControl( listen_id, TRUE ); } else { llSetColor( COLOR_INACTIVE, ALL_SIDES ); llListenControl( listen_id, FALSE ); } }
// IM or whisper the specified message, depending on USE_IMS say(string msg) { if ( USE_IMS ) llInstantMessage(llGetOwner(), msg); else llWhisper(0, msg); }
default { state_entry() { // create the listener listen_id = llListen(LISTEN_CHANNEL, "", NULL_KEY, ""); // off by default set_active(FALSE); } touch_start(integer num) { // if owner clicks, toggle active state if ( llDetectedKey(0) == llGetOwner() ) set_active(!active); } listen(integer channel, string name, key id, string msg) { // if it's not our owner, ignore them if ( id != llGetOwner() ) return; // look for the lookup command if ( llGetSubString( msg, 0, llStringLength(COMMAND_LOOKUP) - 1 ) == COMMAND_LOOKUP ) { // since we can only store one agent_id, we can only do one lookup at a time if ( query_id != NULL_KEY ) { say("query already in progess"); return; } // get the key from the message agent_id = (key)llGetSubString( msg, llStringLength(COMMAND_LOOKUP) + 1, -1 ); say( "Looking up " + (string)agent_id ); // request the agent's name query_id = llRequestAgentData( agent_id, DATA_NAME ); if (query_id == NULL_KEY) { // this should never happen say("error: llRequestAgentData() returned NULL query id"); return; } else { // since llRequestAgentData doesn't let us know if something was wrong, // we have to guess by timing out after a reasonable length of time. llSetTimerEvent(DATASERVER_TIMEOUT); llResetTime(); return; } } } dataserver(key qid, string data) { if ( qid != query_id ) { say("error: dataserver() received unrecognized query id, data: <" + data + ">"); return; }
// shut off the timer event as soon as possible, so another timer() event doesn't // get queued. reset the time too, just in case. llSetTimerEvent(0); llResetTime(); query_id = NULL_KEY; say( (string)agent_id + " = " + data ); } timer() { // sometimes timer() will fire at completely wrong times, so we double check. if ( llGetTime() < DATASERVER_TIMEOUT ) return; llSetTimerEvent(0); llResetTime(); query_id = NULL_KEY; say( "error: timeout waiting for response from dataserver. (invalid key?)" ); } }
|
Codi Bliss
Born again newbie
Join date: 31 Dec 2004
Posts: 52
|
02-25-2005 14:28
Thanx 
|