summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorIbrahim Hossam <ibrahem.h.basyone@gmail.com>2014-02-02 14:09:39 +0200
committerIbrahim Hossam <ibrahem.h.basyone@gmail.com>2014-02-02 14:09:39 +0200
commitda233d52bba427b42265aeef08605504d51147ea (patch)
treee113561d977084ffa0dcca10b114248288a9aec9 /src/char/char.c
parent2263dc4660c6668c373f6a9e654e21bea8c419e4 (diff)
downloadhercules-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/char/char.c')
-rw-r--r--src/char/char.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c
index efe02031f..4079e10bb 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2558,6 +2558,26 @@ int parse_fromlogin(int fd) {
}
break;
+ case 0x2736: // Failed accinfo lookup to forward to mapserver
+ if (RFIFOREST(fd) < 18)
+ return 0;
+
+ mapif_parse_accinfo2(false, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14),
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1, 0, 0);
+ RFIFOSKIP(fd,18);
+ break;
+
+ case 0x2737: // Successful accinfo lookup to forward to mapserver
+ if (RFIFOREST(fd) < 183)
+ return 0;
+
+ mapif_parse_accinfo2(true, RFIFOL(fd,167), RFIFOL(fd,171), RFIFOL(fd,175), RFIFOL(fd,179),
+ (char*)RFIFOP(fd,2), (char*)RFIFOP(fd,26), (char*)RFIFOP(fd,59),
+ (char*)RFIFOP(fd,99), (char*)RFIFOP(fd,119), (char*)RFIFOP(fd,151),
+ (char*)RFIFOP(fd,156), RFIFOL(fd,115), RFIFOL(fd,143), RFIFOL(fd,147));
+ RFIFOSKIP(fd,183);
+ break;
+
default:
ShowError("Unknown packet 0x%04x received from login-server, disconnecting.\n", command);
set_eof(fd);
@@ -2852,6 +2872,16 @@ void mapif_on_disconnect(int id)
mapif_server_reset(id);
}
+void mapif_on_parse_accinfo(int account_id, int u_fd, int u_aid, int u_group, int map_fd) {
+ WFIFOHEAD(login_fd,22);
+ WFIFOW(login_fd,0) = 0x2740;
+ WFIFOL(login_fd,2) = account_id;
+ WFIFOL(login_fd,6) = u_fd;
+ WFIFOL(login_fd,10) = u_aid;
+ WFIFOL(login_fd,14) = u_group;
+ WFIFOL(login_fd,18) = map_fd;
+ WFIFOSET(login_fd,22);
+}
int parse_frommap(int fd)
{