瀏覽代碼

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://svn.code.sf.net/p/rathena/svn/trunk@16447 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 年之前
父節點
當前提交
39d578de13
共有 2 個文件被更改,包括 19 次插入1 次删除
  1. 18 0
      src/map/atcommand.c
  2. 1 1
      src/map/pc_groups.c

+ 18 - 0
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) {

+ 1 - 1
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;