Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Dataserver question

Chris Widget
Widget Isles @ the Edge!
Join date: 22 Jan 2006
Posts: 67
12-07-2006 11:09
OK I am sure this really simple and I just can't get it through my head but here goes. in one function I have the following :

CODE

result = linknum; // well say 99 for the purposes here
result = llRequestAgentData(id, DATA_ONLINE);


then in my dataserver event I have the following :

CODE

dataserver(key queryid, string data)
{
llMessageLinked((integer)queryid, data , str, id) ;
}



As you can see I am attempting to use my queryid as an indicator around which prim the llMessageLinked should be sent. My question is will the queryid actually be a 99 or will it be some other number?
_____________________
---
Chris Widget
Non
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
12-07-2006 11:19
llRequestAgentData returns a key, which identifies the dataserver query you send. The queryid that the dataserver event returns should match it. This is so that you can send more than one query and then identify which response to which query you're actually getting. (In practice I've found doing this flakey and I always wait for dataserver results.)

It's not relevant to any sort of link number to send a link message to - for a start, it's a key, not an integer. That llMessageLinked call looks a little borked in general actually - it should be in the format

CODE
llMessageLinked(integer link_number, integer n, string message, key id);


where n, message and id are data that you are trying to pass to scripts in link_number. What are "str" and "id" there? "data" is not an integer... and so on.

I hope that helps; I'm not sure quite what you're trying to achieve so it's hard to go any deeper.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
12-07-2006 11:21
the link number will not be sent in the message, it just directs which prim (or set of prims) the message is sent to

llMessageLinked(integer linknum, integer num, string str, key id)
linknum = which prim message is sent
num = any valid whole number (not uuids or anything else)
str = and string you want
id = any uuid you want

in your case it would look something like ....
llMessageLinked(99,0,data,querryid);

on the other end
link_message(integer sender_num, integer num, string str, key id)

sender_num = which prim sent the message
num = the integer you sent
string = the string you sent
id = the uuid you sent
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-07-2006 11:23
From: Chris Widget
OK I am sure this really simple and I just can't get it through my head but here goes. in one function I have the following :

CODE

result = linknum; // well say 99 for the purposes here
result = llRequestAgentData(id, DATA_ONLINE);


then in my dataserver event I have the following :

CODE

dataserver(key queryid, string data)
{
llMessageLinked((integer)queryid, data , str, id) ;
}



As you can see I am attempting to use my queryid as an indicator around which prim the llMessageLinked should be sent. My question is will the queryid actually be a 99 or will it be some other number?


It will be a key not a number. Check the wikki!

What precisely are you tring to do? Just store the linknum seperately. If you are using multiple queries then store the queryid and link number as a pair, i.e. looking up one will give you the index to the other.
Chris Widget
Widget Isles @ the Edge!
Join date: 22 Jan 2006
Posts: 67
12-07-2006 11:30
Thanks for the replies everyone. I think I have it figured out now.
_____________________
---
Chris Widget
Non