From d4c1a57fb5bf82a81f51aba799eedb52e68f24e2 Mon Sep 17 00:00:00 2001 From: Aleos Date: Thu, 22 Feb 2018 17:14:20 -0500 Subject: [PATCH] Cleaned up atcommand accinfo leftovers (#2926) * Follow up to 2746e0d * Cleaned up some variable assignments when parsing the packet. * Updated packet documentation. * Freed message 220. Thanks to @RadianFord and @Lemongrass3110! --- conf/msg_conf/char_msg.conf | 2 +- doc/packet_interserv.txt | 15 ++++++--------- src/char/char_logif.cpp | 11 +++++------ src/char/char_logif.hpp | 2 +- src/char/inter.cpp | 2 +- src/login/loginchrif.cpp | 6 +++--- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/conf/msg_conf/char_msg.conf b/conf/msg_conf/char_msg.conf index 00f1eecee2..b54531edd3 100644 --- a/conf/msg_conf/char_msg.conf +++ b/conf/msg_conf/char_msg.conf @@ -150,7 +150,7 @@ 217: -- Account %d -- 218: User: %s | GM Group: %d | State: %d //219: FREE -220: **** +//220: FREE 221: Account e-mail: %s | Birthdate: %s 222: Last IP: %s (%s) 223: This user has logged in %d times, the last time was at %s diff --git a/doc/packet_interserv.txt b/doc/packet_interserv.txt index 4718eb61e1..5065298a43 100644 --- a/doc/packet_interserv.txt +++ b/doc/packet_interserv.txt @@ -130,24 +130,23 @@ Currently the max packet size is 0xFFFF (see 'WFIFOSET()' in 'src/common/socket. 0x2720: Type: HA - Structure: .W .L .L .L .L .L - index: 0,2,6,10,14,18 - len: 22 + Structure: .W .L .L .L .L + index: 0,2,6,10,14 + len: 18 parameter: - cmd : packet identification (0x2720) - map_fd : - u_fd : - u_aid : - - u_group : - account_id : desc: - 0x2721: Type: AH - Structure: .W .L .L .L .L .B .33B .40B .16B .24B .L .L .L .33B .11B .?B .?B - index: 0,2,6,10,18,19,52,92,108,132,136,140,144,155,155+PINCODE_LENGTH - len: 155 + PINCODE_LENGTH + NAME_LENGTH + Structure: .W .L .L .L .L .B .33B .40B .16B .24B .L .L .L .11B .?B + index: 0,2,6,10,18,19,52,92,108,132,136,140,144,122+NAME_LENGTH + len: 122 + NAME_LENGTH parameter: - cmd : packet identification (0x2721) - map_fd @@ -162,9 +161,7 @@ Currently the max packet size is 0xFFFF (see 'WFIFOSET()' in 'src/common/socket. - group_id - logincount - state - - password - birthdate - - pincode - userid desc: - diff --git a/src/char/char_logif.cpp b/src/char/char_logif.cpp index 76dcb40d82..f9090892bf 100644 --- a/src/char/char_logif.cpp +++ b/src/char/char_logif.cpp @@ -662,18 +662,17 @@ int chlogif_reqvipdata(uint32 aid, uint8 flag, int32 timediff, int mapfd) { * HA 0x2720 * Request account info to login-server */ -int chlogif_req_accinfo(int fd, int u_fd, int u_aid, int u_group, int account_id, int8 type) { +int chlogif_req_accinfo(int fd, int u_fd, int u_aid, int account_id, int8 type) { loginif_check(-1); //ShowInfo("%d request account info for %d (type %d)\n", u_aid, account_id, type); - WFIFOHEAD(login_fd,23); + WFIFOHEAD(login_fd,19); WFIFOW(login_fd,0) = 0x2720; WFIFOL(login_fd,2) = fd; WFIFOL(login_fd,6) = u_fd; WFIFOL(login_fd,10) = u_aid; - WFIFOL(login_fd,14) = u_group; - WFIFOL(login_fd,18) = account_id; - WFIFOB(login_fd,22) = type; - WFIFOSET(login_fd,23); + WFIFOL(login_fd,14) = account_id; + WFIFOB(login_fd,18) = type; + WFIFOSET(login_fd,19); return 1; } diff --git a/src/char/char_logif.hpp b/src/char/char_logif.hpp index 990243a2cc..792e9654f9 100644 --- a/src/char/char_logif.hpp +++ b/src/char/char_logif.hpp @@ -39,7 +39,7 @@ int chlogif_parse_updip(int fd, struct char_session_data* sd); int chlogif_parse_vipack(int fd); int chlogif_reqvipdata(uint32 aid, uint8 flag, int32 timediff, int mapfd); -int chlogif_req_accinfo(int fd, int u_fd, int u_aid, int u_group, int account_id, int8 type); +int chlogif_req_accinfo(int fd, int u_fd, int u_aid, int account_id, int8 type); int chlogif_parse(int fd); diff --git a/src/char/inter.cpp b/src/char/inter.cpp index 06ab3e3331..cf9b4b2de3 100644 --- a/src/char/inter.cpp +++ b/src/char/inter.cpp @@ -478,7 +478,7 @@ void mapif_parse_accinfo(int fd) { } /* it will only get here if we have a single match then ask login-server to fetch the `login` record */ - if (!account_id || chlogif_req_accinfo(fd, u_fd, u_aid, u_group, account_id, type) != 1) { + if (!account_id || chlogif_req_accinfo(fd, u_fd, u_aid, account_id, type) != 1) { inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(213)); } return; diff --git a/src/login/loginchrif.cpp b/src/login/loginchrif.cpp index 5d390fb48f..f364403b3b 100644 --- a/src/login/loginchrif.cpp +++ b/src/login/loginchrif.cpp @@ -717,11 +717,11 @@ int logchrif_parse_accinfo(int fd) { if( RFIFOREST(fd) < 23 ) return 0; else { - int map_fd = RFIFOL(fd, 2), u_fd = RFIFOL(fd, 6), u_aid = RFIFOL(fd, 10), u_group = RFIFOL(fd, 14), account_id = RFIFOL(fd, 18); - int8 type = RFIFOB(fd, 22); + int map_fd = RFIFOL(fd, 2), u_fd = RFIFOL(fd, 6), u_aid = RFIFOL(fd, 10), account_id = RFIFOL(fd, 14); + int8 type = RFIFOB(fd, 18); AccountDB* accounts = login_get_accounts_db(); struct mmo_account acc; - RFIFOSKIP(fd,23); + RFIFOSKIP(fd,19); // Send back the result to char-server if (accounts->load_num(accounts, &acc, account_id)) {