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!
This commit is contained in:
Aleos 2018-02-22 17:14:20 -05:00 committed by GitHub
parent 5e354494b2
commit d4c1a57fb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 21 deletions

View File

@ -150,7 +150,7 @@
217: -- Account %d -- 217: -- Account %d --
218: User: %s | GM Group: %d | State: %d 218: User: %s | GM Group: %d | State: %d
//219: FREE //219: FREE
220: **** //220: FREE
221: Account e-mail: %s | Birthdate: %s 221: Account e-mail: %s | Birthdate: %s
222: Last IP: %s (%s) 222: Last IP: %s (%s)
223: This user has logged in %d times, the last time was at %s 223: This user has logged in %d times, the last time was at %s

View File

@ -130,24 +130,23 @@ Currently the max packet size is 0xFFFF (see 'WFIFOSET()' in 'src/common/socket.
0x2720: 0x2720:
Type: HA Type: HA
Structure: <cmd>.W <map_fd>.L <u_fd>.L <u_aid>.L <u_group>.L <account_id>.L Structure: <cmd>.W <map_fd>.L <u_fd>.L <u_aid>.L <account_id>.L
index: 0,2,6,10,14,18 index: 0,2,6,10,14
len: 22 len: 18
parameter: parameter:
- cmd : packet identification (0x2720) - cmd : packet identification (0x2720)
- map_fd : - map_fd :
- u_fd : - u_fd :
- u_aid : - u_aid :
- u_group :
- account_id : - account_id :
desc: desc:
- -
0x2721: 0x2721:
Type: AH Type: AH
Structure: <cmd>.W <map_fd>.L <u_fd>.L <u_aid>.L <account_id>.L <status>.B <password>.33B <email>.40B <last_ip>.16B <last_login>.24B <group_id>.L <logincount>.L <state>.L <password>.33B <birthdate>.11B <pincode>.?B <userid>.?B Structure: <cmd>.W <map_fd>.L <u_fd>.L <u_aid>.L <account_id>.L <status>.B <password>.33B <email>.40B <last_ip>.16B <last_login>.24B <group_id>.L <logincount>.L <state>.L <birthdate>.11B <userid>.?B
index: 0,2,6,10,18,19,52,92,108,132,136,140,144,155,155+PINCODE_LENGTH index: 0,2,6,10,18,19,52,92,108,132,136,140,144,122+NAME_LENGTH
len: 155 + PINCODE_LENGTH + NAME_LENGTH len: 122 + NAME_LENGTH
parameter: parameter:
- cmd : packet identification (0x2721) - cmd : packet identification (0x2721)
- map_fd - map_fd
@ -162,9 +161,7 @@ Currently the max packet size is 0xFFFF (see 'WFIFOSET()' in 'src/common/socket.
- group_id - group_id
- logincount - logincount
- state - state
- password
- birthdate - birthdate
- pincode
- userid - userid
desc: desc:
- -

View File

@ -662,18 +662,17 @@ int chlogif_reqvipdata(uint32 aid, uint8 flag, int32 timediff, int mapfd) {
* HA 0x2720 * HA 0x2720
* Request account info to login-server * 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); loginif_check(-1);
//ShowInfo("%d request account info for %d (type %d)\n", u_aid, account_id, type); //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; WFIFOW(login_fd,0) = 0x2720;
WFIFOL(login_fd,2) = fd; WFIFOL(login_fd,2) = fd;
WFIFOL(login_fd,6) = u_fd; WFIFOL(login_fd,6) = u_fd;
WFIFOL(login_fd,10) = u_aid; WFIFOL(login_fd,10) = u_aid;
WFIFOL(login_fd,14) = u_group; WFIFOL(login_fd,14) = account_id;
WFIFOL(login_fd,18) = account_id; WFIFOB(login_fd,18) = type;
WFIFOB(login_fd,22) = type; WFIFOSET(login_fd,19);
WFIFOSET(login_fd,23);
return 1; return 1;
} }

View File

@ -39,7 +39,7 @@ int chlogif_parse_updip(int fd, struct char_session_data* sd);
int chlogif_parse_vipack(int fd); int chlogif_parse_vipack(int fd);
int chlogif_reqvipdata(uint32 aid, uint8 flag, int32 timediff, int mapfd); 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); int chlogif_parse(int fd);

View File

@ -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 */ /* 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)); inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(213));
} }
return; return;

View File

@ -717,11 +717,11 @@ int logchrif_parse_accinfo(int fd) {
if( RFIFOREST(fd) < 23 ) if( RFIFOREST(fd) < 23 )
return 0; return 0;
else { 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); 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, 22); int8 type = RFIFOB(fd, 18);
AccountDB* accounts = login_get_accounts_db(); AccountDB* accounts = login_get_accounts_db();
struct mmo_account acc; struct mmo_account acc;
RFIFOSKIP(fd,23); RFIFOSKIP(fd,19);
// Send back the result to char-server // Send back the result to char-server
if (accounts->load_num(accounts, &acc, account_id)) { if (accounts->load_num(accounts, &acc, account_id)) {