summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-10 16:16:20 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-15 19:08:36 +0300
commitd0cd1c51be1cd980409a1412b3e16eeea4e1ae0d (patch)
tree7f8c2c0e41195d20f299c93ffcd3ffcdd928b062
parentc70f82729539b2aa630d1ab5358e89128a0b3f9e (diff)
downloadhercules-d0cd1c51be1cd980409a1412b3e16eeea4e1ae0d.tar.gz
hercules-d0cd1c51be1cd980409a1412b3e16eeea4e1ae0d.tar.bz2
hercules-d0cd1c51be1cd980409a1412b3e16eeea4e1ae0d.tar.xz
hercules-d0cd1c51be1cd980409a1412b3e16eeea4e1ae0d.zip
Add support for plugin options in map server config (script.conf).
-rw-r--r--src/common/HPMi.h3
-rw-r--r--src/map/script.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 10a5ec082..0f2bed10d 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -90,6 +90,7 @@ enum HPluginConfType {
HPCT_CHAR_INTER, /* inter-server.conf (char-server) */
HPCT_MAP_INTER, /* inter-server.conf (map-server) */
HPCT_LOG, /* logs.conf (map-server) */
+ HPCT_SCRIPT, /* script.conf (map-server) */
HPCT_MAX,
};
@@ -172,6 +173,8 @@ enum HPluginConfType {
#define addMapInterConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_MAP_INTER,bcname,funcname)
/* HPMi->addLog */
#define addLogConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_LOG,bcname,funcname)
+/* HPMi->addScript */
+#define addScriptConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_SCRIPT,bcname,funcname)
/* HPMi->addPCGPermission */
#define addGroupPermission(pcgname,maskptr) HPMi->addPCGPermission(HPMi->pid,pcgname,&maskptr)
diff --git a/src/map/script.c b/src/map/script.c
index 56bccbdec..aa90a5b1c 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -55,6 +55,7 @@
#include "../common/sysinfo.h"
#include "../common/timer.h"
#include "../common/utils.h"
+#include "../common/HPM.h"
#ifndef WIN32
#include <sys/time.h>
@@ -4141,7 +4142,9 @@ int script_config_read(char *cfgName) {
else if(strcmpi(w1,"import")==0) {
script->config_read(w2);
}
- else {
+ else if(HPM->parseConf(w1, w2, HPCT_SCRIPT)) {
+ ; // handled by plugin
+ } else {
ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
}
}