How to check if the player is logged in

04/09/2021 22:16 theashmaster#1
Hey guys! Is there a way to check if my character is logged in the game?

I know the net module has a function called IsConnected, or something like that, but it returns true even when i'm in the character selection screen. Is there a way to check in which screen I'm at (i.e., login screen, character selection screen) or, at least, if the player is already in game?
04/12/2021 13:57 Aeryas#2
In character selection screen, if you check against your VirtualID, it returns 0, 1, 2, 3, 4 for ebery character you have. While logged in, you aquire a VirtualID from the server which is always bigger than those values I enumerated earlier. So the easiest way is to check if vid > 4 (max characters you can have, do stuff. NPCs will never have VIDs lower or equal than 4, so it's a failsafe check.
04/14/2021 12:58 theashmaster#3
Nice! Thank you for your idea.

I realized that some info only show up when the player is in game (mov speed, att speed, etc.), and I was using those info to check if the player was logged. But for some reason it was not realiable (or my code was wrong somewhere xD).

I will try your tip. Thanks man!
04/14/2021 13:53 _asm#4
just use the phase packet from the server and check against the game phase. this way you can distinguish between any phase in which the character is currently in.