diff options
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 32 | ||||
-rw-r--r-- | src/char/int_auction.c | 8 | ||||
-rw-r--r-- | src/char/int_guild.c | 6 | ||||
-rw-r--r-- | src/char/inter.c | 4 |
4 files changed, 25 insertions, 25 deletions
diff --git a/src/char/char.c b/src/char/char.c index 943d1f52e..f618320e1 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -212,7 +212,7 @@ void set_char_charselect(int account_id) character->pincode_enable = *pincode->charselect + *pincode->enabled; if(character->waiting_disconnect != INVALID_TIMER) { - iTimer->delete_timer(character->waiting_disconnect, chardb_waiting_disconnect); + timer->delete(character->waiting_disconnect, chardb_waiting_disconnect); character->waiting_disconnect = INVALID_TIMER; } @@ -253,7 +253,7 @@ void set_char_online(int map_id, int char_id, int account_id) //Get rid of disconnect timer if(character->waiting_disconnect != INVALID_TIMER) { - iTimer->delete_timer(character->waiting_disconnect, chardb_waiting_disconnect); + timer->delete(character->waiting_disconnect, chardb_waiting_disconnect); character->waiting_disconnect = INVALID_TIMER; } @@ -298,7 +298,7 @@ void set_char_offline(int char_id, int account_id) server[character->server].users--; if(character->waiting_disconnect != INVALID_TIMER){ - iTimer->delete_timer(character->waiting_disconnect, chardb_waiting_disconnect); + timer->delete(character->waiting_disconnect, chardb_waiting_disconnect); character->waiting_disconnect = INVALID_TIMER; } @@ -333,7 +333,7 @@ static int char_db_setoffline(DBKey key, DBData *data, va_list ap) character->char_id = -1; character->server = -1; if(character->waiting_disconnect != INVALID_TIMER){ - iTimer->delete_timer(character->waiting_disconnect, chardb_waiting_disconnect); + timer->delete(character->waiting_disconnect, chardb_waiting_disconnect); character->waiting_disconnect = INVALID_TIMER; } } else if (character->server == server) @@ -2036,7 +2036,7 @@ static void char_auth_ok(int fd, struct char_session_data *sd) { //Character already online. KICK KICK KICK mapif_disconnectplayer(server[character->server].fd, character->account_id, character->char_id, 2); if (character->waiting_disconnect == INVALID_TIMER) - character->waiting_disconnect = iTimer->add_timer(iTimer->gettick()+20000, chardb_waiting_disconnect, character->account_id, 0); + character->waiting_disconnect = timer->add(timer->gettick()+20000, chardb_waiting_disconnect, character->account_id, 0); if (character) character->pincode_enable = -1; WFIFOHEAD(fd,3); @@ -2115,7 +2115,7 @@ void loginif_on_ready(void) loginif_check_shutdown(); //Send online accounts to login server. - send_accounts_tologin(INVALID_TIMER, iTimer->gettick(), 0, 0); + send_accounts_tologin(INVALID_TIMER, timer->gettick(), 0, 0); // if no map-server already connected, display a message... ARR_FIND( 0, ARRAYLENGTH(server), i, server[i].fd > 0 && server[i].map[0] ); @@ -2404,7 +2404,7 @@ int parse_fromlogin(int fd) { { //Kick it from the map server it is on. mapif_disconnectplayer(server[character->server].fd, character->account_id, character->char_id, 2); if (character->waiting_disconnect == INVALID_TIMER) - character->waiting_disconnect = iTimer->add_timer(iTimer->gettick()+AUTH_TIMEOUT, chardb_waiting_disconnect, character->account_id, 0); + character->waiting_disconnect = timer->add(timer->gettick()+AUTH_TIMEOUT, chardb_waiting_disconnect, character->account_id, 0); } else {// Manual kick from char server. @@ -2473,12 +2473,12 @@ int send_accounts_tologin(int tid, unsigned int tick, int id, intptr_t data); void do_init_loginif(void) { // establish char-login connection if not present - iTimer->add_timer_func_list(check_connect_login_server, "check_connect_login_server"); - iTimer->add_timer_interval(iTimer->gettick() + 1000, check_connect_login_server, 0, 0, 10 * 1000); + timer->add_func_list(check_connect_login_server, "check_connect_login_server"); + timer->add_interval(timer->gettick() + 1000, check_connect_login_server, 0, 0, 10 * 1000); // send a list of all online account IDs to login server - iTimer->add_timer_func_list(send_accounts_tologin, "send_accounts_tologin"); - iTimer->add_timer_interval(iTimer->gettick() + 1000, send_accounts_tologin, 0, 0, 3600 * 1000); //Sync online accounts every hour + timer->add_func_list(send_accounts_tologin, "send_accounts_tologin"); + timer->add_interval(timer->gettick() + 1000, send_accounts_tologin, 0, 0, 3600 * 1000); //Sync online accounts every hour } void do_final_loginif(void) @@ -5030,15 +5030,15 @@ int do_init(int argc, char **argv) { do_init_mapif(); // periodically update the overall user count on all mapservers + login server - iTimer->add_timer_func_list(broadcast_user_count, "broadcast_user_count"); - iTimer->add_timer_interval(iTimer->gettick() + 1000, broadcast_user_count, 0, 0, 5 * 1000); + timer->add_func_list(broadcast_user_count, "broadcast_user_count"); + timer->add_interval(timer->gettick() + 1000, broadcast_user_count, 0, 0, 5 * 1000); // Timer to clear (online_char_db) - iTimer->add_timer_func_list(chardb_waiting_disconnect, "chardb_waiting_disconnect"); + timer->add_func_list(chardb_waiting_disconnect, "chardb_waiting_disconnect"); // Online Data timers (checking if char still connected) - iTimer->add_timer_func_list(online_data_cleanup, "online_data_cleanup"); - iTimer->add_timer_interval(iTimer->gettick() + 1000, online_data_cleanup, 0, 0, 600 * 1000); + timer->add_func_list(online_data_cleanup, "online_data_cleanup"); + timer->add_interval(timer->gettick() + 1000, online_data_cleanup, 0, 0, 600 * 1000); //Cleaning the tables for NULL entrys @ startup [Sirius] //Chardb clean diff --git a/src/char/int_auction.c b/src/char/int_auction.c index bf5ea1700..0dad9d2de 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -115,7 +115,7 @@ unsigned int auction_create(struct auction_data *auction) auction->item.expire_time = 0; auction->auction_id = (unsigned int)SQL->StmtLastInsertId(stmt); - auction->auction_end_timer = iTimer->add_timer( iTimer->gettick() + tick , auction_end_timer, auction->auction_id, 0); + auction->auction_end_timer = timer->add( timer->gettick() + tick , auction_end_timer, auction->auction_id, 0); ShowInfo("New Auction %u | time left %u ms | By %s.\n", auction->auction_id, tick, auction->seller_name); CREATE(auction_, struct auction_data, 1); @@ -170,7 +170,7 @@ void auction_delete(struct auction_data *auction) Sql_ShowDebug(sql_handle); if( auction->auction_end_timer != INVALID_TIMER ) - iTimer->delete_timer(auction->auction_end_timer, auction_end_timer); + timer->delete(auction->auction_end_timer, auction_end_timer); idb_remove(auction_db_, auction_id); } @@ -182,7 +182,7 @@ void inter_auctions_fromsql(void) struct item *item; char *data; StringBuf buf; - unsigned int tick = iTimer->gettick(), endtick; + unsigned int tick = timer->gettick(), endtick; time_t now = time(NULL); StrBuf->Init(&buf); @@ -234,7 +234,7 @@ void inter_auctions_fromsql(void) else endtick = tick + 10000; // 10 Second's to process ended auctions - auction->auction_end_timer = iTimer->add_timer(endtick, auction_end_timer, auction->auction_id, 0); + auction->auction_end_timer = timer->add(endtick, auction_end_timer, auction->auction_id, 0); idb_put(auction_db_, auction->auction_id, auction); } diff --git a/src/char/int_guild.c b/src/char/int_guild.c index a9bce9cbe..fab63894e 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -86,7 +86,7 @@ static int guild_save_timer(int tid, unsigned int tick, int id, intptr_t data) state = guild_db_->size(guild_db_); if( state < 1 ) state = 1; //Calculate the time slot for the next save. - iTimer->add_timer(tick + autosave_interval/state, guild_save_timer, 0, 0); + timer->add(tick + autosave_interval/state, guild_save_timer, 0, 0); return 0; } @@ -729,8 +729,8 @@ int inter_guild_sql_init(void) //Read exp file sv->readdb("db", DBPATH"exp_guild.txt", ',', 1, 1, 100, exp_guild_parse_row); - iTimer->add_timer_func_list(guild_save_timer, "guild_save_timer"); - iTimer->add_timer(iTimer->gettick() + 10000, guild_save_timer, 0, 0); + timer->add_func_list(guild_save_timer, "guild_save_timer"); + timer->add(timer->gettick() + 10000, guild_save_timer, 0, 0); return 0; } diff --git a/src/char/inter.c b/src/char/inter.c index 1ff2bca61..23f400ee9 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -946,7 +946,7 @@ int check_ttl_wisdata_sub(DBKey key, DBData *data, va_list ap) int check_ttl_wisdata(void) { - unsigned long tick = iTimer->gettick(); + unsigned long tick = timer->gettick(); int i; do { @@ -1039,7 +1039,7 @@ int mapif_parse_WisRequest(int fd) memcpy(wd->src, RFIFOP(fd, 4), NAME_LENGTH); memcpy(wd->dst, RFIFOP(fd,28), NAME_LENGTH); memcpy(wd->msg, RFIFOP(fd,52), wd->len); - wd->tick = iTimer->gettick(); + wd->tick = timer->gettick(); idb_put(wis_db, wd->id, wd); mapif_wis_message(wd); } |