Skip to content

Commit

Permalink
Fix wrong offset being read when syncing accounts between char-server…
Browse files Browse the repository at this point in the history
… and login-server

Char-Server writes the account ids starting at offset 8, while login-server was reading from offset 6
This caused account ids to be messed up when syncing both servers,
thus, many players (if not all) would be considered as logged off by login-server at this point
and this would them invalidate API Server token
  • Loading branch information
guilherme-gm committed Jul 1, 2024
1 parent 5f7eaa4 commit 29d858c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/login/login.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ static void login_fromchar_parse_online_accounts(int fd, int id)
login->online_db->foreach(login->online_db, login->online_db_setoffline, id); //Set all chars from this char-server offline first
users = RFIFOW(fd,4);
for (i = 0; i < users; i++) {
int aid = RFIFOL(fd,6+i*4);
int aid = RFIFOL(fd, 8 + i * 4);
struct online_login_data *p = idb_ensure(login->online_db, aid, login->create_online_user);
p->char_server = id;
if (p->waiting_disconnect != INVALID_TIMER)
Expand Down

0 comments on commit 29d858c

Please sign in to comment.