summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-09-25 08:50:52 -0300
committershennetsind <ind@henn.et>2013-09-25 08:50:52 -0300
commit1114eb3da58b078258a824424fef687a1ccee90c (patch)
tree1b9c3e4ef48021ce89b331bba2d49061bd08f341 /src/login
parent78c7c6bf04a6c96d92524ae37ad165e65f599eb8 (diff)
downloadhercules-1114eb3da58b078258a824424fef687a1ccee90c.tar.gz
hercules-1114eb3da58b078258a824424fef687a1ccee90c.tar.bz2
hercules-1114eb3da58b078258a824424fef687a1ccee90c.tar.xz
hercules-1114eb3da58b078258a824424fef687a1ccee90c.zip
Renamed iTimer interface to timer.
Also removed duplicate mentions of timer within calls to shorten.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/ipban_sql.c6
-rw-r--r--src/login/login.c26
2 files changed, 16 insertions, 16 deletions
diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c
index fd9f1a4a1..df516a3f6 100644
--- a/src/login/ipban_sql.c
+++ b/src/login/ipban_sql.c
@@ -86,8 +86,8 @@ void ipban_init(void)
if( login_config.ipban_cleanup_interval > 0 )
{ // set up periodic cleanup of connection history and active bans
- iTimer->add_timer_func_list(ipban_cleanup, "ipban_cleanup");
- cleanup_timer_id = iTimer->add_timer_interval(iTimer->gettick()+10, ipban_cleanup, 0, 0, login_config.ipban_cleanup_interval*1000);
+ timer->add_func_list(ipban_cleanup, "ipban_cleanup");
+ cleanup_timer_id = timer->add_interval(timer->gettick()+10, ipban_cleanup, 0, 0, login_config.ipban_cleanup_interval*1000);
} else // make sure it gets cleaned up on login-server start regardless of interval-based cleanups
ipban_cleanup(0,0,0,0);
}
@@ -100,7 +100,7 @@ void ipban_final(void)
if( login_config.ipban_cleanup_interval > 0 )
// release data
- iTimer->delete_timer(cleanup_timer_id, ipban_cleanup);
+ timer->delete(cleanup_timer_id, ipban_cleanup);
ipban_cleanup(0,0,0,0); // always clean up on login-server stop
diff --git a/src/login/login.c b/src/login/login.c
index f92f0094d..b603117e4 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -103,7 +103,7 @@ struct online_login_data* add_online_user(int char_server, int account_id)
p->char_server = char_server;
if( p->waiting_disconnect != INVALID_TIMER )
{
- iTimer->delete_timer(p->waiting_disconnect, waiting_disconnect_timer);
+ timer->delete(p->waiting_disconnect, waiting_disconnect_timer);
p->waiting_disconnect = INVALID_TIMER;
}
return p;
@@ -116,7 +116,7 @@ void remove_online_user(int account_id)
if( p == NULL )
return;
if( p->waiting_disconnect != INVALID_TIMER )
- iTimer->delete_timer(p->waiting_disconnect, waiting_disconnect_timer);
+ timer->delete(p->waiting_disconnect, waiting_disconnect_timer);
idb_remove(online_db, account_id);
}
@@ -145,7 +145,7 @@ static int online_db_setoffline(DBKey key, DBData *data, va_list ap)
p->char_server = -1;
if( p->waiting_disconnect != INVALID_TIMER )
{
- iTimer->delete_timer(p->waiting_disconnect, waiting_disconnect_timer);
+ timer->delete(p->waiting_disconnect, waiting_disconnect_timer);
p->waiting_disconnect = INVALID_TIMER;
}
}
@@ -793,7 +793,7 @@ int parse_fromchar(int fd)
p->char_server = id;
if (p->waiting_disconnect != INVALID_TIMER)
{
- iTimer->delete_timer(p->waiting_disconnect, waiting_disconnect_timer);
+ timer->delete(p->waiting_disconnect, waiting_disconnect_timer);
p->waiting_disconnect = INVALID_TIMER;
}
}
@@ -902,12 +902,12 @@ int parse_fromchar(int fd)
int mmo_auth_new(const char* userid, const char* pass, const char sex, const char* last_ip) {
static int num_regs = 0; // registration counter
static unsigned int new_reg_tick = 0;
- unsigned int tick = iTimer->gettick();
+ unsigned int tick = timer->gettick();
struct mmo_account acc;
//Account Registration Flood Protection by [Kevin]
if( new_reg_tick == 0 )
- new_reg_tick = iTimer->gettick();
+ new_reg_tick = timer->gettick();
if( DIFF_TICK(tick, new_reg_tick) < 0 && num_regs >= allowed_regs ) {
ShowNotice("Account registration denied (registration limit exceeded)\n");
return 3;
@@ -1151,7 +1151,7 @@ void login_auth_ok(struct login_session_data* sd)
WBUFL(buf,2) = sd->account_id;
charif_sendallwos(-1, buf, 6);
if( data->waiting_disconnect == INVALID_TIMER )
- data->waiting_disconnect = iTimer->add_timer(iTimer->gettick()+AUTH_TIMEOUT, waiting_disconnect_timer, sd->account_id, 0);
+ data->waiting_disconnect = timer->add(timer->gettick()+AUTH_TIMEOUT, waiting_disconnect_timer, sd->account_id, 0);
WFIFOHEAD(fd,3);
WFIFOW(fd,0) = 0x81;
@@ -1218,7 +1218,7 @@ void login_auth_ok(struct login_session_data* sd)
data = add_online_user(-1, sd->account_id);
// schedule deletion of this node
- data->waiting_disconnect = iTimer->add_timer(iTimer->gettick()+AUTH_TIMEOUT, waiting_disconnect_timer, sd->account_id, 0);
+ data->waiting_disconnect = timer->add(timer->gettick()+AUTH_TIMEOUT, waiting_disconnect_timer, sd->account_id, 0);
}
}
@@ -1796,7 +1796,7 @@ int do_init(int argc, char** argv)
// Online user database init
online_db = idb_alloc(DB_OPT_RELEASE_DATA);
- iTimer->add_timer_func_list(waiting_disconnect_timer, "waiting_disconnect_timer");
+ timer->add_func_list(waiting_disconnect_timer, "waiting_disconnect_timer");
// Interserver auth init
auth_db = idb_alloc(DB_OPT_RELEASE_DATA);
@@ -1805,13 +1805,13 @@ int do_init(int argc, char** argv)
set_defaultparse(parse_login);
// every 10 minutes cleanup online account db.
- iTimer->add_timer_func_list(online_data_cleanup, "online_data_cleanup");
- iTimer->add_timer_interval(iTimer->gettick() + 600*1000, online_data_cleanup, 0, 0, 600*1000);
+ timer->add_func_list(online_data_cleanup, "online_data_cleanup");
+ timer->add_interval(timer->gettick() + 600*1000, online_data_cleanup, 0, 0, 600*1000);
// add timer to detect ip address change and perform update
if (login_config.ip_sync_interval) {
- iTimer->add_timer_func_list(sync_ip_addresses, "sync_ip_addresses");
- iTimer->add_timer_interval(iTimer->gettick() + login_config.ip_sync_interval, sync_ip_addresses, 0, 0, login_config.ip_sync_interval);
+ timer->add_func_list(sync_ip_addresses, "sync_ip_addresses");
+ timer->add_interval(timer->gettick() + login_config.ip_sync_interval, sync_ip_addresses, 0, 0, login_config.ip_sync_interval);
}
// Account database init