summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorhemagx <hemagx2@gmail.com>2016-01-25 11:35:19 +0200
committerhemagx <hemagx2@gmail.com>2016-01-25 11:36:01 +0200
commitb77735473db348a65b749a79549852713f142dc1 (patch)
tree892b56949ae77e66f9d83109e4c1118485f1410d /src/char
parent0ed2d09e9aa88af01698707fd701363bdbd92b4b (diff)
downloadhercules-b77735473db348a65b749a79549852713f142dc1.tar.gz
hercules-b77735473db348a65b749a79549852713f142dc1.tar.bz2
hercules-b77735473db348a65b749a79549852713f142dc1.tar.xz
hercules-b77735473db348a65b749a79549852713f142dc1.zip
Fix packet id being sent encrypted to Hercules Plugin Manager.
Now packet id will be passed to Hercules Plugin Manager instead of let it figure it on itself
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 09f74034c..d05d13d4b 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2637,11 +2637,11 @@ int char_parse_fromlogin(int fd) {
}
}
- while(RFIFOREST(fd) >= 2) {
+ while (RFIFOREST(fd) >= 2) {
uint16 command = RFIFOW(fd,0);
if (VECTOR_LENGTH(HPM->packets[hpParse_FromLogin]) > 0) {
- int result = HPM->parse_packets(fd,hpParse_FromLogin);
+ int result = HPM->parse_packets(fd,command,hpParse_FromLogin);
if (result == 1)
continue;
if (result == 2)
@@ -3926,16 +3926,17 @@ int char_parse_frommap(int fd)
return 0;
}
- while(RFIFOREST(fd) >= 2) {
+ while (RFIFOREST(fd) >= 2) {
+ int packet_id = RFIFOW(fd,0);
if (VECTOR_LENGTH(HPM->packets[hpParse_FromMap]) > 0) {
- int result = HPM->parse_packets(fd,hpParse_FromMap);
+ int result = HPM->parse_packets(fd,packet_id,hpParse_FromMap);
if (result == 1)
continue;
if (result == 2)
return 0;
}
- switch(RFIFOW(fd,0)) {
+ switch (packet_id) {
case 0x2b0a:
if( RFIFOREST(fd) < RFIFOW(fd, 2) )
return 0;
@@ -5106,21 +5107,21 @@ int char_parse_char(int fd)
return 0;
}
- while( RFIFOREST(fd) >= 2 ) {
- //For use in packets that depend on an sd being present [Skotlex]
- #define FIFOSD_CHECK(rest) do { if(RFIFOREST(fd) < (rest)) return 0; if (sd==NULL || !sd->auth) { RFIFOSKIP(fd,(rest)); return 0; } } while (0)
+ while (RFIFOREST(fd) >= 2) {
+ cmd = RFIFOW(fd,0);
+
+//For use in packets that depend on an sd being present [Skotlex]
+#define FIFOSD_CHECK(rest) do { if(RFIFOREST(fd) < (rest)) return 0; if (sd==NULL || !sd->auth) { RFIFOSKIP(fd,(rest)); return 0; } } while (0)
if (VECTOR_LENGTH(HPM->packets[hpParse_Char]) > 0) {
- int result = HPM->parse_packets(fd,hpParse_Char);
+ int result = HPM->parse_packets(fd,cmd,hpParse_Char);
if (result == 1)
continue;
if (result == 2)
return 0;
}
- cmd = RFIFOW(fd,0);
-
- switch( cmd ) {
+ switch (cmd) {
// request to connect
// 0065 <account id>.L <login id1>.L <login id2>.L <???>.W <sex>.B
case 0x65: