diff options
author | Haruna <haru@dotalux.com> | 2014-02-10 18:14:36 +0100 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2014-02-10 18:14:36 +0100 |
commit | afb013850baddb26a4600b60c0ee713fb9d05784 (patch) | |
tree | 0fb649df5b66a3297de50e1b746760b899e6e504 /src/login | |
parent | 9dea9f8287efd2a1b65863f258ace92acf5f486e (diff) | |
parent | da233d52bba427b42265aeef08605504d51147ea (diff) | |
download | hercules-afb013850baddb26a4600b60c0ee713fb9d05784.tar.gz hercules-afb013850baddb26a4600b60c0ee713fb9d05784.tar.bz2 hercules-afb013850baddb26a4600b60c0ee713fb9d05784.tar.xz hercules-afb013850baddb26a4600b60c0ee713fb9d05784.zip |
Merge pull request #256 from hemagx/master
Merged~
Thank you for your contribution to Hercules!
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/login.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/login/login.c b/src/login/login.c index 249d008ec..252031bb8 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -832,6 +832,46 @@ int parse_fromchar(int fd) } break; + case 0x2740: // Accinfo request forwarded by charserver on mapserver's account + if( RFIFOREST(fd) < 22 ) + return 0; + else { + struct mmo_account acc; + int account_id = RFIFOL(fd, 2), u_fd = RFIFOL(fd, 6), u_aid = RFIFOL(fd, 10), u_group = RFIFOL(fd, 14), map_fd = RFIFOL(fd, 18); + if (accounts->load_num(accounts, &acc, account_id)) { + WFIFOHEAD(fd,183); + WFIFOW(fd,0) = 0x2737; + safestrncpy((char*)WFIFOP(fd,2), acc.userid, NAME_LENGTH); + if (u_group >= acc.group_id) { + safestrncpy((char*)WFIFOP(fd,26), acc.pass, 33); + } + safestrncpy((char*)WFIFOP(fd,59), acc.email, 40); + safestrncpy((char*)WFIFOP(fd,99), acc.last_ip, 16); + WFIFOL(fd,115) = acc.group_id; + safestrncpy((char*)WFIFOP(fd,119), acc.lastlogin, 24); + WFIFOL(fd,143) = acc.logincount; + WFIFOL(fd,147) = acc.state; + if (u_group >= acc.group_id) { + safestrncpy((char*)WFIFOP(fd,151), acc.pincode, 5); + } + safestrncpy((char*)WFIFOP(fd,156), acc.birthdate, 11); + WFIFOL(fd,167) = map_fd; + WFIFOL(fd,171) = u_fd; + WFIFOL(fd,175) = u_aid; + WFIFOL(fd,179) = account_id; + WFIFOSET(fd,183); + } else { + WFIFOHEAD(fd,18); + WFIFOW(fd,0) = 0x2736; + WFIFOL(fd,2) = map_fd; + WFIFOL(fd,6) = u_fd; + WFIFOL(fd,10) = u_aid; + WFIFOL(fd,14) = account_id; + WFIFOSET(fd,18); + } + RFIFOSKIP(fd,22); + } + break; default: ShowError("parse_fromchar: Unknown packet 0x%x from a char-server! Disconnecting!\n", command); set_eof(fd); |