- Probably fixed the registration flood protection code being broken.

- Readded a commented piece of code that's meant to prevent @warp from printing "invalid target cell!" messages on the console.
- Joint Break should only re-start the bleeding timer when it currently IS the one that causes bleeding.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9653 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2007-01-15 16:43:01 +00:00
parent c4d4b77cae
commit 1fcb743f2b
6 changed files with 22 additions and 14 deletions

View File

@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/01/15
* Probably fixed the registration flood protection code being broken.
* Joint Break should only re-start the bleeding timer when it currently IS
the one that causes bleeding. [Skotlex]
2007/01/12 2007/01/12
* Cleaned up the ip rules/DDoS section of the code. (the allow,deny and * Cleaned up the ip rules/DDoS section of the code. (the allow,deny and
deny,allow cases were switched) deny,allow cases were switched)

View File

@ -1193,14 +1193,11 @@ int mmo_auth(struct mmo_account* account, int fd) {
&& new_account_flag && account_id_count <= END_ACCOUNT_NUM && len >= 4 && strlen(account->passwd) >= 4) { && new_account_flag && account_id_count <= END_ACCOUNT_NUM && len >= 4 && strlen(account->passwd) >= 4) {
//only continue if amount in this time limit is allowed (account registration flood protection)[Kevin] //only continue if amount in this time limit is allowed (account registration flood protection)[Kevin]
if(gettick() <= new_reg_tick && num_regs >= allowed_regs) { if(DIFF_TICK(gettick(), new_reg_tick) < 0 && num_regs >= allowed_regs) {
ShowNotice("Account registration denied (registration limit exceeded) to %s!\n", ip); ShowNotice("Account registration denied (registration limit exceeded) to %s!\n", ip);
login_log("Notice: Account registration denied (registration limit exceeded) to %s!", ip); login_log("Notice: Account registration denied (registration limit exceeded) to %s!", ip);
return 3; return 3;
} else {
num_regs=0;
} }
newaccount = 1; newaccount = 1;
account->userid[len] = '\0'; account->userid[len] = '\0';
} }
@ -1359,13 +1356,15 @@ int mmo_auth(struct mmo_account* account, int fd) {
return 0; // 0 = Unregistered ID return 0; // 0 = Unregistered ID
} else { } else {
int new_id = mmo_auth_new(account, account->userid[len+1], "a@a.com"); int new_id = mmo_auth_new(account, account->userid[len+1], "a@a.com");
unsigned int tick = gettick();
login_log("Account creation and authentification accepted (account %s (id: %d), pass: %s, sex: %c, connection with _F/_M, ip: %s)" RETCODE, login_log("Account creation and authentification accepted (account %s (id: %d), pass: %s, sex: %c, connection with _F/_M, ip: %s)" RETCODE,
account->userid, new_id, account->passwd, account->userid[len+1], ip); account->userid, new_id, account->passwd, account->userid[len+1], ip);
auth_before_save_file = 0; // Creation of an account -> save accounts file immediatly auth_before_save_file = 0; // Creation of an account -> save accounts file immediatly
//restart ticker (account registration flood protection)[Kevin] if(DIFF_TICK(tick, new_reg_tick) > 0)
if(num_regs==0) { { //Update the registration check.
new_reg_tick=gettick()+time_allowed*1000; num_regs = 0;
new_reg_tick=tick +time_allowed*1000;
} }
num_regs++; num_regs++;
} }
@ -4192,6 +4191,8 @@ int do_init(int argc, char **argv) {
start_console(); start_console();
} }
new_reg_tick=gettick();
login_log("The login-server is ready (Server is listening on the port %d)." RETCODE, login_port); login_log("The login-server is ready (Server is listening on the port %d)." RETCODE, login_port);
ShowStatus("The login-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", login_port); ShowStatus("The login-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", login_port);

View File

@ -471,7 +471,7 @@ int mmo_auth_new(struct mmo_account* account, char sex)
unsigned int tick = gettick(); unsigned int tick = gettick();
char user_password[256]; char user_password[256];
//Account Registration Flood Protection by [Kevin] //Account Registration Flood Protection by [Kevin]
if(tick <= new_reg_tick && num_regs >= allowed_regs) { if(DIFF_TICK(tick, new_reg_tick) < 0 && num_regs >= allowed_regs) {
ShowNotice("Account registration denied (registration limit exceeded)\n"); ShowNotice("Account registration denied (registration limit exceeded)\n");
return 3; return 3;
} }
@ -531,10 +531,10 @@ int mmo_auth_new(struct mmo_account* account, char sex)
} }
ShowNotice("Updated New account %s's ID %d->%d (account_id must be %d or higher).", account->userid, id, START_ACCOUNT_NUM, START_ACCOUNT_NUM); ShowNotice("Updated New account %s's ID %d->%d (account_id must be %d or higher).", account->userid, id, START_ACCOUNT_NUM, START_ACCOUNT_NUM);
} }
if(tick > new_reg_tick) if(DIFF_TICK(tick, new_reg_tick) > 0)
{ //Update the registration check. { //Update the registration check.
num_regs=0; num_regs=0;
new_reg_tick=gettick()+time_allowed*1000; new_reg_tick=tick+time_allowed*1000;
} }
num_regs++; num_regs++;
@ -2398,6 +2398,8 @@ int do_init(int argc,char **argv){
start_console(); start_console();
} }
new_reg_tick=gettick();
ShowStatus("The login-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", login_port); ShowStatus("The login-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", login_port);
return 0; return 0;

View File

@ -1342,10 +1342,11 @@ int atcommand_rura(
return -1; return -1;
} }
/*if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS)) { if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS))
{ //This is to prevent the pc_setpos call from printing an error.
clif_displaymessage(fd, msg_txt(2)); clif_displaymessage(fd, msg_txt(2));
x = y = 0; //Invalid cell, use random spot. x = y = 0; //Invalid cell, use random spot.
}*/ }
if (map[m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) { if (map[m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
clif_displaymessage(fd, msg_txt(247)); clif_displaymessage(fd, msg_txt(247));
return -1; return -1;

View File

@ -8481,7 +8481,7 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
return 0; return 0;
} }
break; break;
case ST_RECOV_WEIGHT_RATE://## what is this for and why can battle_config.natural_heal_weight_rate be 101? [FlavioJS] case ST_RECOV_WEIGHT_RATE:
if(battle_config.natural_heal_weight_rate <= 100 && sd->weight*100/sd->max_weight >= battle_config.natural_heal_weight_rate) { if(battle_config.natural_heal_weight_rate <= 100 && sd->weight*100/sd->max_weight >= battle_config.natural_heal_weight_rate) {
clif_skill_fail(sd,skill,0,0); clif_skill_fail(sd,skill,0,0);
return 0; return 0;

View File

@ -5247,9 +5247,9 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
break; break;
case SC_JOINTBEAT: case SC_JOINTBEAT:
val2 |= sc->data[SC_JOINTBEAT].val2; // stackable ailments
if( val2&BREAK_NECK ) if( val2&BREAK_NECK )
sc_start(bl,SC_BLEEDING,100,val1,skill_get_time2(StatusSkillChangeTable[type],val1)); sc_start(bl,SC_BLEEDING,100,val1,skill_get_time2(StatusSkillChangeTable[type],val1));
val2 |= sc->data[SC_JOINTBEAT].val2; // stackable ailments
break; break;
case SC_BERSERK: case SC_BERSERK: