ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
avatar_delete problem (Sdk)
avatar_delete problem // Sdkwalter knupeJan 1, 1999, 8:23pm
Roland,
for my bots i use a internal list of the people around it. It uses the avatar_add() and avatar_delete() event to keep the list up to date. As soon as i run a multi-instance application the aw_avatar_delete seems to get inaccurate. It reports the name aw_string(AW_AVATAR_NAME) of people which are still there, and skips the one that left. To rule out that this was a bug in my rather complex bot program, i created a very simple multi-instance bot, and it did was to put 2 bots on the same spot in awgames, and have each of them announce arrivals and departures... and even that small application did exhibit that odd behaviour. The error does not occur all the times, but, i'd say in one out of 10 cases. And it seems to me that its dependand of the happenings in beetween, so that i have the following theory... Successfull case: bot1: receives a "av_test" leave event, and announces it correctly bot2: receives a "av_test" leave event, and announces it correctly Unsuccessfull case: bot1: receives a "av_test" leave event (some things happen inbetween, say "av_test_2" talking or moving, while bot1 evaluates the event) bot1: and announces it correctly bot2: gets the same event, but with the name "av_test_2". bot2: announces "av_test_2 has left" and never realizes that "av_test" left so i think that any other incoming event overwrites the string that aw.dll was about to dispatch to the second bot. (second in regard to event dispatch order) while the first bot uses "aw_say()" and therefore gives control to aw.dll, that dll sorts out events and accidently puts the string into the wrong place. for example, is it a problem when a bot, inside of a event callback function, uses a aw.dll function that talks to the server ? (like aw_say()) ? thats what i observed, i can supply the sample c++ code if neccessary Walter roland vilettJan 2, 1999, 12:31am
Are you on the latest build of the SDK? There was a bug with AW_AVATAR_NAME
in multi-instance applications but it was fixed several builds ago. -Roland [View Quote] walter knupeJan 2, 1999, 7:59am
Yes, it uses the latest build, Build 12, and yes i realize that there was
another problem which was fixed. But this one is not yet fixed, i am just not sure if theres just another way to deal with avatar_delete() to avoid it. Walter Roland Vilett schrieb in Nachricht <368d84ae.0 at homer>... >Are you on the latest build of the SDK? There was a bug with AW_AVATAR_NAME >in multi-instance applications but it was fixed several builds ago. > >-Roland > [View Quote] walter knupeJan 4, 1999, 1:35pm
Rolan, did you get a chance to look into this yet ?
Walter Walter Knupe schrieb in Nachricht <368dee6a.0 at homer>... >Yes, it uses the latest build, Build 12, and yes i realize that there was >another problem which >was fixed. > >But this one is not yet fixed, i am just not sure if theres just another way >to deal with avatar_delete() to avoid it. > > >Walter > > > >Roland Vilett schrieb in Nachricht <368d84ae.0 at homer>... >AW_AVATAR_NAME >to >created same >left aw.dll aw.dll, >aw_say()) > > edward sumerfieldJan 4, 1999, 2:22pm
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html> Why do you need the name at this point? <p>I use the session number to track which avatar has "changed" or "deleted" and index into my list with that. I retrieve the name in the "add" event handler and store it in the list with the rest of the information about the avatar. Names don't change so there is no point re-getting them from the SDK. <p>Edward Sumerfield. [View Quote] walter knupeJan 4, 1999, 4:44pm
This is a multi-part message in MIME format.
------=_NextPart_000_002D_01BE381A.97446660 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable You are correct.. i'll change the code to remember session numbers and = use those to clear entries from my list when ppl leave... why didn't i think of that ? :) Walter Edward Sumerfield schrieb in Nachricht = <3690EAC6.DD8B3E39 at poboxes.com>... Why do you need the name at this point?=20 I use the session number to track which avatar has "changed" or = "deleted" and index into my list with that. I retrieve the name in the = "add" event handler and store it in the list with the rest of the = information about the avatar. Names don't change so there is no point = re-getting them from the SDK.=20 Edward Sumerfield.=20 ------=_NextPart_000_002D_01BE381A.97446660 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"> <HTML> <HEAD> <META content=3Dtext/html;charset=3Diso-8859-1 = http-equiv=3DContent-Type><!doctype html public "-//w3c//dtd html 4.0 = transitional//en"> <META content=3D'"MSHTML 4.72.3511.1300"' name=3DGENERATOR> </HEAD> <BODY bgColor=3D#b8b8b8> <DIV><FONT color=3D#000000 face=3DArial size=3D2>You are correct.. i'll = change the=20 code to remember session numbers and use those to</FONT></DIV> <DIV><FONT face=3DArial size=3D2>clear entries from my list when ppl=20 leave...</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>why didn't i think of that ? = :)</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Walter</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: = 5px"> <DIV>Edward Sumerfield<ESUMERFD at POBOXES.COM> schrieb in Nachricht = <<A=20 = href=3D"mailto:3690EAC6.DD8B3E39 at poboxes.com">3690EAC6.DD8B3E39 at poboxes.c= om</A>>...</DIV>Why=20 do you need the name at this point?=20 <P>I use the session number to track which avatar has = "changed" or=20 "deleted" and index into my list with that. I retrieve the = name in=20 the "add" event handler and store it in the list with the = rest of=20 the information about the avatar. Names don't change so there is no = point=20 re-getting them from the SDK.=20 <P>Edward Sumerfield.=20 <P> </P></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_002D_01BE381A.97446660-- edward sumerfieldJan 4, 1999, 5:13pm
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html> <body bgcolor="#B8B8B8"> The downside, of coarse, is session recovery because the session ID changes with each line bounce. When the WORLD_DISCONNECT event arrives one can delete all the entries in the list and start again but this removes all possibility of retaining avatar context across line crashes. <p>Say I want to maintain my robots conversation with someone across a line crash. From their point of view my robot might disappear for a few seconds but when the line is back up and the robot returns I would like to be able to pick up the conversation from where I left off with something like, "I seem to be having problems with my line but let me answer your last question.". <p>So, the upshot of all this is that using session number only to identify an avatar is not enough. I would envision having a WORLD_DISCONNECT event handler that just set a line_down flag. Then when the robot receives a delete event it can get the session number (which will have changed) and check the flag. If set it must be able to retrieve the name to do an extra check of ownership before deleting. <p>The delete event is easy because it just means that the avatar info gets removed from the list but if a change event comes in I would like to change the old session number for the new one so that when the next change event arrives I can correctly id the avatar info. [View Quote] </body> </html> roland vilettJan 5, 1999, 5:07am
No. I could not reproduce it. I'm probably not going to look at this for a
while because I'm working on getting 2.1 ready for beta now. -Roland [View Quote] decastro@cable.a2000.nl (xelag)Jan 5, 1999, 11:01am
Walter, the method I use is similar to yours in a way: be both recover
the citizen numbers of citizens. For citizens, the line crash is unimportant, re-identification takes place anyway. The same applies if they change names. The problem does remain for tourists and bots. For bots (and for citizens too) I would advocate automatic receipt of another attribute, the citizen number (of the owner of the bot in the case of bots). This would solve other ID problems with bots mentioned in earlier threads. For maintaining the lists, I use the session number exclusively (except for adding the cit.num. when it arrives, that goes by name). I have not experienced any problems since the 'fix' of avatar delete, except for a bug I had in my own code. XelaG. On Mon, 4 Jan 1999 19:44:06 +0100, "Walter Knupe" <wak at faber.ping.de> [View Quote] >You are correct.. i'll change the code to remember session numbers and use those to >clear entries from my list when ppl leave... > >why didn't i think of that ? :) > >Walter > > Edward Sumerfield schrieb in Nachricht <3690EAC6.DD8B3E39 at poboxes.com>... > Why do you need the name at this point? > I use the session number to track which avatar has "changed" or "deleted" and index into my list with that. I retrieve the name in the "add" event handler and store it in the list with the rest of the information about the avatar. Names don't change so there is no point re-getting them from the SDK. > > Edward Sumerfield. > > |