summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-08-11 01:47:15 +0200
committerHaru <haru@dotalux.com>2015-08-15 00:51:44 +0200
commit22bd368e5d4d8d61a7189d03f52c3afd90c0729e (patch)
treeb8617bdfe901c41ff006d160b5bbceadb52f7bfb /src/plugins
parentbbf42063d78e393c2fc7a74b105aca6fb6357414 (diff)
downloadhercules-22bd368e5d4d8d61a7189d03f52c3afd90c0729e.tar.gz
hercules-22bd368e5d4d8d61a7189d03f52c3afd90c0729e.tar.bz2
hercules-22bd368e5d4d8d61a7189d03f52c3afd90c0729e.tar.xz
hercules-22bd368e5d4d8d61a7189d03f52c3afd90c0729e.zip
Added core HPM interface
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sample.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/plugins/sample.c b/src/plugins/sample.c
index 58be9c05f..275edb129 100644
--- a/src/plugins/sample.c
+++ b/src/plugins/sample.c
@@ -117,22 +117,15 @@ void parse_my_setting(const char *val) {
}
/* run when server starts */
HPExport void plugin_init (void) {
- char *server_type;
- char *server_name;
+ ShowInfo("Server type is ");
- /* core vars */
- server_type = GET_SYMBOL("SERVER_TYPE"); // FIXME
- server_name = GET_SYMBOL("SERVER_NAME"); // FIXME
-
- ShowInfo ("Server type is ");
-
- switch (*server_type) {
- case SERVER_TYPE_LOGIN: printf ("Login Server\n"); break;
- case SERVER_TYPE_CHAR: printf ("Char Server\n"); break;
+ switch (SERVER_TYPE) {
+ case SERVER_TYPE_LOGIN: printf("Login Server\n"); break;
+ case SERVER_TYPE_CHAR: printf("Char Server\n"); break;
case SERVER_TYPE_MAP: printf ("Map Server\n"); break;
}
- ShowInfo ("I'm being run from the '%s' filename\n", server_name);
+ ShowInfo("I'm being run from the '%s' filename\n", SERVER_NAME);
/* addAtcommand("command-key",command-function) tells map server to call ACMD(sample) when "sample" command is used */
/* - it will print a warning when used on a non-map-server plugin */