summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-04-03 14:28:10 -0400
committergumi <git@gumi.ca>2018-04-03 14:28:10 -0400
commit06770d49189dd647ccd836ed738e9a4560e0118e (patch)
tree8d910535e66307254045aa9b4a08b5d82598daaf
parent66d23cea5f932471fa7a6d28764d41054dfbaafa (diff)
downloadtmwa-06770d49189dd647ccd836ed738e9a4560e0118e.tar.gz
tmwa-06770d49189dd647ccd836ed738e9a4560e0118e.tar.bz2
tmwa-06770d49189dd647ccd836ed738e9a4560e0118e.tar.xz
tmwa-06770d49189dd647ccd836ed738e9a4560e0118e.zip
fix a possible race condition between login and char server
-rw-r--r--src/login/login.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/login/login.cpp b/src/login/login.cpp
index 7d3e741..16cfaaa 100644
--- a/src/login/login.cpp
+++ b/src/login/login.cpp
@@ -2514,16 +2514,6 @@ void parse_login(Session *s)
// if at least 1 char-server
if (repeat_69.size())
{
- Packet_Head<0x0069> head_69;
- head_69.login_id1 = account.login_id1;
- head_69.account_id = account.account_id;
- head_69.login_id2 = account.login_id2;
- head_69.unused = 0; // in old version, that was for ip (not more used)
- head_69.last_login_string = account.lastlogin; // in old version, that was for name (not more used)
- head_69.unused2 = 0;
- head_69.sex = account.sex;
- send_vpacket<0x0069, 47, 32>(s, head_69, repeat_69);
-
if (auth_fifo_pos >= AUTH_FIFO_SIZE)
auth_fifo_pos = 0;
auth_fifo[auth_fifo_pos].account_id =
@@ -2539,6 +2529,17 @@ void parse_login(Session *s)
auth_fifo[auth_fifo_pos].client_version =
fixed.client_protocol_version;
auth_fifo_pos++;
+
+ Packet_Head<0x0069> head_69;
+ head_69.login_id1 = account.login_id1;
+ head_69.account_id = account.account_id;
+ head_69.login_id2 = account.login_id2;
+ head_69.unused = 0; // in old version, that was for ip (not longer used)
+ head_69.last_login_string = account.lastlogin; // in old version, that was for name (not longer used)
+ head_69.unused2 = 0;
+ head_69.sex = account.sex;
+ send_vpacket<0x0069, 47, 32>(s, head_69, repeat_69);
+
// if no char-server, don't send void list of servers, just disconnect the player with proper message
}
else