summaryrefslogtreecommitdiff
path: root/src/common/HPMi.h
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/common/HPMi.h
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/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;