diff options
author | Ibrahim Hossam <ibrahem.h.basyone@gmail.com> | 2014-02-02 14:09:39 +0200 |
---|---|---|
committer | Ibrahim Hossam <ibrahem.h.basyone@gmail.com> | 2014-02-02 14:09:39 +0200 |
commit | da233d52bba427b42265aeef08605504d51147ea (patch) | |
tree | e113561d977084ffa0dcca10b114248288a9aec9 /src/login/login.c | |
parent | 2263dc4660c6668c373f6a9e654e21bea8c419e4 (diff) | |
download | hercules-da233d52bba427b42265aeef08605504d51147ea.tar.gz hercules-da233d52bba427b42265aeef08605504d51147ea.tar.bz2 hercules-da233d52bba427b42265aeef08605504d51147ea.tar.xz hercules-da233d52bba427b42265aeef08605504d51147ea.zip |
Update inter server so ask login server for account information Instead of do query to login table.
Thanks to Haruna to clean it up.
Diffstat (limited to 'src/login/login.c')
-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 e9d0eac9d..d427641f5 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); |