From 8fda38dcdabbb9d252b0e11fb07b2ad37f9e659f Mon Sep 17 00:00:00 2001 From: shennetsind Date: Wed, 13 Nov 2013 21:26:21 -0200 Subject: HPM Custom Data Struct Makeover! - Modified how the core handles it, making it easier to add new points. - Modified how plugins call it, calls were made shorter, e.g. 'HPMi->getFromSession(session[fd],HPMi->pid,0)' => 'getFromSession(session[fd],0)' -- check src/common/HPMi.h #defines for all the options - Added support for npc_data (getFromNPCD and so on) as requested in http://hercules.ws/board/topic/2923-hpm-custom-struct-npcs/ Signed-off-by: shennetsind --- src/common/HPM.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/common/HPM.h') diff --git a/src/common/HPM.h b/src/common/HPM.h index e685b3068..9a6bda713 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -82,6 +82,11 @@ struct HPMArgData { bool has_param;/* because of the weird "--argparam" instead of the "--arg=param" */ }; +struct HPDataOperationStorage { + void **HPDataSRCPtr; + unsigned int *hdatac; +}; + /* Hercules Plugin Manager Interface */ struct HPM_interface { /* vars */ @@ -125,6 +130,9 @@ struct HPM_interface { bool (*parse_arg) (const char *arg, int* index, char *argv[], bool param); void (*arg_help) (void); int (*arg_db_clear_sub) (DBKey key, DBData *data, va_list args); + void (*grabHPData) (struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr); + /* for server-specific HPData e.g. map_session_data */ + void (*grabHPDataSub) (struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr); } HPM_s; struct HPM_interface *HPM; -- cgit v1.2.3-70-g09d2