ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Getting "my" session number (Sdk)
Getting "my" session number // SdkkahJun 9, 2003, 1:52pm
Hi, I need to find out the bot's own session number (in conjunction with
building), if possible. I'm somehow persuaded there is a way, but I can't for the life of my remember or find it. Thanks in advance for any help :-)) KAH milestegJun 9, 2003, 2:33pm
int aw_session (void)
;)))) MilesTeg "kah" <kah at kahnews.cjb.net> a écrit dans le message de news: Xns9395B5A2D6B45kahatkahnewsdotcjbdo at 64.94.241.201... > Hi, I need to find out the bot's own session number (in conjunction with > building), if possible. I'm somehow persuaded there is a way, but I can't > for the life of my remember or find it. > > Thanks in advance for any help :-)) > > KAH kahJun 9, 2003, 5:04pm
"milesteg" <MilesTeg at nerim.net> wrote in
news:3ee4b6ca at server1.Activeworlds.com: > int aw_session (void) Yes, you may hit my head with a heavy object now. DOH! Thanks :-)) KAH xelagJun 11, 2003, 6:45am
Notice a peculiarity of this attribute: Not only does it give you the
session number of the bot, it also changes to an error code when the bot gets a universe disconnect. ActiveWorlds SDK does not have a general disconnection event. It has a world disconnect event, and an undocumented change of the session number to an error code whenever the universe gets disconnected from the bot. Unfortunately, legitimate session numbers can also coincide with error codes,. I mentioned this peculiarity to Roland Vilett, but never got a satisfying answer. In practice, I noticed that since the almost first 500 numbers which could correspond to error codes are seldom used as legitimate session numbers in the session number recycling process, I have been able to use this undocumented oddity to help establish disconnections. There are 5 such 'reason' codes which appear as session numbers I use as a trigger: 27 = no such world 429 = unable to connect 439 = no connection 471 = connection lost 489 = world not running (i.e. admin closed world) Alex [View Quote] >"milesteg" <MilesTeg at nerim.net> wrote in >news:3ee4b6ca at server1.Activeworlds.com: > > >Yes, you may hit my head with a heavy object now. DOH! Thanks :-)) > >KAH baron sweetmanJun 11, 2003, 10:19am
"xelag" <xelag at digitalspace.com> wrote in
news:81qdevkhodhvrh7q6ipajbhg5edcpafs1l at 4ax.com: > > In practice, I noticed that since the almost first 500 numbers which > could correspond to error codes are seldom used as legitimate session I had a few times a low sessionnumber show up, i decided to leave it in anyway as the counter climbs fast the ostrich algorythm is a good workaround here ;) mrgrimmJun 11, 2003, 4:00pm
These are the only error codes that would be returned by aw_session:
RC_NOT_INITIALIZED RC_NO_INSTANCE RC_NO_CONNECTION -Will [View Quote] xelagJun 13, 2003, 3:27am
Will,
it would be better if the question were addressed properly: a universe disconnect needs an event handler. It does not have it, and session numbers are at present the only way to detect them with the SDK. This is NOT the function of a session number. Alex On 11 Jun 2003 14:00:43 -0400, "mrgrimm" <will at activeworlds.com> [View Quote] >These are the only error codes that would be returned by aw_session: > >RC_NOT_INITIALIZED >RC_NO_INSTANCE >RC_NO_CONNECTION > >-Will > [View Quote] |