summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-18 21:13:40 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-18 21:13:40 +0000
commita9696317f3d9d94ee19b47ac4dff000f0a8775b5 (patch)
treec38e3726d0099209f0c620d7aeb4cb271e0caf2a /src
parent4328a8e9beba3b67008c3cae6ac91acf7bfa36c6 (diff)
downloadhercules-a9696317f3d9d94ee19b47ac4dff000f0a8775b5.tar.gz
hercules-a9696317f3d9d94ee19b47ac4dff000f0a8775b5.tar.bz2
hercules-a9696317f3d9d94ee19b47ac4dff000f0a8775b5.tar.xz
hercules-a9696317f3d9d94ee19b47ac4dff000f0a8775b5.zip
Fixed bugreport:6269 added a way to test files prior to @reloadatcommand so that if they fail to read the server doesn't get stuck with no atcommands (and no way to reload again since the reload is a atcommand…) also fixed a memory-release missing since the group.conf stuff was first added.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16447 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c18
-rw-r--r--src/map/pc_groups.c2
2 files changed, 19 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 8e199ca73..afa22b392 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3859,6 +3859,22 @@ ACMD_FUNC(reloadskilldb)
*------------------------------------------*/
void atcommand_doload();
ACMD_FUNC(reloadatcommand) {
+ config_t run_test;
+
+ if (conf_read_file(&run_test, "conf/groups.conf")) {
+ clif_displaymessage(fd, "Error reading groups.conf, can't reload");
+ return -1;
+ }
+
+ config_destroy(&run_test);
+
+ if (conf_read_file(&run_test, ATCOMMAND_CONF_FILENAME)) {
+ clif_displaymessage(fd, "Error reading atcommand.conf, can't reload");
+ return -1;
+ }
+
+ config_destroy(&run_test);
+
atcommand_doload();
pc_groups_reload();
clif_displaymessage(fd, msg_txt(254));
@@ -9226,6 +9242,8 @@ void atcommand_db_clear(void) {
}
if (atcommand_alias_db != NULL)
db_destroy(atcommand_alias_db);
+
+ config_destroy(&atcommand_config);
}
void atcommand_doload(void) {
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index c6713fedf..a2bf5f0c5 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -96,7 +96,7 @@ static void read_config(void)
return;
groups = config_lookup(&pc_group_config, "groups");
-
+
if (groups != NULL) {
GroupSettings *group_settings = NULL;
DBIterator *iter = NULL;