summaryrefslogtreecommitdiff
path: root/src/common/HPMi.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/HPMi.h')
-rw-r--r--src/common/HPMi.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 3cdb804e0..5e44b80c7 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -11,6 +11,8 @@
struct script_state;
struct AtCommandInfo;
+struct socket_data;
+struct map_session_data;
#ifdef WIN32
#define HPExport __declspec(dllexport)
@@ -33,7 +35,7 @@ struct AtCommandInfo;
/* after */
#include "../common/showmsg.h"
-#define HPM_VERSION "0.1"
+#define HPM_VERSION "0.2"
struct hplugin_info {
char* name;
@@ -56,12 +58,37 @@ enum hp_event_types {
HPET_MAX,
};
+enum HPluginPacketHookingPoints {
+ hpClif_Parse, /* map-server (client-map) */
+ hpChrif_Parse, /* map-server (char-map) */
+ hpParse_FromMap, /* char-server (map-char) */
+ hpParse_FromLogin, /* char-server (login-char) */
+ hpParse_Char, /* char-server (client-char) */
+ hpParse_FromChar, /* login-server (char-login) */
+ hpParse_Login, /* login-server (client-login) */
+ /* */
+ hpPHP_MAX,
+};
+
/* Hercules Plugin Mananger Include Interface */
HPExport struct HPMi_interface {
+ /* */
+ unsigned int pid;
+ /* */
void (*event[HPET_MAX]) (void);
bool (*addCommand) (char *name, bool (*func)(const int fd, struct map_session_data* sd, const char* command, const char* message,struct AtCommandInfo *info));
bool (*addScript) (char *name, char *args, bool (*func)(struct script_state *st));
void (*addCPCommand) (char *name, CParseFunc func);
+ /* map_session_data */
+ void (*addToMSD) (struct map_session_data *sd, void *data, unsigned int id, unsigned int type, bool autofree);
+ void *(*getFromMSD) (struct map_session_data *sd, unsigned int id, unsigned int type);
+ void (*removeFromMSD) (struct map_session_data *sd, unsigned int id, unsigned int type);
+ /* session[] */
+ void (*addToSession) (struct socket_data *sess, void *data, unsigned int id, unsigned int type, bool autofree);
+ void *(*getFromSession) (struct socket_data *sess, unsigned int id, unsigned int type);
+ void (*removeFromSession) (struct socket_data *sess, unsigned int id, unsigned int type);
+ /* packet */
+ bool (*addPacket) (unsigned short cmd, unsigned short length, void (*receive)(int fd), unsigned int point, unsigned int pluginID);
} HPMi_s;
#ifndef _HPM_H_
HPExport struct HPMi_interface *HPMi;