summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-08-04 12:19:25 -0300
committershennetsind <ind@henn.et>2013-08-08 15:07:40 -0300
commit6b9f58446c46877ecfc5fe40847636145acf5af8 (patch)
tree81b71aa95a47e611a5415528cf72efefe0d552b1 /src/map/chrif.c
parentdefac0ef9714121a872ab48c3f6c4ddd177ae509 (diff)
downloadhercules-6b9f58446c46877ecfc5fe40847636145acf5af8.tar.gz
hercules-6b9f58446c46877ecfc5fe40847636145acf5af8.tar.bz2
hercules-6b9f58446c46877ecfc5fe40847636145acf5af8.tar.xz
hercules-6b9f58446c46877ecfc5fe40847636145acf5af8.zip
HPM Update
- Custom Packet Support - Custom Data Struct Support (currently append-able to map_session_data and socket_data) - Char Server Support - Login Server Support http://hercules.ws/board/topic/1934-hercules-plugin-manager-update/ Documentation will soon be updated in http://hercules.ws/wiki/HPM Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index d44ccf721..6b0397b56 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -10,6 +10,7 @@
#include "../common/showmsg.h"
#include "../common/strlib.h"
#include "../common/ers.h"
+#include "../common/HPM.h"
#include "map.h"
#include "battle.h"
@@ -1396,7 +1397,7 @@ void chrif_skillid2idx(int fd) {
*
*------------------------------------------*/
int chrif_parse(int fd) {
- int packet_len, cmd;
+ int packet_len, cmd, r;
// only process data from the char-server
if ( fd != char_fd ) {
@@ -1421,9 +1422,18 @@ int chrif_parse(int fd) {
}
while ( RFIFOREST(fd) >= 2 ) {
+
+ if( HPM->packetsc[hpChrif_Parse] ) {
+ if( (r = HPM->parse_packets(fd,hpChrif_Parse)) ) {
+ if( r == 1 ) continue;
+ if( r == 2 ) return 0;
+ }
+ }
+
cmd = RFIFOW(fd,0);
+
if (cmd < 0x2af8 || cmd >= 0x2af8 + ARRAYLENGTH(packet_len_table) || packet_len_table[cmd-0x2af8] == 0) {
- int r = intif->parse(fd); // Passed on to the intif
+ r = intif->parse(fd); // Passed on to the intif
if (r == 1) continue; // Treated in intif
if (r == 2) return 0; // Didn't have enough data (len==-1)