From 7c66f59d7fa170410b8a046008b48b6d67fa36d7 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 15 Jan 2007 16:43:01 +0000 Subject: - 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9653 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/login_sql/login.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/login_sql') diff --git a/src/login_sql/login.c b/src/login_sql/login.c index fbe0acc1d..25bc9bf74 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -471,7 +471,7 @@ int mmo_auth_new(struct mmo_account* account, char sex) unsigned int tick = gettick(); char user_password[256]; //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"); 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); } - if(tick > new_reg_tick) + if(DIFF_TICK(tick, new_reg_tick) > 0) { //Update the registration check. num_regs=0; - new_reg_tick=gettick()+time_allowed*1000; + new_reg_tick=tick+time_allowed*1000; } num_regs++; @@ -2398,6 +2398,8 @@ int do_init(int argc,char **argv){ 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); return 0; -- cgit v1.2.3-70-g09d2