# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena/src # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: char/char.c --- char/char.c Base (BASE) +++ char/char.c Locally Modified (Based On LOCAL) @@ -30,9 +30,10 @@ #include // private declarations -#define CHAR_CONF_NAME "conf/char_athena.conf" -#define LAN_CONF_NAME "conf/subnet_athena.conf" -#define SQL_CONF_NAME "conf/inter_athena.conf" +char* CHAR_CONF_NAME; +char* LAN_CONF_NAME; +char* SQL_CONF_NAME; +char* MSG_CONF_NAME; char char_db[256] = "char"; char scdata_db[256] = "sc_data"; @@ -4701,6 +4702,7 @@ flush_fifos(); + do_final_msg(); do_final_mapif(); do_final_loginif(); @@ -4755,15 +4757,106 @@ } +/*====================================================== + * Login-Server help option info + *------------------------------------------------------*/ +static void char_helpscreen(bool do_exit) +{ + ShowInfo("Usage: %s [options]\n", SERVER_NAME); + ShowInfo("\n"); + ShowInfo("Options:\n"); + ShowInfo(" -?, -h [--help]\t\tDisplays this help screen.\n"); + ShowInfo(" -v [--version]\t\tDisplays the server's version.\n"); + ShowInfo(" --run-once\t\t\tCloses server after loading (testing).\n"); + ShowInfo(" --char-config \t\tAlternative char-server configuration.\n"); + ShowInfo(" --lan-config \tAlternative lag configuration.\n"); + ShowInfo(" --inter-config \t\tAlternative inter-server configuration.\n"); + ShowInfo(" --msg-config \t\tAlternative message configuration.\n"); + if( do_exit ) + exit(EXIT_SUCCESS); +} + int do_init(int argc, char **argv) { + int i=0; //Read map indexes mapindex_init(); start_point.map = mapindex_name2id("new_zone01"); - char_config_read((argc < 2) ? CHAR_CONF_NAME : argv[1]); - char_lan_config_read((argc > 3) ? argv[3] : LAN_CONF_NAME); + CHAR_CONF_NAME = "conf/char_athena.conf"; + LAN_CONF_NAME = "conf/subnet_athena.conf"; + SQL_CONF_NAME = "conf/inter_athena.conf"; + MSG_CONF_NAME = "conf/msg_conf/char_msg.conf"; + + for( i = 1; i < argc ; i++ ) + { + const char* arg = argv[i]; + + if( arg[0] != '-' && ( arg[0] != '/' || arg[1] == '-' ) ) + {// -, -- and / + ShowError("Unknown option '%s'.\n", argv[i]); + exit(EXIT_FAILURE); + } + else if( (++arg)[0] == '-' ) + {// long option + arg++; + + if( strcmp(arg, "help") == 0 ) + { + char_helpscreen(true); + } + else if( strcmp(arg, "version") == 0 ) + { + display_versionscreen(true); + } + else if( strcmp(arg, "char-config") == 0 ) + { + if( opt_has_next_value(arg, i, argc) ) + CHAR_CONF_NAME = argv[++i]; + } + else if( strcmp(arg, "lan-config") == 0 ) + { + if( opt_has_next_value(arg, i, argc) ) + LAN_CONF_NAME = argv[++i]; + } + else if( strcmp(arg, "inter-config") == 0 ) + { + if( opt_has_next_value(arg, i, argc) ) + SQL_CONF_NAME = argv[++i]; + } + else if( strcmp(arg, "msg-config") == 0 ) + { + if( opt_has_next_value(arg, i, argc) ) + MSG_CONF_NAME = argv[++i]; + } + else if( strcmp(arg, "run-once") == 0 ) // close the login-server as soon as its done.. for testing [Celest] + { + runflag = CORE_ST_STOP; + } + else + { + ShowError("Unknown option '%s'.\n", argv[i]); + exit(EXIT_FAILURE); + } + } + else switch( arg[0] ) + {// short option + case '?': + case 'h': + char_helpscreen(true); + break; + case 'v': + display_versionscreen(true); + break; + default: + ShowError("Unknown option '%s'.\n", argv[i]); + exit(EXIT_FAILURE); + } + } + char_config_read(CHAR_CONF_NAME); + char_lan_config_read(LAN_CONF_NAME); sql_config_read(SQL_CONF_NAME); + msg_config_read(MSG_CONF_NAME); if (strcmp(userid, "s1")==0 && strcmp(passwd, "p1")==0) { ShowWarning("Using the default user/password s1/p1 is NOT RECOMMENDED.\n"); Index: char/char.h --- char/char.h Base (BASE) +++ char/char.h Locally Modified (Based On LOCAL) @@ -6,6 +6,7 @@ #include "../config/core.h" #include "../common/core.h" // CORE_ST_LAST +#include "../common/msg_conf.h" enum E_CHARSERVER_ST { Index: char/int_auction.c --- char/int_auction.c Base (BASE) +++ char/int_auction.c Locally Modified (Based On LOCAL) @@ -145,12 +145,12 @@ { if( auction->buyer_id ) { - mail_sendmail(0, "Auction Manager", auction->buyer_id, auction->buyer_name, "Auction", "Thanks, you won the auction!.", 0, &auction->item); + mail_sendmail(0, msg_txt(523), auction->buyer_id, auction->buyer_name, "Auction", msg_txt(520), 0, &auction->item); mapif_Auction_message(auction->buyer_id, 6); // You have won the auction - mail_sendmail(0, "Auction Manager", auction->seller_id, auction->seller_name, "Auction", "Payment for your auction!.", auction->price, NULL); + mail_sendmail(0, msg_txt(523), auction->seller_id, auction->seller_name, "Auction", msg_txt(521), auction->price, NULL); } else - mail_sendmail(0, "Auction Manager", auction->seller_id, auction->seller_name, "Auction", "No buyers have been found for your auction.", 0, &auction->item); + mail_sendmail(0, msg_txt(523), auction->seller_id, auction->seller_name, "Auction", msg_txt(522), 0, &auction->item); ShowInfo("Auction End: id %u.\n", auction->auction_id); Index: char/inter.c --- char/inter.c Base (BASE) +++ char/inter.c Locally Modified (Based On LOCAL) @@ -67,70 +67,6 @@ static DBMap* wis_db = NULL; // int wis_id -> struct WisData* static int wis_dellist[WISDELLIST_MAX], wis_delnum; -#define MAX_JOB_NAMES 106 -static char* msg_table[MAX_JOB_NAMES]; // messages 550 ~ 655 are job names - -const char* msg_txt(int msg_number) { - msg_number -= 550; - if (msg_number >= 0 && msg_number < MAX_JOB_NAMES && - msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0') - return msg_table[msg_number]; - - return "Unknown"; -} - -/*========================================== - * Read Message Data -- at char server we only keep job names. - *------------------------------------------*/ -int msg_config_read(const char* cfgName) { - int msg_number; - char line[1024], w1[1024], w2[1024]; - FILE *fp; - static int called = 1; - - if ((fp = fopen(cfgName, "r")) == NULL) { - ShowError("Messages file not found: %s\n", cfgName); - return 1; - } - - if ((--called) == 0) - memset(msg_table, 0, sizeof(msg_table[0]) * MAX_JOB_NAMES); - - while(fgets(line, sizeof(line), fp) ) { - if (line[0] == '/' && line[1] == '/') - continue; - if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2) - continue; - - if (strcmpi(w1, "import") == 0) - msg_config_read(w2); - else { - msg_number = atoi(w1); - if( msg_number < 550 || msg_number > (550+MAX_JOB_NAMES) ) - continue; - msg_number -= 550; - if (msg_number >= 0 && msg_number < MAX_JOB_NAMES) { - if (msg_table[msg_number] != NULL) - aFree(msg_table[msg_number]); - msg_table[msg_number] = (char *)aMalloc((strlen(w2) + 1)*sizeof (char)); - strcpy(msg_table[msg_number],w2); - } - } - } - - fclose(fp); - - return 0; -} - -/*========================================== - * Cleanup Message Data - *------------------------------------------*/ -void do_final_msg(void) { - int i; - for (i = 0; i < MAX_JOB_NAMES; i++) - aFree(msg_table[i]); -} /* from pc.c due to @accinfo. any ideas to replace this crap are more than welcome. */ const char* job_name(int class_) { switch (class_) { @@ -791,7 +727,6 @@ inter_auction_sql_init(); geoip_readdb(); - msg_config_read("conf/msg_athena.conf"); return 0; } @@ -812,7 +747,6 @@ if (accreg_pt) aFree(accreg_pt); - do_final_msg(); return; } Index: common/Makefile.in --- common/Makefile.in Base (BASE) +++ common/Makefile.in Locally Modified (Based On LOCAL) @@ -3,7 +3,8 @@ obj_all/nullpo.o obj_all/malloc.o obj_all/showmsg.o obj_all/strlib.o obj_all/utils.o \ obj_all/grfio.o obj_all/mapindex.o obj_all/ers.o obj_all/md5calc.o \ obj_all/minicore.o obj_all/minisocket.o obj_all/minimalloc.o obj_all/random.o obj_all/des.o \ - obj_all/conf.o obj_all/thread.o obj_all/mutex.o obj_all/raconf.o obj_all/mempool.o + obj_all/conf.o obj_all/thread.o obj_all/mutex.o obj_all/raconf.o obj_all/mempool.o \ + obj_all/msg_conf.o COMMON_H = $(shell ls ../common/*.h) Index: common/core.c --- common/core.c Base (BASE) +++ common/core.c Locally Modified (Based On LOCAL) @@ -1,17 +1,19 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" +#include "mmo.h" +#include "showmsg.h" +#include "malloc.h" #include "core.h" #ifndef MINICORE -#include "../common/db.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/thread.h" -#include "../common/mempool.h" -#include "../common/sql.h" +#include "db.h" +#include "socket.h" +#include "timer.h" +#include "thread.h" +#include "mempool.h" +#include "sql.h" +#include "cbasetypes.h" +#include "msg_conf.h" #endif #include @@ -258,6 +260,30 @@ } #endif + +bool opt_has_next_value(const char* option, int i, int argc) +{ + if( i >= argc-1 ) + { + ShowWarning("Missing value for option '%s'.\n", option); + return false; + } + + return true; +} + +/*====================================================== + * Servers Version Screen [MC Cameri] + *------------------------------------------------------*/ +void display_versionscreen(bool do_exit) +{ + ShowInfo(CL_WHITE"rAthena SVN version: %s" CL_RESET"\n", get_svn_revision()); + ShowInfo(CL_GREEN"Website/Forum:"CL_RESET"\thttp://rathena.org/\n"); + ShowInfo(CL_GREEN"IRC Channel:"CL_RESET"\tirc://irc.rathena.net/#rathena\n"); + ShowInfo("Open "CL_WHITE"readme.txt"CL_RESET" for more information.\n"); + if( do_exit ) + exit(EXIT_SUCCESS); +} /*====================================== * CORE : Display title * ASCII By CalciumKid 1/12/2011 @@ -324,7 +350,6 @@ mempool_init(); db_init(); signals_init(); - #ifdef _WIN32 cevents_init(); #endif Index: common/core.h --- common/core.h Base (BASE) +++ common/core.h Locally Modified (Based On LOCAL) @@ -4,6 +4,8 @@ #ifndef _CORE_H_ #define _CORE_H_ +#include "cbasetypes.h" + /* so that developers with --enable-debug can raise signals from any section of the code they'd like */ #ifdef DEBUG #include @@ -31,6 +33,8 @@ extern char SERVER_TYPE; extern int parse_console(const char* buf); +bool opt_has_next_value(const char* option, int i, int argc); +void display_versionscreen(bool do_exit); extern const char *get_svn_revision(void); extern int do_init(int,char**); extern void set_server_type(void); Index: common/msg_conf.c --- common/msg_conf.c No Base Revision +++ common/msg_conf.c Locally New @@ -0,0 +1,80 @@ +#include +#include +#include + +#include "malloc.h" +#include "msg_conf.h" +#include "showmsg.h" + +#define MAX_MSG 1500 +#define MSG_CONF_NAME "conf/msg_athena.conf" + +static char* msg_table[MAX_MSG]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others) + +void msg_init(void){ + msg_config_read(MSG_CONF_NAME); +} +//----------------------------------------------------------- +// Return the message string of the specified number by [Yor] +//----------------------------------------------------------- + +const char* msg_txt(int msg_number) +{ + if (msg_number >= 0 && msg_number < MAX_MSG && + msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0') + return msg_table[msg_number]; + + return "??"; +} + +/*========================================== + * Read Message Data + *------------------------------------------*/ +int msg_config_read(const char* cfgName) +{ + int msg_number; + char line[1024], w1[1024], w2[1024]; + FILE *fp; + static int called = 1; + + if ((fp = fopen(cfgName, "r")) == NULL) { + ShowError("Messages file not found: %s\n", cfgName); + return 1; + } + + if ((--called) == 0) + memset(msg_table, 0, sizeof (msg_table[0]) * MAX_MSG); + + while (fgets(line, sizeof (line), fp)) { + if (line[0] == '/' && line[1] == '/') + continue; + if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2) + continue; + + if (strcmpi(w1, "import") == 0) + msg_config_read(w2); + else { + msg_number = atoi(w1); + if (msg_number >= 0 && msg_number < MAX_MSG) { + if (msg_table[msg_number] != NULL) + aFree(msg_table[msg_number]); + msg_table[msg_number] = (char *) aMalloc((strlen(w2) + 1) * sizeof (char)); + strcpy(msg_table[msg_number], w2); + } + } + } + + fclose(fp); + ShowInfo("Finished reading %s.\n",cfgName); + + return 0; +} + +/*========================================== + * Cleanup Message Data + *------------------------------------------*/ +void do_final_msg(void){ + int i; + for (i = 0; i < MAX_MSG; i++) + aFree(msg_table[i]); +} \ No newline at end of file Index: common/msg_conf.h --- common/msg_conf.h No Base Revision +++ common/msg_conf.h Locally New @@ -0,0 +1,20 @@ +// Copyright (c) Athena Dev Teams - Licensed under GNU GPL +// For more information, see LICENCE in the main folder + +#ifndef MSG_CONF_H +#define MSG_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +const char* msg_txt(int msg_number); +int msg_config_read(const char* cfgName); +void do_final_msg(void); + +#ifdef __cplusplus +} +#endif + +#endif /* MSG_CONF_H */ + Index: common/sql.c --- common/sql.c Base (BASE) +++ common/sql.c Locally Modified (Based On LOCAL) @@ -15,6 +15,8 @@ #include // strlen/strnlen/memcpy/memset #include // strtoul +#define SQL_CONF_NAME "conf/inter_athena.conf" + void ra_mysql_error_handler(unsigned int ecode); int mysql_reconnect_type; @@ -1020,5 +1022,5 @@ } void Sql_Init(void) { - Sql_inter_server_read("conf/inter_athena.conf",true); + Sql_inter_server_read(SQL_CONF_NAME,true); } Index: login/login.c --- login/login.c Base (BASE) +++ login/login.c Locally Modified (Based On LOCAL) @@ -10,6 +10,7 @@ #include "../common/socket.h" #include "../common/strlib.h" #include "../common/timer.h" +#include "../common/msg_conf.h" #include "account.h" #include "ipban.h" #include "login.h" @@ -19,6 +20,10 @@ #include #include +char* LOGIN_CONF_NAME; +char* LAN_CONF_NAME; +char* MSG_CONF_NAME; + struct Login_Config login_config; int login_fd; // login server socket @@ -1744,6 +1749,7 @@ if( login_config.log_login ) loginlog_final(); + do_final_msg(); ipban_final(); for( i = 0; account_engines[i].constructor; ++i ) @@ -1802,6 +1808,24 @@ } +/*====================================================== + * Login-Server help option info + *------------------------------------------------------*/ +static void login_helpscreen(bool do_exit) +{ + ShowInfo("Usage: %s [options]\n", SERVER_NAME); + ShowInfo("\n"); + ShowInfo("Options:\n"); + ShowInfo(" -?, -h [--help]\t\tDisplays this help screen.\n"); + ShowInfo(" -v [--version]\t\tDisplays the server's version.\n"); + ShowInfo(" --run-once\t\t\tCloses server after loading (testing).\n"); + ShowInfo(" --login-config \t\tAlternative login-server configuration.\n"); + ShowInfo(" --lan-config \tAlternative lag configuration.\n"); + ShowInfo(" --msg-config \t\tAlternative message configuration.\n"); + if( do_exit ) + exit(EXIT_SUCCESS); +} + //------------------------------ // Login server initialization //------------------------------ @@ -1815,9 +1839,75 @@ // read login-server configuration login_set_defaults(); - login_config_read((argc > 1) ? argv[1] : LOGIN_CONF_NAME); - login_lan_config_read((argc > 2) ? argv[2] : LAN_CONF_NAME); + LOGIN_CONF_NAME = "conf/login_athena.conf"; + LAN_CONF_NAME = "conf/subnet_athena.conf"; + MSG_CONF_NAME = "conf/msg_conf/map_msg.conf"; + + for( i = 1; i < argc ; i++ ) + { + const char* arg = argv[i]; + + if( arg[0] != '-' && ( arg[0] != '/' || arg[1] == '-' ) ) + {// -, -- and / + ShowError("Unknown option '%s'.\n", argv[i]); + exit(EXIT_FAILURE); + } + else if( (++arg)[0] == '-' ) + {// long option + arg++; + + if( strcmp(arg, "help") == 0 ) + { + login_helpscreen(true); + } + else if( strcmp(arg, "version") == 0 ) + { + display_versionscreen(true); + } + else if( strcmp(arg, "login-config") == 0 ) + { + if( opt_has_next_value(arg, i, argc) ) + LOGIN_CONF_NAME = argv[++i]; + } + else if( strcmp(arg, "lan-config") == 0 ) + { + if( opt_has_next_value(arg, i, argc) ) + LAN_CONF_NAME = argv[++i]; + } + else if( strcmp(arg, "msg-config") == 0 ) + { + if( opt_has_next_value(arg, i, argc) ) + MSG_CONF_NAME = argv[++i]; + } + else if( strcmp(arg, "run-once") == 0 ) // close the login-server as soon as its done.. for testing [Celest] + { + runflag = CORE_ST_STOP; + } + else + { + ShowError("Unknown option '%s'.\n", argv[i]); + exit(EXIT_FAILURE); + } + } + else switch( arg[0] ) + {// short option + case '?': + case 'h': + login_helpscreen(true); + break; + case 'v': + display_versionscreen(true); + break; + default: + ShowError("Unknown option '%s'.\n", argv[i]); + exit(EXIT_FAILURE); + } + } + login_config_read(LOGIN_CONF_NAME); + login_lan_config_read(LAN_CONF_NAME); + msg_config_read(MSG_CONF_NAME); + rnd_init(); for( i = 0; i < ARRAYLENGTH(server); ++i ) @@ -1883,3 +1973,5 @@ return 0; } + + Index: login/login.h --- login/login.h Base (BASE) +++ login/login.h Locally Modified (Based On LOCAL) @@ -14,9 +14,6 @@ LOGINSERVER_ST_LAST }; -#define LOGIN_CONF_NAME "conf/login_athena.conf" -#define LAN_CONF_NAME "conf/subnet_athena.conf" - // supported encryption types: 1- passwordencrypt, 2- passwordencrypt2, 3- both #define PASSWORDENC 3 Index: map/atcommand.c --- map/atcommand.c Base (BASE) +++ map/atcommand.c Locally Modified (Based On LOCAL) @@ -100,73 +100,6 @@ return ( i < atcmd_binding_count ) ? atcmd_binding[i] : NULL; } -//----------------------------------------------------------- -// Return the message string of the specified number by [Yor] -//----------------------------------------------------------- -const char* msg_txt(int msg_number) -{ - if (msg_number >= 0 && msg_number < MAX_MSG && - msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0') - return msg_table[msg_number]; - - return "??"; -} - -/*========================================== - * Read Message Data - *------------------------------------------*/ -int msg_config_read(const char* cfgName) -{ - int msg_number; - char line[1024], w1[1024], w2[1024]; - FILE *fp; - static int called = 1; - - if ((fp = fopen(cfgName, "r")) == NULL) { - ShowError("Messages file not found: %s\n", cfgName); - return 1; - } - - if ((--called) == 0) - memset(msg_table, 0, sizeof(msg_table[0]) * MAX_MSG); - - while(fgets(line, sizeof(line), fp)) - { - if (line[0] == '/' && line[1] == '/') - continue; - if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2) - continue; - - if (strcmpi(w1, "import") == 0) - msg_config_read(w2); - else - { - msg_number = atoi(w1); - if (msg_number >= 0 && msg_number < MAX_MSG) - { - if (msg_table[msg_number] != NULL) - aFree(msg_table[msg_number]); - msg_table[msg_number] = (char *)aMalloc((strlen(w2) + 1)*sizeof (char)); - strcpy(msg_table[msg_number],w2); - } - } - } - - fclose(fp); - - return 0; -} - -/*========================================== - * Cleanup Message Data - *------------------------------------------*/ -void do_final_msg(void) -{ - int i; - for (i = 0; i < MAX_MSG; i++) - aFree(msg_table[i]); -} - /** * retrieves the help string associated with a given command. * Index: map/atcommand.h --- map/atcommand.h Base (BASE) +++ map/atcommand.h Locally Modified (Based On LOCAL) @@ -30,10 +30,6 @@ bool atcommand_exists(const char* name); -const char* msg_txt(int msg_number); -int msg_config_read(const char* cfgName); -void do_final_msg(void); - extern int atcmd_binding_count; // @commands (script based) Index: map/map.c --- map/map.c Base (BASE) +++ map/map.c Locally Modified (Based On LOCAL) @@ -3666,7 +3666,7 @@ } /*====================================================== - * Map-Server Version Screen [MC Cameri] + * Map-Server help options screen *------------------------------------------------------*/ static void map_helpscreen(bool do_exit) { @@ -3689,19 +3689,6 @@ } /*====================================================== - * Map-Server Version Screen [MC Cameri] - *------------------------------------------------------*/ -static void map_versionscreen(bool do_exit) -{ - ShowInfo(CL_WHITE"rAthena SVN version: %s" CL_RESET"\n", get_svn_revision()); - ShowInfo(CL_GREEN"Website/Forum:"CL_RESET"\thttp://rathena.org/\n"); - ShowInfo(CL_GREEN"IRC Channel:"CL_RESET"\tirc://irc.rathena.net/#rathena\n"); - ShowInfo("Open "CL_WHITE"readme.txt"CL_RESET" for more information.\n"); - if( do_exit ) - exit(EXIT_SUCCESS); -} - -/*====================================================== * Map-Server Init and Command-line Arguments [Valaris] *------------------------------------------------------*/ void set_server_type(void) @@ -3729,17 +3716,6 @@ } } -static bool map_arg_next_value(const char* option, int i, int argc) -{ - if( i >= argc-1 ) - { - ShowWarning("Missing value for option '%s'.\n", option); - return false; - } - - return true; -} - int do_init(int argc, char *argv[]) { int i; @@ -3754,11 +3730,9 @@ BATTLE_CONF_FILENAME = "conf/battle_athena.conf"; ATCOMMAND_CONF_FILENAME = "conf/atcommand_athena.conf"; SCRIPT_CONF_NAME = "conf/script_athena.conf"; - MSG_CONF_NAME = "conf/msg_athena.conf"; + MSG_CONF_NAME = "conf/msg_conf/map_msg.conf"; GRF_PATH_FILENAME = "conf/grf-files.txt"; - rnd_init(); - for( i = 1; i < argc ; i++ ) { const char* arg = argv[i]; @@ -3778,46 +3752,46 @@ } else if( strcmp(arg, "version") == 0 ) { - map_versionscreen(true); + display_versionscreen(true); } else if( strcmp(arg, "map-config") == 0 ) { - if( map_arg_next_value(arg, i, argc) ) + if( opt_has_next_value(arg, i, argc) ) MAP_CONF_NAME = argv[++i]; } else if( strcmp(arg, "battle-config") == 0 ) { - if( map_arg_next_value(arg, i, argc) ) + if( opt_has_next_value(arg, i, argc) ) BATTLE_CONF_FILENAME = argv[++i]; } else if( strcmp(arg, "atcommand-config") == 0 ) { - if( map_arg_next_value(arg, i, argc) ) + if( opt_has_next_value(arg, i, argc) ) ATCOMMAND_CONF_FILENAME = argv[++i]; } else if( strcmp(arg, "script-config") == 0 ) { - if( map_arg_next_value(arg, i, argc) ) + if( opt_has_next_value(arg, i, argc) ) SCRIPT_CONF_NAME = argv[++i]; } else if( strcmp(arg, "msg-config") == 0 ) { - if( map_arg_next_value(arg, i, argc) ) + if( opt_has_next_value(arg, i, argc) ) MSG_CONF_NAME = argv[++i]; } else if( strcmp(arg, "grf-path-file") == 0 ) { - if( map_arg_next_value(arg, i, argc) ) + if( opt_has_next_value(arg, i, argc) ) GRF_PATH_FILENAME = argv[++i]; } else if( strcmp(arg, "inter-config") == 0 ) { - if( map_arg_next_value(arg, i, argc) ) + if( opt_has_next_value(arg, i, argc) ) INTER_CONF_NAME = argv[++i]; } else if( strcmp(arg, "log-config") == 0 ) { - if( map_arg_next_value(arg, i, argc) ) + if( opt_has_next_value(arg, i, argc) ) LOG_CONF_NAME = argv[++i]; } else if( strcmp(arg, "run-once") == 0 ) // close the map-server as soon as its done.. for testing [Celest] @@ -3837,7 +3811,7 @@ map_helpscreen(true); break; case 'v': - map_versionscreen(true); + display_versionscreen(true); break; default: ShowError("Unknown option '%s'.\n", argv[i]); @@ -3845,6 +3819,7 @@ } } + rnd_init(); map_config_read(MAP_CONF_NAME); /* only temporary until sirius's datapack patch is complete */ Index: map/map.h --- map/map.h Base (BASE) +++ map/map.h Locally Modified (Based On LOCAL) @@ -9,6 +9,7 @@ #include "../common/mmo.h" #include "../common/mapindex.h" #include "../common/db.h" +#include "../common/msg_conf.h" /** * [rAthena.org]