Follow up to 4a2574c.\r\nThanks to @Jeybla!

This commit is contained in:
Jey 2017-06-26 01:24:54 +07:00 committed by Jittapan Pluemsumran
parent 4a2574c599
commit 809fc35b0e
No known key found for this signature in database
GPG Key ID: D6CEC5C3A285CFFA
10 changed files with 56 additions and 53 deletions

3
.gitignore vendored
View File

@ -50,6 +50,9 @@ Thumbs.db
/3rdparty/mt19937ar/Makefile /3rdparty/mt19937ar/Makefile
/3rdparty/mt19937ar/*.o /3rdparty/mt19937ar/*.o
# /3rdparty/yaml-cpp/
/3rdparty/yaml-cpp/Makefile
# /db/ # /db/
/db/import /db/import

View File

@ -3020,7 +3020,7 @@ static void char_config_adjust() {
/* /*
* Message conf function * Message conf function
*/ */
int char_msg_config_read(char *cfgName){ int char_msg_config_read(const char *cfgName){
return _msg_config_read(cfgName,CHAR_MAX_MSG,msg_table); return _msg_config_read(cfgName,CHAR_MAX_MSG,msg_table);
} }
const char* char_msg_txt(int msg_number){ const char* char_msg_txt(int msg_number){

View File

@ -22,21 +22,21 @@
#include "cli.h" #include "cli.h"
//map confs //map confs
char* MAP_CONF_NAME; const char* MAP_CONF_NAME;
char* INTER_CONF_NAME; const char* INTER_CONF_NAME;
char* LOG_CONF_NAME; const char* LOG_CONF_NAME;
char* BATTLE_CONF_FILENAME; const char* BATTLE_CONF_FILENAME;
char* ATCOMMAND_CONF_FILENAME; const char* ATCOMMAND_CONF_FILENAME;
char* SCRIPT_CONF_NAME; const char* SCRIPT_CONF_NAME;
char* GRF_PATH_FILENAME; const char* GRF_PATH_FILENAME;
//char confs //char confs
char* CHAR_CONF_NAME; const char* CHAR_CONF_NAME;
char* SQL_CONF_NAME; const char* SQL_CONF_NAME;
//login confs //login confs
char* LOGIN_CONF_NAME; const char* LOGIN_CONF_NAME;
//common conf (used by multiple serv) //common conf (used by multiple serv)
char* LAN_CONF_NAME; //char-login const char* LAN_CONF_NAME; //char-login
char* MSG_CONF_NAME_EN; //all const char* MSG_CONF_NAME_EN; //all
/** /**
* Function to check if the specified option has an argument following it. * Function to check if the specified option has an argument following it.

View File

@ -17,21 +17,21 @@ extern "C" {
#define MAX_CONSOLE_IN 200 //max is map... #define MAX_CONSOLE_IN 200 //max is map...
#define MIN_CONSOLE_IN 4 //min is help #define MIN_CONSOLE_IN 4 //min is help
//map //map
extern char* MAP_CONF_NAME; extern const char* MAP_CONF_NAME;
extern char* INTER_CONF_NAME; extern const char* INTER_CONF_NAME;
extern char* LOG_CONF_NAME; extern const char* LOG_CONF_NAME;
extern char* BATTLE_CONF_FILENAME; extern const char* BATTLE_CONF_FILENAME;
extern char* ATCOMMAND_CONF_FILENAME; extern const char* ATCOMMAND_CONF_FILENAME;
extern char* SCRIPT_CONF_NAME; extern const char* SCRIPT_CONF_NAME;
extern char* GRF_PATH_FILENAME; extern const char* GRF_PATH_FILENAME;
//char //char
extern char* CHAR_CONF_NAME; extern const char* CHAR_CONF_NAME;
extern char* SQL_CONF_NAME; extern const char* SQL_CONF_NAME;
//login //login
extern char* LOGIN_CONF_NAME; extern const char* LOGIN_CONF_NAME;
//common //common
extern char* LAN_CONF_NAME; //char-login extern const char* LAN_CONF_NAME; //char-login
extern char* MSG_CONF_NAME_EN; //all extern const char* MSG_CONF_NAME_EN; //all
extern void display_helpscreen(bool exit); extern void display_helpscreen(bool exit);
bool cli_hasevent(); bool cli_hasevent();

View File

@ -61,7 +61,7 @@ struct timer_func_list {
} *tfl_root = NULL; } *tfl_root = NULL;
/// Sets the name of a timer function. /// Sets the name of a timer function.
int add_timer_func_list(TimerFunc func, char* name) int add_timer_func_list(TimerFunc func, const char* name)
{ {
struct timer_func_list* tfl; struct timer_func_list* tfl;

View File

@ -51,7 +51,7 @@ int delete_timer(int tid, TimerFunc func);
int addtick_timer(int tid, unsigned int tick); int addtick_timer(int tid, unsigned int tick);
int settick_timer(int tid, unsigned int tick); int settick_timer(int tid, unsigned int tick);
int add_timer_func_list(TimerFunc func, char* name); int add_timer_func_list(TimerFunc func, const char* name);
unsigned long get_uptime(void); unsigned long get_uptime(void);

View File

@ -3581,7 +3581,7 @@ int map_readallmaps (void)
if( enable_grf ) if( enable_grf )
ShowStatus("Loading maps (using GRF files)...\n"); ShowStatus("Loading maps (using GRF files)...\n");
else { else {
char* mapcachefilepath[] = { const char* mapcachefilepath[] = {
"db/" DBPATH "map_cache.dat", "db/" DBPATH "map_cache.dat",
"db/import/map_cache.dat" "db/import/map_cache.dat"
}; };
@ -3772,7 +3772,7 @@ int parse_console(const char* buf){
/*========================================== /*==========================================
* Read map server configuration files (conf/map_athena.conf...) * Read map server configuration files (conf/map_athena.conf...)
*------------------------------------------*/ *------------------------------------------*/
int map_config_read(char *cfgName) int map_config_read(const char *cfgName)
{ {
char line[1024], w1[32], w2[1024]; char line[1024], w1[32], w2[1024];
FILE *fp; FILE *fp;
@ -3878,7 +3878,7 @@ int map_config_read(char *cfgName)
return 0; return 0;
} }
void map_reloadnpc_sub(char *cfgName) void map_reloadnpc_sub(const char *cfgName)
{ {
char line[1024], w1[1024], w2[1024]; char line[1024], w1[1024], w2[1024];
FILE *fp; FILE *fp;
@ -3932,7 +3932,7 @@ void map_reloadnpc(bool clear)
#endif #endif
} }
int inter_config_read(char *cfgName) int inter_config_read(const char *cfgName)
{ {
char line[1024],w1[1024],w2[1024]; char line[1024],w1[1024],w2[1024];
FILE *fp; FILE *fp;
@ -4523,7 +4523,7 @@ struct msg_data *map_lang2msgdb(uint8 lang){
void map_do_init_msg(void){ void map_do_init_msg(void){
int test=0, i=0, size; int test=0, i=0, size;
char * listelang[] = { const char * listelang[] = {
MSG_CONF_NAME_EN, //default MSG_CONF_NAME_EN, //default
MSG_CONF_NAME_RUS, MSG_CONF_NAME_RUS,
MSG_CONF_NAME_SPN, MSG_CONF_NAME_SPN,
@ -4559,7 +4559,7 @@ void map_msg_reload(void){
map_do_final_msg(); //clear data map_do_final_msg(); //clear data
map_do_init_msg(); map_do_init_msg();
} }
int map_msg_config_read(char *cfgName, int lang){ int map_msg_config_read(const char *cfgName, int lang){
struct msg_data *mdb; struct msg_data *mdb;
if( (mdb = map_lang2msgdb(lang)) == NULL ) if( (mdb = map_lang2msgdb(lang)) == NULL )

View File

@ -33,7 +33,7 @@ enum E_MAPSERVER_ST {
#define msg_config_read(cfgName,isnew) map_msg_config_read(cfgName,isnew) #define msg_config_read(cfgName,isnew) map_msg_config_read(cfgName,isnew)
#define msg_txt(sd,msg_number) map_msg_txt(sd,msg_number) #define msg_txt(sd,msg_number) map_msg_txt(sd,msg_number)
#define do_final_msg() map_do_final_msg() #define do_final_msg() map_do_final_msg()
int map_msg_config_read(char *cfgName,int lang); int map_msg_config_read(const char *cfgName,int lang);
const char* map_msg_txt(struct map_session_data *sd,int msg_number); const char* map_msg_txt(struct map_session_data *sd,int msg_number);
void map_do_final_msg(void); void map_do_final_msg(void);
void map_msg_reload(void); void map_msg_reload(void);
@ -931,24 +931,24 @@ void map_skill_damage_add(struct map_data *m, uint16 skill_id, int pc, int mob,
#define CHK_CLASS(class_) ((class_) > CLASS_NONE && (class_) < CLASS_MAX) /// Check valid Class #define CHK_CLASS(class_) ((class_) > CLASS_NONE && (class_) < CLASS_MAX) /// Check valid Class
//Options read in cli //Options read in cli
extern char *INTER_CONF_NAME; extern const char*INTER_CONF_NAME;
extern char *LOG_CONF_NAME; extern const char*LOG_CONF_NAME;
extern char *MAP_CONF_NAME; extern const char*MAP_CONF_NAME;
extern char *BATTLE_CONF_FILENAME; extern const char*BATTLE_CONF_FILENAME;
extern char *ATCOMMAND_CONF_FILENAME; extern const char*ATCOMMAND_CONF_FILENAME;
extern char *SCRIPT_CONF_NAME; extern const char*SCRIPT_CONF_NAME;
extern char *MSG_CONF_NAME_EN; extern const char*MSG_CONF_NAME_EN;
extern char *GRF_PATH_FILENAME; extern const char*GRF_PATH_FILENAME;
//Other languages supported //Other languages supported
char *MSG_CONF_NAME_RUS; const char*MSG_CONF_NAME_RUS;
char *MSG_CONF_NAME_SPN; const char*MSG_CONF_NAME_SPN;
char *MSG_CONF_NAME_GRM; const char*MSG_CONF_NAME_GRM;
char *MSG_CONF_NAME_CHN; const char*MSG_CONF_NAME_CHN;
char *MSG_CONF_NAME_MAL; const char*MSG_CONF_NAME_MAL;
char *MSG_CONF_NAME_IDN; const char*MSG_CONF_NAME_IDN;
char *MSG_CONF_NAME_FRN; const char*MSG_CONF_NAME_FRN;
char *MSG_CONF_NAME_POR; const char*MSG_CONF_NAME_POR;
char *MSG_CONF_NAME_THA; const char*MSG_CONF_NAME_THA;
//Useful typedefs from jA [Skotlex] //Useful typedefs from jA [Skotlex]
typedef struct map_session_data TBL_PC; typedef struct map_session_data TBL_PC;

View File

@ -4370,7 +4370,7 @@ void run_script_main(struct script_state *st)
} }
} }
int script_config_read(char *cfgName) int script_config_read(const char *cfgName)
{ {
int i; int i;
char line[1024],w1[1024],w2[1024]; char line[1024],w1[1024],w2[1024];

View File

@ -747,7 +747,7 @@ void script_hardcoded_constants(void);
void script_cleararray_pc(struct map_session_data* sd, const char* varname, void* value); void script_cleararray_pc(struct map_session_data* sd, const char* varname, void* value);
void script_setarray_pc(struct map_session_data* sd, const char* varname, uint32 idx, void* value, int* refcache); void script_setarray_pc(struct map_session_data* sd, const char* varname, uint32 idx, void* value, int* refcache);
int script_config_read(char *cfgName); int script_config_read(const char *cfgName);
void do_init_script(void); void do_init_script(void);
void do_final_script(void); void do_final_script(void);
int add_str(const char* p); int add_str(const char* p);