summaryrefslogtreecommitdiff
path: root/src/common/HPMi.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-12-16 20:20:39 -0200
committershennetsind <ind@henn.et>2013-12-16 20:20:39 -0200
commit0e25c604d9f84cbb0a9a737633a8b764c2a9d96f (patch)
tree12fcda5f8c9c24a4833fd4e4bd26e848210c68df /src/common/HPMi.h
parentf6daed397dee844234cacd90d395c0b74c404598 (diff)
downloadhercules-0e25c604d9f84cbb0a9a737633a8b764c2a9d96f.tar.gz
hercules-0e25c604d9f84cbb0a9a737633a8b764c2a9d96f.tar.bz2
hercules-0e25c604d9f84cbb0a9a737633a8b764c2a9d96f.tar.xz
hercules-0e25c604d9f84cbb0a9a737633a8b764c2a9d96f.zip
Introducing HPM Support for custom battle confs
Special Thanks to Mhalicot. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/HPMi.h')
-rw-r--r--src/common/HPMi.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 2cd1075c4..742132cde 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -36,6 +36,7 @@ struct map_session_data;
#include "../common/showmsg.h"
#define HPM_VERSION "1.0"
+#define HPM_ADDCONF_LENGTH 40
struct hplugin_info {
char* name;
@@ -83,6 +84,12 @@ enum HPluginDataTypes {
HPDT_NPCD,
};
+/* used in macros and conf storage */
+enum HPluginConfType {
+ HPCT_BATTLE, /* battle-conf (map-server */
+ HPCT_MAX,
+};
+
#define addHookPre(tname,hook) (HPMi->AddHook(HOOK_TYPE_PRE,(tname),(hook),HPMi->pid))
#define addHookPost(tname,hook) (HPMi->AddHook(HOOK_TYPE_POST,(tname),(hook),HPMi->pid))
/* need better names ;/ */
@@ -128,6 +135,8 @@ enum HPluginDataTypes {
}
/* HPMi->addPacket */
#define addPacket(cmd,len,receive,point) HPMi->addPacket(cmd,len,receive,point,HPMi->pid)
+/* HPMi->addBattleConf */
+#define addBattleConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_BATTLE,bcname,funcname)
/* Hercules Plugin Mananger Include Interface */
HPExport struct HPMi_interface {
@@ -150,6 +159,8 @@ HPExport struct HPMi_interface {
bool (*HookStopped) (void);
/* program --arg/-a */
bool (*addArg) (unsigned int pluginID, char *name, bool has_param,void (*func) (char *param),void (*help) (void));
+ /* battle-config recv param */
+ bool (*addConf) (unsigned int pluginID, enum HPluginConfType type, char *name, void (*func) (const char *val));
} HPMi_s;
#ifndef _HPM_H_
HPExport struct HPMi_interface *HPMi;