diff options
-rw-r--r-- | Changelog-SVN.txt | 4 | ||||
-rw-r--r-- | conf-tmpl/char_athena.conf | 5 | ||||
-rw-r--r-- | conf-tmpl/login_athena.conf | 5 | ||||
-rw-r--r-- | src/char/char.c | 42 | ||||
-rw-r--r-- | src/char_sql/char.c | 44 | ||||
-rw-r--r-- | src/login/login.c | 47 | ||||
-rw-r--r-- | src/login_sql/login.c | 44 |
7 files changed, 4 insertions, 187 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt index 3ba3e0f0f..3ce650e1b 100644 --- a/Changelog-SVN.txt +++ b/Changelog-SVN.txt @@ -1,6 +1,10 @@ Date Added +04/04 + * Removed anti-freeze system for login and char -- Shinomori's update would + be enough to keep inter connections alive [celest] + 04/03 * integrating anti freeze system to status update [Shinomori] * Fixed impossible drops at 0.01% chance [Lupus] diff --git a/conf-tmpl/char_athena.conf b/conf-tmpl/char_athena.conf index 6b73b3447..06c1f4218 100644 --- a/conf-tmpl/char_athena.conf +++ b/conf-tmpl/char_athena.conf @@ -166,11 +166,6 @@ chars_per_account: 0 // What folder the DB files are in (item_db.txt, etc.) db_path: db -// Anti-freeze system enable -anti_freeze_enable: 0 -// Anti-freeze system interval (in seconds) -anti_freeze_interval: 6 - // Mugendai's GUI Support imalive_on: 0 imalive_time: 30 diff --git a/conf-tmpl/login_athena.conf b/conf-tmpl/login_athena.conf index 29c20a78e..03de39051 100644 --- a/conf-tmpl/login_athena.conf +++ b/conf-tmpl/login_athena.conf @@ -159,11 +159,6 @@ dynamic_pass_failure_ban_how_long: 60 dynamic_account_ban: 1 dynamic_account_ban_class: 0 -// Anti-freeze system enable -anti_freeze_enable: 1 -// Anti-freeze system interval (in seconds) -anti_freeze_interval: 30 - // Enable I'm Alive? imalive_on: 0 // How often to display I'm Alive diff --git a/src/char/char.c b/src/char/char.c index 0e3c4579f..93fd5ba44 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -48,9 +48,6 @@ typedef long in_addr_t; struct mmo_map_server server[MAX_MAP_SERVERS]; int server_fd[MAX_MAP_SERVERS]; -int server_freezeflag[MAX_MAP_SERVERS]; // Map-server anti-freeze system. Counter. 5 ok, 4...0 freezed -int anti_freeze_enable = 0; -int ANTI_FREEZE_INTERVAL = 6; int login_fd, char_fd; char userid[24]; @@ -2094,28 +2091,6 @@ int parse_tologin(int fd) { return 0; } -//-------------------------------- -// Map-server anti-freeze system -//-------------------------------- -int map_anti_freeze_system(int tid, unsigned int tick, int id, int data) { - int i; - - //printf("Entering in map_anti_freeze_system function to check freeze of servers.\n"); - for(i = 0; i < MAX_MAP_SERVERS; i++) { - if (server_fd[i] >= 0) {// if map-server is online - //printf("map_anti_freeze_system: server #%d, flag: %d.\n", i, server_freezeflag[i]); - if (server_freezeflag[i]-- < 1) { // Map-server anti-freeze system. Counter. 5 ok, 4...0 freezed - printf("Map-server anti-freeze system: char-server #%d is freezed -> disconnection.\n", i); - char_log("Map-server anti-freeze system: char-server #%d is freezed -> disconnection." RETCODE, - i); - session[server_fd[i]]->eof = 1; - } - } - } - - return 0; -} - int parse_frommap(int fd) { int i, j; int id; @@ -2261,8 +2236,6 @@ int parse_frommap(int fd) { if (RFIFOREST(fd) < 6 || RFIFOREST(fd) < RFIFOW(fd,2)) return 0; server[id].users = RFIFOW(fd,4); - if(anti_freeze_enable) - server_freezeflag[id] = 5; // Map anti-freeze system. Counter. 5 ok, 4...0 freezed // remove all previously online players of the server for(i = 0; i < online_players_max; i++) if (online_chars[i].server == id) { @@ -3015,8 +2988,6 @@ int parse_char(int fd) { WFIFOB(fd,2) = 0; session[fd]->func_parse = parse_frommap; server_fd[i] = fd; - if(anti_freeze_enable) - server_freezeflag[i] = 5; // Map anti-freeze system. Counter. 5 ok, 4...0 freezed server[i].ip = RFIFOL(fd,54); server[i].port = RFIFOW(fd,58); server[i].users = 0; @@ -3437,12 +3408,6 @@ int char_config_read(const char *cfgName) { online_refresh_html = 1; } else if(strcmpi(w1,"db_path")==0) { strcpy(db_path,w2); - } else if(strcmpi(w1,"anti_freeze_enable")==0){ - anti_freeze_enable = config_switch(w2); - } else if (strcmpi(w1, "anti_freeze_interval") == 0) { - ANTI_FREEZE_INTERVAL = atoi(w2); - if (ANTI_FREEZE_INTERVAL < 5) - ANTI_FREEZE_INTERVAL = 5; // minimum 5 seconds } else if (strcmpi(w1, "import") == 0) { char_config_read(w2); } else if (strcmpi(w1, "console") == 0) { @@ -3583,13 +3548,6 @@ int do_init(int argc, char **argv) { if (flush_on) add_timer_interval(gettick()+10, flush_timer,0,0,flush_time); - - - if(anti_freeze_enable > 0) { - add_timer_func_list(map_anti_freeze_system, "map_anti_freeze_system"); - i = add_timer_interval(gettick() + 1000, map_anti_freeze_system, 0, 0, ANTI_FREEZE_INTERVAL * 1000); // checks every X seconds user specifies - } - if(console) { set_defaultconsoleparse(parse_console); start_console(); diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 2cac7de08..1f90c27e1 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -78,10 +78,6 @@ char *SQL_CONF_NAME = "conf/inter_athena.conf"; struct mmo_map_server server[MAX_MAP_SERVERS]; int server_fd[MAX_MAP_SERVERS]; -int server_freezeflag[MAX_MAP_SERVERS]; // Map-server anti-freeze system. Counter. 5 ok, 4...0 freezed - -int anti_freeze_enable = 0; -int ANTI_FREEZE_INTERVAL = 6; int login_fd, char_fd; char userid[24]; @@ -1800,29 +1796,6 @@ int parse_tologin(int fd) { return 0; } -//-------------------------------- -// Map-server anti-freeze system -//-------------------------------- -int map_anti_freeze_system(int tid, unsigned int tick, int id, int data) { - int i; - - for(i = 0; i < MAX_MAP_SERVERS; i++) { - if (server_fd[i] >= 0) {// if map-server is online - printf("map_anti_freeze_system: server #%d, flag: %d.\n", i, server_freezeflag[i]); - if (server_freezeflag[i]-- < 1) {// Map-server anti-freeze system. Counter. 5 ok, 4...0 freezed - printf("Map-server anti-freeze system: char-server #%d is frozen -> disconnection.\n", i); - session[server_fd[i]]->eof = 1; - sprintf(tmp_sql, "DELETE FROM `ragsrvinfo` WHERE `index`='%d'", server_fd[i]); - if (mysql_query(&mysql_handle, tmp_sql)) { - printf("DB server Error - %s\n", mysql_error(&mysql_handle)); - } - } - } - } - - return 0; -} - int parse_frommap(int fd) { int i = 0, j = 0; int id; @@ -1972,8 +1945,6 @@ int parse_frommap(int fd) { if (RFIFOW(fd,4) != server[id].users) printf("[UserCount]: %d (Server: %d)\n", RFIFOW(fd,4), id); server[id].users = RFIFOW(fd,4); - if(anti_freeze_enable) - server_freezeflag[id] = 5; // Map anti-freeze system. Counter. 5 ok, 4...0 freezed RFIFOSKIP(fd,RFIFOW(fd,2)); break; @@ -2908,8 +2879,6 @@ int parse_char(int fd) { WFIFOSET(fd, 3); session[fd]->func_parse = parse_frommap; server_fd[i] = fd; - if(anti_freeze_enable) - server_freezeflag[i] = 5; // Map anti-freeze system. Counter. 5 ok, 4...0 freezed server[i].ip = RFIFOL(fd, 54); server[i].port = RFIFOW(fd, 58); server[i].users = 0; @@ -3384,13 +3353,6 @@ int char_config_read(const char *cfgName) { check_ip_flag = config_switch(w2); } else if (strcmpi(w1, "chars_per_account") == 0) { //maxchars per account [Sirius] char_per_account = atoi(w2); - // anti-freeze options [Valaris] - } else if(strcmpi(w1,"anti_freeze_enable")==0){ - anti_freeze_enable = config_switch(w2); - } else if (strcmpi(w1, "anti_freeze_interval") == 0) { - ANTI_FREEZE_INTERVAL = atoi(w2); - if (ANTI_FREEZE_INTERVAL < 5) - ANTI_FREEZE_INTERVAL = 5; // minimum 5 seconds } else if (strcmpi(w1, "import") == 0) { char_config_read(w2); } else if (strcmpi(w1, "console") == 0) { @@ -3494,7 +3456,6 @@ int do_init(int argc, char **argv){ //printf("add interval tic (mmo_char_sync_timer)....\n"); //i = add_timer_interval(gettick() + 10, mmo_char_sync_timer, 0, 0, autosave_interval); - add_timer_func_list(map_anti_freeze_system, "map_anti_freeze_system"); //Added for Mugendais I'm Alive mod if(imalive_on) add_timer_interval(gettick()+10, imalive_timer,0,0,imalive_time*1000); @@ -3503,11 +3464,6 @@ int do_init(int argc, char **argv){ if(flush_on) add_timer_interval(gettick()+10, flush_timer,0,0,flush_time); - if(anti_freeze_enable > 0) { - add_timer_func_list(map_anti_freeze_system, "map_anti_freeze_system"); - i = add_timer_interval(gettick() + 1000, map_anti_freeze_system, 0, 0, ANTI_FREEZE_INTERVAL * 1000); // checks every X seconds user specifies - } - read_gm_account(); if ( console ) { diff --git a/src/login/login.c b/src/login/login.c index d9858065e..bacf7a354 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -82,9 +82,6 @@ int display_parse_fromchar = 0; // 0: no, 1: yes (without packet 0x2714), 2: all struct mmo_char_server server[MAX_SERVERS]; int server_fd[MAX_SERVERS]; -int server_freezeflag[MAX_SERVERS]; // Char-server anti-freeze system. Counter. 5 ok, 4...0 freezed -int anti_freeze_enable = 0; -int ANTI_FREEZE_INTERVAL = 15; int login_fd; @@ -1260,32 +1257,6 @@ int mmo_auth(struct mmo_account* account, int fd) { return -1; // account OK } -//------------------------------- -// Char-server anti-freeze system -//------------------------------- -int char_anti_freeze_system(int tid, unsigned int tick, int id, int data) { - int i; - - //printf("Entering in char_anti_freeze_system function to check freeze of servers.\n"); - for(i = 0; i < MAX_SERVERS; i++) { - if (server_fd[i] >= 0) {// if char-server is online - //printf("char_anti_freeze_system: server #%d '%s', flag: %d.\n", i, server[i].name, server_freezeflag[i]); - if (server_freezeflag[i]-- < 1) { // Char-server anti-freeze system. Counter. 5 ok, 4...0 freezed - printf("Char-server anti-freeze system: char-server #%d '%s' is freezed -> disconnection.\n", i, server[i].name); - login_log("Char-server anti-freeze system: char-server #%d '%s' is freezed -> disconnection." RETCODE, - i, server[i].name); - session[server_fd[i]]->eof = 1; - } else { - // send alive packet to check connection - WFIFOW(server_fd[i],0) = 0x2718; - WFIFOSET(server_fd[i],2); - } - } - } - - return 0; -} - //-------------------------------- // Packet parsing for char-servers //-------------------------------- @@ -1392,9 +1363,6 @@ int parse_fromchar(int fd) { return 0; //printf("parse_fromchar: Receiving of the users number of the server '%s': %d\n", server[id].name, RFIFOL(fd,2)); server[id].users = RFIFOL(fd,2); - if(anti_freeze_enable) - server_freezeflag[id] = 5; // Char anti-freeze system. Counter. 5 ok, 4...0 freezed - // send some answer WFIFOW(fd,0) = 0x2718; WFIFOSET(fd,2); @@ -3060,8 +3028,6 @@ int parse_login(int fd) { server[account.account_id].maintenance = RFIFOW(fd,82); server[account.account_id].new_ = RFIFOW(fd,84); server_fd[account.account_id] = fd; - if(anti_freeze_enable) - server_freezeflag[account.account_id] = 5; // Char-server anti-freeze system. Counter. 5 ok, 4...0 freezed WFIFOW(fd,0) = 0x2711; WFIFOB(fd,2) = 0; WFIFOSET(fd,3); @@ -3083,10 +3049,8 @@ int parse_login(int fd) { if (server_fd[account.account_id] != -1) { printf("Connection of the char-server '%s' REFUSED - already connected (account: %ld-%s, pass: %s, ip: %s)\n", server_name, account.account_id, account.userid, account.passwd, ip); - printf("You must probably wait that the freeze system detect the disconnection.\n"); login_log("Connexion of the char-server '%s' REFUSED - already connected (account: %ld-%s, pass: %s, ip: %s)" RETCODE, server_name, account.account_id, account.userid, account.passwd, ip); - login_log("You must probably wait that the freeze system detect the disconnection." RETCODE); } else { printf("Connection of the char-server '%s' REFUSED (account: %s, pass: %s, ip: %s).\n", server_name, account.userid, account.passwd, ip); login_log("Connexion of the char-server '%s' REFUSED (account: %s, pass: %s, ip: %s)" RETCODE, @@ -3556,13 +3520,6 @@ int login_config_read(const char *cfgName) { dynamic_pass_failure_ban_how_many = atoi(w2); } else if (strcmpi(w1, "dynamic_pass_failure_ban_how_long") == 0) { dynamic_pass_failure_ban_how_long = atoi(w2); - // Anti-Freeze - } else if(strcmpi(w1,"anti_freeze_enable")==0){ - anti_freeze_enable = config_switch(w2); - } else if (strcmpi(w1, "anti_freeze_interval") == 0) { - ANTI_FREEZE_INTERVAL = atoi(w2); - if (ANTI_FREEZE_INTERVAL < 5) - ANTI_FREEZE_INTERVAL = 5; // minimum 5 seconds } else if (strcmpi(w1, "import") == 0) { login_config_read(w2); } else if(strcmpi(w1,"imalive_on")==0) { //Added by Mugendai for I'm Alive mod @@ -3980,10 +3937,6 @@ int do_init(int argc, char **argv) { //login_fd = make_listen_port(login_port); login_fd = make_listen_bind(bind_ip,login_port); - if(anti_freeze_enable > 0) { - add_timer_func_list(char_anti_freeze_system, "char_anti_freeze_system"); - i = add_timer_interval(gettick() + 1000, char_anti_freeze_system, 0, 0, ANTI_FREEZE_INTERVAL * 1000); - } add_timer_func_list(check_auth_sync, "check_auth_sync"); i = add_timer_interval(gettick() + 60000, check_auth_sync, 0, 0, 60000); // every 60 sec we check if we must save accounts file (only if necessary to save) diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 58432d037..387f51a91 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -79,9 +79,6 @@ int subnetmaski[4]; // Subnetmask added by kashy struct mmo_char_server server[MAX_SERVERS]; int server_fd[MAX_SERVERS]; -int server_freezeflag[MAX_SERVERS]; // Char-server anti-freeze system. Counter. 5 ok, 4...0 freezed -int anti_freeze_enable = 0; -int ANTI_FREEZE_INTERVAL = 15; int login_fd; @@ -648,28 +645,6 @@ int charif_sendallwos(int sfd, unsigned char *buf, unsigned int len) { return c; } -//-------------------------------- -// Char-server anti-freeze system -//-------------------------------- -int char_anti_freeze_system(int tid, unsigned int tick, int id, int data) { - int i; - - for(i = 0; i < MAX_SERVERS; i++) { - if (server_fd[i] >= 0) {// if char-server is online -// printf("char_anti_freeze_system: server #%d '%s', flag: %d.\n", i, server[i].name, server_freezeflag[i]); - if (server_freezeflag[i]-- < 1) {// Char-server anti-freeze system. Counter. 5 ok, 4...0 freezed - session[server_fd[i]]->eof = 1; - } else { - // send alive packet to check connection - WFIFOW(server_fd[i],0) = 0x2718; - WFIFOSET(server_fd[i],2); - } - } - } - - return 0; -} - //----------------------------------------------------- // char-server packet parse //----------------------------------------------------- @@ -800,9 +775,6 @@ int parse_fromchar(int fd){ } } - if(anti_freeze_enable) - server_freezeflag[id] = 5; // Char anti-freeze system. Counter. 5 ok, 4...0 freezed - // send some answer WFIFOW(fd,0) = 0x2718; WFIFOSET(fd,2); @@ -1454,8 +1426,6 @@ int parse_login(int fd) { server[account.account_id].maintenance=RFIFOW(fd,82); server[account.account_id].new_=RFIFOW(fd,84); server_fd[account.account_id]=fd; - if(anti_freeze_enable) - server_freezeflag[account.account_id] = 5; // Char-server anti-freeze system. Counter. 5 ok, 4...0 freezed sprintf(tmpsql,"DELETE FROM `sstatus` WHERE `index`='%ld'", account.account_id); //query if(mysql_query(&mysql_handle, tmpsql)) { @@ -1680,14 +1650,6 @@ int login_config_read(const char *cfgName){ dynamic_pass_failure_ban_how_long=atoi(w2); printf ("set dynamic_pass_failure_ban_how_long : %d\n",dynamic_pass_failure_ban_how_long); } - else if(strcmpi(w1,"anti_freeze_enable")==0){ - anti_freeze_enable = config_switch(w2); - } - else if (strcmpi(w1, "anti_freeze_interval") == 0) { - ANTI_FREEZE_INTERVAL = atoi(w2); - if (ANTI_FREEZE_INTERVAL < 5) - ANTI_FREEZE_INTERVAL = 5; // minimum 5 seconds - } else if (strcmpi(w1, "import") == 0) { login_config_read(w2); } else if(strcmpi(w1,"imalive_on")==0) { //Added by Mugendai for I'm Alive mod @@ -1916,12 +1878,6 @@ int do_init(int argc,char **argv){ if(flush_on) add_timer_interval(gettick()+10, flush_timer,0,0,flush_time); - - if(anti_freeze_enable > 0) { - add_timer_func_list(char_anti_freeze_system, "char_anti_freeze_system"); - i = add_timer_interval(gettick()+1000, char_anti_freeze_system, 0, 0, ANTI_FREEZE_INTERVAL * 1000); - } - // ban deleter timer - 1 minute term printf("add interval tic (ip_ban_check)....\n"); i=add_timer_interval(gettick()+10, ip_ban_check,0,0,60*1000); |