Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

controlling the dataserver

Dragon Keen
Registered User
Join date: 24 Apr 2006
Posts: 245
07-28-2006 23:19
is there a way to control the data server?

say i have a list of keys saved, and i'd like to get agent names (no longer in the sim so using the dataserver is required)

i want to check keys in a loop, with a counter... so when i do :
query = llRequestAgentData(userkey, DATA_NAME);

multiple times and use a tracking variable loop counter X, x is always the same since the dataserver doesnt wait for the rest of the code

dataserver(key queryid, string data)
{

if (query == queryid) llOwnerSay(data + " at " + (string)x);

}

it always returns the keys, but x is always the same number... any suggestions on how to wait for a result from the dataserver before the loop continues?
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
07-29-2006 00:05
Distribute your loop over the dataserver event. Do this by making a llRequestAgentData call, and replacing the key in the list with the returned dataserver query id. Then in the dataserver event, look for the saved query id and replace it with the username, then get the next userid and make another llRequestAgentData call. If you've reached the end of the list, then you're all done.
Easy.
Dragon Keen
Registered User
Join date: 24 Apr 2006
Posts: 245
07-29-2006 00:22
hmmme easy... lol for some reason thats greek to me ;)

i tried mucking around with it a bit more... i dont think im understanding

EDIT : Thanks for talkin to me in world-- all fixed up