Issue information

Issue ID
#391
Status
Fixed
Severity
Low
Started
Hercules Elf Bot
Nov 8, 2007 23:51
Last Post
Hercules Elf Bot
Nov 8, 2007 23:51
Confirmation
N/A

Hercules Elf Bot - Nov 8, 2007 23:51

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=391

CODE
add_timer_interval(gettick() + 600*1000, online_data_cleanup, 0, 0, 600*1000);
...
    struct online_char_data *character= (struct online_char_data*)data;
    if (character->server == -2) //Unknown server.. set them offline
        set_char_offline(character->char_id, character->account_id);
    if (character->server < 0)
        //Free data from players that have not been online for a while.
        db_remove(online_char_db, key);

This code was added by Skotlex in r3316.
The problem with it is, that some players may be in the '-1' state legitimately - when they are logged in to the charserver but didn't go to the mapserver yet. This code means that it will wipe their entry from the online db even though they're still logged in!

It's harmless since the login server's online_check mechanism prevents dual-login, and also there's a charserver glitch that also prevents dual login in this case. The main problem is that the server is executing such faulty operations.