ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Bot logout/login (Sdk)
Bot logout/login // Sdkdm mercuryAug 18, 2003, 5:48am
I have been observing my bot in .NET and noticed that it seems to enjoy
appearing to log out of the world fora brief moment and then log itself back in. When watching the bot it is in the world does the greet people etc... then while idle it seems to just log out(avatar disappears). After a random amount of time the bot seems to just log back in (does the greet people stuff again). I was wondering if anyone had experienced this problem in .net and what the solution may be. If it wants to log out like that it is fine if there is a particular sdk event for such an occurance. So my question is how can this be resolved with or without a sdk event? DM baronAug 18, 2003, 8:42am
In article <3f4084c0$1 at server1.Activeworlds.com>, dmmercury at houston.rr.com says...
> I have been observing my bot in .NET and noticed that it seems to enjoy > appearing to log out of the world fora brief moment and then log itself > back in. When watching the bot it is in the world does the greet people > etc... then while idle it seems to just log out(avatar disappears). After a > random amount of time the bot seems to just log back in (does the greet > people stuff again). I was wondering if anyone had experienced this problem > in .net and what the solution may be. If it wants to log out like that it > is fine if there is a particular sdk event for such an occurance. So my > question is how can this be resolved with or without a sdk event? > > DM > Looks like you need to check the attribute AW_DISCONNECT_REASON in the content of AW_EVENT_WORLD_DISCONNECT and act with code if needed. http://www.activeworlds.com/sdk/AW_EVENT_WORLD_DISCONNECT.htm ../B xelagAug 18, 2003, 9:59am
Make sure you trigger aw_wait at regular intervals, I suppose you do,
but just in case :) On 18 Aug 2003 03:48:16 -0400, "dm mercury" <dmmercury at houston.rr.com> [View Quote] >I have been observing my bot in .NET and noticed that it seems to enjoy >appearing to log out of the world fora brief moment and then log itself >back in. When watching the bot it is in the world does the greet people >etc... then while idle it seems to just log out(avatar disappears). After a >random amount of time the bot seems to just log back in (does the greet >people stuff again). I was wondering if anyone had experienced this problem >in .net and what the solution may be. If it wants to log out like that it >is fine if there is a particular sdk event for such an occurance. So my >question is how can this be resolved with or without a sdk event? > >DM > strike rapierAug 18, 2003, 4:20pm
Be careful when posting about .NET and make sure you state which version it
is :) C++.NET and VisualBasic.NET are 2 diff fishies. - Mark [View Quote] dm mercuryAug 18, 2003, 4:41pm
It is vb.net, I would think 1 second to call awwait is often enough. I will
see if AW_EVENT_WORLD_DISCONNECT yields any RC. DM [View Quote] dm mercuryAug 18, 2003, 5:26pm
It seems for strange reason that RC_CONNECTION_LOST seems to be the world
disconnect reason code. Is there much to do to prevent this? DM [View Quote] baronAug 18, 2003, 5:45pm
In article <3f41284c at server1.Activeworlds.com>, dmmercury at houston.rr.com
says... > It seems for strange reason that RC_CONNECTION_LOST seems to be the world > disconnect reason code. Is there much to do to prevent this? > > DM > Not much since this hardly gives you any info on the nature of the problem, it's the most generic connectivity problem rc. You should try running another bot from the same machine to the same world to verify the connection's stability. If other bots have problems too, try another world. Perhaps you can also try calling aw_wait faster (like twice or three times per second), pretty remote but for some reason this worked for me sometime in the past. Also check other reasons that could mess with your connectivity like firewalls or routes to the world and auth server. -- ../B strike rapierAug 18, 2003, 7:52pm
I used to notice how if you had a 1 time per second heartbeat, you could get
quite a few dissconections... especially on 56k... But now I use 16 / 32 a second so... hehe - Mark [View Quote] dm mercuryAug 18, 2003, 8:42pm
Hmmm well I am not on 56k; like the disconnect event: is there an opposite
connect/reconnect event that is called after disconnect? because the bot auto logs in after a disconnect. I would like to be able to tell the difference between a connection I first start, and the connection(s) that are automatically restarted(so to speak), but if it is not possible at this time oh well =/ DM [View Quote] joemanAug 18, 2003, 9:13pm
The "heartbeats" are only send after a full minute has elapsed since the
last message was sent to the server, timeout is two minutes, so if the client misses two from the server, or visa-versa, and the socket is still open, the connection is dropped. All of the SDKs protocol handling and whatnot is called whenever any function is called, or aw_wait is called. By putting aw_wait in a loop, eg: while (aw_wait(-1)) ; You update everything correctly, events are called -on time-, etc. If you wait 16 to 32 seconds before calling another aw_wait, and don't call any other functions in the meantime, all events are ~16 to 32 seconds old by the time you get them... Not a good coding practice. But, in order for a heartbeat to be sent after the 60 seconds, you'll need to call an aw_wait; so just put it in a never-ending loop at get it done with. -Joe [View Quote] strike rapierAug 18, 2003, 9:18pm
strike rapierAug 18, 2003, 9:37pm
Anyway... the correct way to do it is as follows...
You need to track several booleans and events in your program from the second you load it, obviously you can only recieve certain events at certain times in certain states, hence this works... Set the events for world attributes change, and universe attributes change... you also need a boolean for 'Inworld' and 'InUniverse'... Right after RCless login, set InUniverse and InWorld to true.. this signifies that you are in the world... You also need a variable called blnDissconected... When you recieve a dissconect event, set blnDissconected to true... Because youc an recieve uni and world attributes seperatly without having to reconnect, if you recieve them, if you then check against blnDissconected, if it is false you can dissregard it (appart from whatever bot handling you want for these events)... Anyway, when your dissconected set bldDissconected to true... there is no way of detecting if you dropped out of the world or the uni, appart from by checking an aw_string like AW_WORLD_NAME for an RC code I believe... Anyway, depending on that set either InUniverse and / or InWorld to false... Now then... As the SDK reconnects itself it will retrieve these various events, if you recieve world attributes first after dissconection, then it was only world departure, not uni departure... Moving on... When you recieve these events check if InWorld / InUniverse is false.. if it is, set it to true as the event occurs... So say you get uni dissconected.. this is what would happen... blnDissconected = true <check world status> Lets just pretend we killed out modem a second... blnInWorld = false blnInUniverse = false <if AW_DISSCONECT_REASON == (RC_EJECTED || RC_NOT_WELCOME) We have just been dealt with, with eject or world change.. no need to do anything we have been killed at world level.. so set blnInWorld to false...> </Check World Status> [SDK Reattempts login here]... <Event Universe Attributes> if (blnInUniverse == false) { blnInUniverse = true; blnDissconected = false; } </Event Universe Attributes> [SDK checks if we need to re-enter world] [Not in world previously, stops here] <Event World Attributes> if (blnInWorld == false) { blnInWorld = true; } Well, I think that *Should* work... Note I only typed it out just now cause my PC will explode if I load up Zeus in .NET at this point in time... - Mark [View Quote] strike rapierAug 18, 2003, 9:38pm
*LOL* Course you could always make a firewall bot and track which
connections are lost on various events... - Mark [View Quote] joemanAug 18, 2003, 10:20pm
No, I didn't, because they really don't have anything to do with eachother.
Aw_wait is just a convient way of moving and processing traffic. The heartbeat *will* be sent by Aw_wait if a minute has elapsed... But, that's it... -Joe [View Quote] baronAug 19, 2003, 2:02am
In article <3f41566d$1 at server1.Activeworlds.com>, dmmercury at houston.rr.com
says... > Hmmm well I am not on 56k; like the disconnect event: is there an opposite > connect/reconnect event that is called after disconnect? because the bot > auto logs in after a disconnect. I would like to be able to tell the > difference between a connection I first start, and the connection(s) that > are automatically restarted(so to speak), but if it is not possible at this > time oh well =/ > > DM > I suppose you can use AW_EVENT_WORLD_ATTRIBUTES (http://www.activeworlds.com/sdk/AW_EVENT_WORLD_ATTRIBUTES.htm) with a flag to differentiate it from your normal first world enter (through a normal login process) but if I were you, I'd be more concerned about the disconnects than anything else...it's not normal you know. It took me 35-40 sec of blocked traffic to simulate a disconnect and verify the event firing, SDK does not give up with a couple dropped packets. -- ../B xelagAug 19, 2003, 1:02pm
There is a way to check whether a disconnect is from the world or more
generally from the universe: when the bot's session number changes to 439 No connection, you have a universe disconnect. I check the bot's session number at least once in ever aw_wait loop. Alex On 18 Aug 2003 19:37:28 -0400, "strike rapier" [View Quote] >Anyway... the correct way to do it is as follows... > >You need to track several booleans and events in your program from the >second you load it, obviously you can only recieve certain events at certain >times in certain states, hence this works... > >Set the events for world attributes change, and universe attributes >change... you also need a boolean for 'Inworld' and 'InUniverse'... > >Right after RCless login, set InUniverse and InWorld to true.. this >signifies that you are in the world... > >You also need a variable called blnDissconected... > >When you recieve a dissconect event, set blnDissconected to true... Because >youc an recieve uni and world attributes seperatly without having to >reconnect, if you recieve them, if you then check against blnDissconected, >if it is false you can dissregard it (appart from whatever bot handling you >want for these events)... > >Anyway, when your dissconected set bldDissconected to true... there is no >way of detecting if you dropped out of the world or the uni, appart from by >checking an aw_string like AW_WORLD_NAME for an RC code I believe... Anyway, >depending on that set either InUniverse and / or InWorld to false... > >Now then... > >As the SDK reconnects itself it will retrieve these various events, if you >recieve world attributes first after dissconection, then it was only world >departure, not uni departure... Moving on... When you recieve these events >check if InWorld / InUniverse is false.. if it is, set it to true as the >event occurs... > >So say you get uni dissconected.. this is what would happen... > >blnDissconected = true ><check world status> Lets just pretend we killed out modem a second... > blnInWorld = false > blnInUniverse = false > <if AW_DISSCONECT_REASON == (RC_EJECTED || RC_NOT_WELCOME) We have just >been dealt with, with eject or world change.. no need to do anything we have >been killed at world level.. so set blnInWorld to false...> ></Check World Status> > >[SDK Reattempts login here]... > ><Event Universe Attributes> >if (blnInUniverse == false) >{ > blnInUniverse = true; > blnDissconected = false; >} ></Event Universe Attributes> > >[SDK checks if we need to re-enter world] >[Not in world previously, stops here] > ><Event World Attributes> >if (blnInWorld == false) >{ > blnInWorld = true; >} > >Well, I think that *Should* work... Note I only typed it out just now cause >my PC will explode if I load up Zeus in .NET at this point in time... > >- Mark > [View Quote] strike rapierAug 19, 2003, 3:19pm
joemanAug 19, 2003, 4:43pm
.... Ok, you just admitted to running a pirated uniserver in a newsgroup!
You get the award for stupidest thing EVER today... that, and a gold star. -Joe [View Quote] strike rapierAug 19, 2003, 5:23pm
Egh yuo havent seen much else... I seriously don't think anyones going to
object to using a redunct uni with no external access, and 1 P-20 world for the sole purpose of testing bots Joe... Infact... I do believe that its a brilliant way to develop bots when your on something like 56Kb modems... I wouldent be suprised if a significant majority of people in this NG had them to test also... and im not even gonna get started on yours - Mark [View Quote] joemanAug 19, 2003, 5:43pm
Well then, I object to the p-20 world. You don't need any land in a world
to test a bot, really. Also, chances are, you got the version of the 3.1 server that wasn't properly "cracked", and is riddled with virii and Trojans as far as the eye can see. I also wouldn't be surprised if one out 20 people had this nasty piece of software that's been passed around more then nobody's business. There are other "brilliant" and *legal* ways to develop bots, such as logging into a uniserver and testing your code. Mine, well, lets see there, this is a goose of a different color my friend. -Joe [View Quote] strike rapierAug 19, 2003, 5:47pm
joemanAug 19, 2003, 5:48pm
Yes little Timmy, its what evil hackers like Strike Rapier use to pirate the
uniserver software. Don't do *crack*, and stay in school! -Joe ;) [View Quote] strike rapierAug 19, 2003, 5:57pm
Wernt you publicly advertising selling AWProxy on your website like 2 week
ago?... - Mark [View Quote] joemanAug 19, 2003, 6:17pm
|