summaryrefslogtreecommitdiff
path: root/src/login_sql/login.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-15 16:43:01 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-15 16:43:01 +0000
commit7c66f59d7fa170410b8a046008b48b6d67fa36d7 (patch)
treeb37cf453885a28a3b277c0b5ab612770328a077d /src/login_sql/login.c
parent320b8e22f24cf05fe179fdf4da0f129930986482 (diff)
downloadhercules-7c66f59d7fa170410b8a046008b48b6d67fa36d7.tar.gz
hercules-7c66f59d7fa170410b8a046008b48b6d67fa36d7.tar.bz2
hercules-7c66f59d7fa170410b8a046008b48b6d67fa36d7.tar.xz
hercules-7c66f59d7fa170410b8a046008b48b6d67fa36d7.zip
- 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
Diffstat (limited to 'src/login_sql/login.c')
-rw-r--r--src/login_sql/login.c8
1 files changed, 5 insertions, 3 deletions
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;