diff --git a/Changelog.txt b/Changelog.txt index a41ee747d8..d19f93fca1 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,9 @@ Date Added 01/07 + * Stall_time wasn't being read in login_athena at all (not by the login server, + because the code didn't read it, nor by TXT map server, since its in the SQL + inter_athena.conf reading)... so moved it to inter_athena.conf, and + change sql_config_read in map.c to inter_config_read [celest] * Some tidying up of battle_get_def and _def2 [celest] * Added 'bDelayrate' and changed Phen card, Marduk Card and Berzebub Card's effects to use this instead of bCastrate (which was reducing casting time, diff --git a/conf-tmpl/inter_athena.conf b/conf-tmpl/inter_athena.conf index 9d6040107e..b73865f8fa 100644 --- a/conf-tmpl/inter_athena.conf +++ b/conf-tmpl/inter_athena.conf @@ -23,12 +23,21 @@ castle_txt: save/castle.txt // Options for both versions +// Log Inter Connections, etc.? +log_inter: 1 + // Inter Log Filename inter_log_filename: log/inter.log // Level range for sharing within a party party_share_level: 10 +// How long can a socket stall before closing the connection +stall_time: 60 + + + +// SQL version options only // The lowest GM level on your server lowest_gm_level: 1 @@ -36,10 +45,6 @@ lowest_gm_level: 1 // How often the GM accounts will be reloaded by the map-server in minutes read_gm_interval: 10 - - -// SQL version options only - // Ideally under linux, you want to use localhost instead of 127.0.0.1. // // Under windows, you want to use 127.0.0.1. If you see a message like @@ -130,7 +135,4 @@ mob_db_db: mob_db //Use SQL item_db and mob_db for the map server use_sql_db: no -// Log Inter Connections, etc.? -log_inter: 1 - import: conf/import/inter_conf.txt diff --git a/conf-tmpl/login_athena.conf b/conf-tmpl/login_athena.conf index 4758f7dc0f..5b4395b28b 100644 --- a/conf-tmpl/login_athena.conf +++ b/conf-tmpl/login_athena.conf @@ -151,7 +151,5 @@ flush_on: 0 // How often to flush the buffer in Mugendai's GUI flush_time: 60 -// How long can a socket stall before closing the connection -stall_time: 60 import: conf/import/login_conf.txt diff --git a/src/map/map.c b/src/map/map.c index b3edeb2a8f..a591c97a2a 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2298,6 +2298,97 @@ int map_config_read(char *cfgName) { return 0; } +int inter_config_read(char *cfgName) +{ + int i; + char line[1024],w1[1024],w2[1024]; + FILE *fp; + + fp=fopen(cfgName,"r"); + if(fp==NULL){ + snprintf(tmp_output,sizeof(tmp_output),"File not found: '%s'.\n",cfgName); + ShowError(tmp_output); + return 1; + } + while(fgets(line,1020,fp)){ + if(line[0] == '/' && line[1] == '/') + continue; + i=sscanf(line,"%[^:]: %[^\r\n]",w1,w2); + if(i!=2) + continue; + if(strcmpi(w1,"stall_time")==0){ + stall_time_ = atoi(w2); + #ifndef TXT_ONLY + } else if(strcmpi(w1,"item_db_db")==0){ + strcpy(item_db_db,w2); + } else if(strcmpi(w1,"mob_db_db")==0){ + strcpy(mob_db_db,w2); + } else if(strcmpi(w1,"login_db_level")==0){ + strcpy(login_db_level,w2); + } else if(strcmpi(w1,"login_db_account_id")==0){ + strcpy(login_db_account_id,w2); + } else if(strcmpi(w1,"login_db")==0){ + strcpy(login_db,w2); + } else if (strcmpi(w1, "char_db") == 0) { + strcpy(char_db, w2); + } else if(strcmpi(w1,"gm_db_level")==0){ + strcpy(gm_db_level,w2); + } else if(strcmpi(w1,"gm_db_account_id")==0){ + strcpy(gm_db_account_id,w2); + } else if(strcmpi(w1,"gm_db")==0){ + strcpy(gm_db,w2); + //Map Server SQL DB + } else if(strcmpi(w1,"map_server_ip")==0){ + strcpy(map_server_ip, w2); + } else if(strcmpi(w1,"map_server_port")==0){ + map_server_port=atoi(w2); + } else if(strcmpi(w1,"map_server_id")==0){ + strcpy(map_server_id, w2); + } else if(strcmpi(w1,"map_server_pw")==0){ + strcpy(map_server_pw, w2); + } else if(strcmpi(w1,"map_server_db")==0){ + strcpy(map_server_db, w2); + } else if(strcmpi(w1,"use_sql_db")==0){ + if (strcmpi(w2,"yes")){db_use_sqldbs=0;} else if (strcmpi(w2,"no")){db_use_sqldbs=1;} + printf ("Using SQL dbs: %s\n",w2); + //Login Server SQL DB + } else if(strcmpi(w1,"login_server_ip")==0){ + strcpy(login_server_ip, w2); + } else if(strcmpi(w1,"login_server_port")==0){ + login_server_port = atoi(w2); + } else if(strcmpi(w1,"login_server_id")==0){ + strcpy(login_server_id, w2); + } else if(strcmpi(w1,"login_server_pw")==0){ + strcpy(login_server_pw, w2); + } else if(strcmpi(w1,"login_server_db")==0){ + strcpy(login_server_db, w2); + } else if(strcmpi(w1,"lowest_gm_level")==0){ + lowest_gm_level = atoi(w2); + } else if(strcmpi(w1,"read_gm_interval")==0){ + read_gm_interval = ( atoi(w2) * 60 * 1000 ); // Minutes multiplied by 60 secs per min by 1000 milliseconds per second + } else if(strcmpi(w1,"log_db")==0) { + strcpy(log_db, w2); + } else if(strcmpi(w1,"log_db_ip")==0) { + strcpy(log_db_ip, w2); + } else if(strcmpi(w1,"log_db")==0) { + strcpy(log_db, w2); + } else if(strcmpi(w1,"log_db_id")==0) { + strcpy(log_db_id, w2); + } else if(strcmpi(w1,"log_db_pw")==0) { + strcpy(log_db_pw, w2); + } else if(strcmpi(w1,"log_db_port")==0) { + log_db_port = atoi(w2); + #endif + //support the import command, just like any other config + } else if(strcmpi(w1,"import")==0){ + inter_config_read(w2); + } + } + fclose(fp); + + return 0; +} + #ifndef TXT_ONLY /*======================================= * MySQL Init @@ -2373,104 +2464,6 @@ int log_sql_init(void){ return 0; } -int sql_config_read(char *cfgName) -{ - int i; - char line[1024],w1[1024],w2[1024]; - FILE *fp; - - fp=fopen(cfgName,"r"); - if(fp==NULL){ - snprintf(tmp_output,sizeof(tmp_output),"File not found: '%s'.\n",cfgName); - ShowError(tmp_output); - return 1; - } - while(fgets(line,1020,fp)){ - if(line[0] == '/' && line[1] == '/') - continue; - i=sscanf(line,"%[^:]: %[^\r\n]",w1,w2); - if(i!=2) - continue; - if(strcmpi(w1,"item_db_db")==0){ - strcpy(item_db_db,w2); - } else if(strcmpi(w1,"mob_db_db")==0){ - strcpy(mob_db_db,w2); - } else if(strcmpi(w1,"login_db_level")==0){ - strcpy(login_db_level,w2); - } else if(strcmpi(w1,"login_db_account_id")==0){ - strcpy(login_db_account_id,w2); - } else if(strcmpi(w1,"login_db")==0){ - strcpy(login_db,w2); - } else if (strcmpi(w1, "char_db") == 0) { - strcpy(char_db, w2); - } else if(strcmpi(w1,"gm_db_level")==0){ - strcpy(gm_db_level,w2); - } else if(strcmpi(w1,"gm_db_account_id")==0){ - strcpy(gm_db_account_id,w2); - } else if(strcmpi(w1,"gm_db")==0){ - strcpy(gm_db,w2); - //Map Server SQL DB - } else if(strcmpi(w1,"map_server_ip")==0){ - strcpy(map_server_ip, w2); - } else if(strcmpi(w1,"map_server_port")==0){ - map_server_port=atoi(w2); - } else if(strcmpi(w1,"map_server_id")==0){ - strcpy(map_server_id, w2); - } else if(strcmpi(w1,"map_server_pw")==0){ - strcpy(map_server_pw, w2); - } else if(strcmpi(w1,"map_server_db")==0){ - strcpy(map_server_db, w2); - } else if(strcmpi(w1,"use_sql_db")==0){ - if (strcmpi(w2,"yes")){db_use_sqldbs=0;} else if (strcmpi(w2,"no")){db_use_sqldbs=1;} - printf ("Using SQL dbs: %s\n",w2); - //Login Server SQL DB - } else if(strcmpi(w1,"login_server_ip")==0){ - strcpy(login_server_ip, w2); - } else if(strcmpi(w1,"login_server_port")==0){ - login_server_port = atoi(w2); - } else if(strcmpi(w1,"login_server_id")==0){ - strcpy(login_server_id, w2); - } else if(strcmpi(w1,"login_server_pw")==0){ - strcpy(login_server_pw, w2); - } else if(strcmpi(w1,"login_server_db")==0){ - strcpy(login_server_db, w2); - } else if(strcmpi(w1,"stall_time")==0){ - stall_time_ = atoi(w2); - } else if(strcmpi(w1,"lowest_gm_level")==0){ - lowest_gm_level = atoi(w2); - } else if(strcmpi(w1,"read_gm_interval")==0){ - read_gm_interval = ( atoi(w2) * 60 * 1000 ); // Minutes multiplied by 60 secs per min by 1000 milliseconds per second - } else if(strcmpi(w1,"log_db")==0) { - strcpy(log_db, w2); - } else if(strcmpi(w1,"log_db_ip")==0) { - strcpy(log_db_ip, w2); - } else if(strcmpi(w1,"log_db")==0) { - strcpy(log_db, w2); - } else if(strcmpi(w1,"log_db_id")==0) { - strcpy(log_db_id, w2); - } else if(strcmpi(w1,"log_db_pw")==0) { - strcpy(log_db_pw, w2); - } else if(strcmpi(w1,"log_db_port")==0) { - log_db_port = atoi(w2); - }else if(strcmpi(w1,"read_map_from_bitmap")==0){ - if (atoi(w2) == 2) - map_read_flag = READ_FROM_BITMAP_COMPRESSED; - else if (atoi(w2) == 1) - map_read_flag = READ_FROM_BITMAP; - else - map_read_flag = READ_FROM_GAT; - }else if(strcmpi(w1,"map_bitmap_path")==0){ - strncpy(map_bitmap_filename,w2,255); - //support the import command, just like any other config - } else if(strcmpi(w1,"import")==0){ - sql_config_read(w2); - } - } - fclose(fp); - - return 0; -} - int online_timer(int tid,unsigned int tick,int id,int data) { if(check_online_timer != tid) @@ -2683,9 +2676,7 @@ int do_init(int argc, char *argv[]) { FILE *data_conf; char line[1024], w1[1024], w2[1024]; -#ifndef TXT_ONLY - unsigned char *SQL_CONF_NAME="conf/inter_athena.conf"; -#endif + unsigned char *INTER_CONF_NAME="conf/inter_athena.conf"; unsigned char *LOG_CONF_NAME="conf/log_athena.conf"; unsigned char *MAP_CONF_NAME = "conf/map_athena.conf"; unsigned char *BATTLE_CONF_FILENAME = "conf/battle_athena.conf"; @@ -2719,8 +2710,8 @@ int do_init(int argc, char *argv[]) { else if (strcmp(argv[i],"--grf_path_file") == 0 || strcmp(argv[i],"--grf-path-file") == 0) GRF_PATH_FILENAME = argv[i+1]; #ifndef TXT_ONLY - else if (strcmp(argv[i],"--sql_config") == 0 || strcmp(argv[i],"--sql-config") == 0) - SQL_CONF_NAME = argv[i+1]; + else if (strcmp(argv[i],"--inter_config") == 0 || strcmp(argv[i],"--inter-config") == 0) + INTER_CONF_NAME = argv[i+1]; #endif /* not TXT_ONLY */ else if (strcmp(argv[i],"--log_config") == 0 || strcmp(argv[i],"--log-config") == 0) LOG_CONF_NAME = argv[i+1]; @@ -2761,9 +2752,7 @@ int do_init(int argc, char *argv[]) { atcommand_config_read(ATCOMMAND_CONF_FILENAME); charcommand_config_read(CHARCOMMAND_CONF_FILENAME); script_config_read(SCRIPT_CONF_NAME); -#ifndef TXT_ONLY - sql_config_read(SQL_CONF_NAME); -#endif /* not TXT_ONLY */ + inter_config_read(INTER_CONF_NAME); log_config_read(LOG_CONF_NAME); atexit(do_final);