summaryrefslogtreecommitdiff
path: root/src/char
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/char
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/char')
-rw-r--r--src/char/char.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c
index b6ea8e2f6..e6e8732db 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -14,6 +14,7 @@
#include "../common/timer.h"
#include "../common/utils.h"
#include "../common/console.h"
+#include "../common/HPM.h"
#include "int_guild.h"
#include "int_homun.h"
#include "int_mercenary.h"
@@ -2150,6 +2151,14 @@ int parse_fromlogin(int fd) {
while(RFIFOREST(fd) >= 2) {
uint16 command = RFIFOW(fd,0);
+
+ if( HPM->packetsc[hpParse_FromLogin] ) {
+ if( (i = HPM->parse_packets(fd,hpParse_FromLogin)) ) {
+ if( i == 1 ) continue;
+ if( i == 2 ) return 0;
+ }
+ }
+
switch( command ) {
// acknowledgement of connect-to-loginserver request
@@ -2704,6 +2713,14 @@ int parse_frommap(int fd)
}
while(RFIFOREST(fd) >= 2) {
+
+ if( HPM->packetsc[hpParse_FromMap] ) {
+ if( (i = HPM->parse_packets(fd,hpParse_FromMap)) ) {
+ if( i == 1 ) continue;
+ if( i == 2 ) return 0;
+ }
+ }
+
switch(RFIFOW(fd,0)) {
case 0x2b0a:
@@ -3752,6 +3769,13 @@ int parse_char(int fd)
//For use in packets that depend on an sd being present [Skotlex]
#define FIFOSD_CHECK(rest) { if(RFIFOREST(fd) < rest) return 0; if (sd==NULL || !sd->auth) { RFIFOSKIP(fd,rest); return 0; } }
+ if( HPM->packetsc[hpParse_Char] ) {
+ if( (i = HPM->parse_packets(fd,hpParse_Char)) ) {
+ if( i == 1 ) continue;
+ if( i == 2 ) return 0;
+ }
+ }
+
cmd = RFIFOW(fd,0);
switch( cmd ) {
@@ -4874,8 +4898,11 @@ int char_config_read(const char* cfgName)
void do_final(void) {
int i;
+
ShowStatus("Terminating...\n");
+ HPM->event(HPET_FINAL);
+
set_all_offline(-1);
set_all_offline_sql();
@@ -4967,6 +4994,11 @@ int do_init(int argc, char **argv) {
auth_db = idb_alloc(DB_OPT_RELEASE_DATA);
online_char_db = idb_alloc(DB_OPT_RELEASE_DATA);
+
+ HPM->share(sql_handle,"sql_handle");
+ HPM->config_read();
+ HPM->event(HPET_INIT);
+
mmo_char_sql_init();
char_read_fame_list(); //Read fame lists.
@@ -5034,5 +5066,7 @@ int do_init(int argc, char **argv) {
runflag = CHARSERVER_ST_RUNNING;
}
+ HPM->event(HPET_READY);
+
return 0;
}