summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-05 16:05:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-05 16:05:25 +0300
commit0c0477399f132ac37a8dc07f86bb88b098502278 (patch)
treee9186fde5c229208a365e5b0217f8fd0e110e3da
parenta2d904e4bd501f1bf23df921c546a03450d5517b (diff)
downloadplugin-0c0477399f132ac37a8dc07f86bb88b098502278.tar.gz
plugin-0c0477399f132ac37a8dc07f86bb88b098502278.tar.bz2
plugin-0c0477399f132ac37a8dc07f86bb88b098502278.tar.xz
plugin-0c0477399f132ac37a8dc07f86bb88b098502278.zip
Move init plugin code into init.c
-rw-r--r--src/Makefile.am6
-rw-r--r--src/map/dummy.c59
-rw-r--r--src/map/dummy.h11
-rw-r--r--src/map/init.c76
4 files changed, 93 insertions, 59 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index ad7238f..1bd1756 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,11 @@
AUTOMAKE_OPTIONS = subdir-objects
+MAP_SRC = map/dummy.c \
+ map/dummy.h \
+ map/init.c
+
lib_LTLIBRARIES = libevol_map.la
-libevol_map_la_SOURCES = map/dummy.c
+libevol_map_la_SOURCES = ${MAP_SRC}
libevol_map_la_LDFLAGS = -avoid-version
libevol_map_la_CFLAGS = -pipe -ffast-math -Wall -Wextra -Wno-sign-compare
diff --git a/src/map/dummy.c b/src/map/dummy.c
index ffd4c6f..0541d53 100644
--- a/src/map/dummy.c
+++ b/src/map/dummy.c
@@ -14,15 +14,7 @@
#include "../../../map/pc.h"
#include "../../../map/script.h"
-#include "../../../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */
-
-HPExport struct hplugin_info pinfo =
-{
- "evoldummy",
- SERVER_TYPE_MAP,
- "0.1",
- HPM_VERSION
-};
+//#include "../../../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */
void showNotImplimented()
{
@@ -48,52 +40,3 @@ BUILDIN(dummyInt)
script_pushint(st, 0);
return true;
}
-
-/* run when server starts */
-HPExport void plugin_init (void) {
- /* core interfaces */
- iMalloc = GET_SYMBOL("iMalloc");
-
- /* map-server interfaces */
- script = GET_SYMBOL("script");
- clif = GET_SYMBOL("clif");
- pc = GET_SYMBOL("pc");
- strlib = GET_SYMBOL("strlib");
- session = GET_SYMBOL("session");
-
- addScriptCommand("setcamnpc", "*", dummy);
- addScriptCommand("restorecam", "", dummy);
- addScriptCommand("npctalk3", "s", dummy);
- addScriptCommand("closedialog", "", dummy);
- addScriptCommand("shop", "s", dummy);
- addScriptCommand("getitemlink", "s", dummyStr);
-// addScriptCommand("menuimage", "ss", dummyStr);
-// addScriptCommand("mesn", "*", dummy);
-// addScriptCommand("mesq", "s*", dummy);
-// addScriptCommand("g", "ss", dummyStr);
- addScriptCommand("l", "s*", dummyStr);
- // must be ss
- addScriptCommand("lg", "s*", dummyStr);
- addScriptCommand("getlang", "*", dummyStr);
- addScriptCommand("setlang", "i", dummy);
- addScriptCommand("requestlang", "*", dummy);
- addScriptCommand("getq", "i", dummyInt);
- addScriptCommand("setq", "ii", dummy);
- addScriptCommand("getnpcdir", "*", dummyInt);
- addScriptCommand("setnpcdir", "*", dummy);
-// addScriptCommand("col", "si", dummyStr);
- addScriptCommand("rif", "is*", dummyStr);
- addScriptCommand("countitemcolor", "*", dummyInt);
- addScriptCommand("getclientversion", "*", dummyInt);
- // must be replaced to misceffect
- addScriptCommand("misceffect2", "i*", dummy);
-}
-
-HPExport void server_preinit (void) {
-}
-
-HPExport void server_online (void) {
-}
-
-HPExport void plugin_final (void) {
-}
diff --git a/src/map/dummy.h b/src/map/dummy.h
new file mode 100644
index 0000000..e799586
--- /dev/null
+++ b/src/map/dummy.h
@@ -0,0 +1,11 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#ifndef EVOL_MAP_DUMMY
+#define EVOL_MAP_DUMMY
+
+BUILDIN(dummy);
+BUILDIN(dummyInt);
+BUILDIN(dummyStr);
+
+#endif // EVOL_MAP_DUMMY
diff --git a/src/map/init.c b/src/map/init.c
new file mode 100644
index 0000000..9d840a4
--- /dev/null
+++ b/src/map/init.c
@@ -0,0 +1,76 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "../../../common/HPMi.h"
+#include "../../../common/malloc.h"
+#include "../../../common/mmo.h"
+#include "../../../common/socket.h"
+#include "../../../common/strlib.h"
+#include "../../../map/clif.h"
+#include "../../../map/pc.h"
+#include "../../../map/script.h"
+
+#include "map/dummy.h"
+
+#include "../../../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */
+
+HPExport struct hplugin_info pinfo =
+{
+ "evoldummy",
+ SERVER_TYPE_MAP,
+ "0.1",
+ HPM_VERSION
+};
+
+/* run when server starts */
+HPExport void plugin_init (void) {
+ /* core interfaces */
+ iMalloc = GET_SYMBOL("iMalloc");
+
+ /* map-server interfaces */
+ script = GET_SYMBOL("script");
+ clif = GET_SYMBOL("clif");
+ pc = GET_SYMBOL("pc");
+ strlib = GET_SYMBOL("strlib");
+ session = GET_SYMBOL("session");
+
+ addScriptCommand("setcamnpc", "*", dummy);
+ addScriptCommand("restorecam", "", dummy);
+ addScriptCommand("npctalk3", "s", dummy);
+ addScriptCommand("closedialog", "", dummy);
+ addScriptCommand("shop", "s", dummy);
+ addScriptCommand("getitemlink", "s", dummyStr);
+// addScriptCommand("menuimage", "ss", dummyStr);
+// addScriptCommand("mesn", "*", dummy);
+// addScriptCommand("mesq", "s*", dummy);
+// addScriptCommand("g", "ss", dummyStr);
+ addScriptCommand("l", "s*", dummyStr);
+ // must be ss
+ addScriptCommand("lg", "s*", dummyStr);
+ addScriptCommand("getlang", "*", dummyStr);
+ addScriptCommand("setlang", "i", dummy);
+ addScriptCommand("requestlang", "*", dummy);
+ addScriptCommand("getq", "i", dummyInt);
+ addScriptCommand("setq", "ii", dummy);
+ addScriptCommand("getnpcdir", "*", dummyInt);
+ addScriptCommand("setnpcdir", "*", dummy);
+// addScriptCommand("col", "si", dummyStr);
+ addScriptCommand("rif", "is*", dummyStr);
+ addScriptCommand("countitemcolor", "*", dummyInt);
+ addScriptCommand("getclientversion", "*", dummyInt);
+ // must be replaced to misceffect
+ addScriptCommand("misceffect2", "i*", dummy);
+}
+
+HPExport void server_preinit (void) {
+}
+
+HPExport void server_online (void) {
+}
+
+HPExport void plugin_final (void) {
+}