summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
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/map/chrif.c
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/map/chrif.c')
-rw-r--r--src/map/chrif.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 524286da1..dcca72cc8 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -186,7 +186,7 @@ static bool chrif_sd_to_auth(TBL_PC* sd, enum sd_state state) {
node->sex = sd->status.sex;
node->fd = sd->fd;
node->sd = sd; //Data from logged on char.
- node->node_created = iTimer->gettick(); //timestamp for node timeouts
+ node->node_created = timer->gettick(); //timestamp for node timeouts
node->state = state;
sd->state.active = 0;
@@ -691,11 +691,11 @@ int auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
struct auth_node *node = DB->data2ptr(data);
const char* states[] = { "Login", "Logout", "Map change" };
- if(DIFF_TICK(iTimer->gettick(),node->node_created)>60000) {
+ if(DIFF_TICK(timer->gettick(),node->node_created)>60000) {
switch (node->state) {
case ST_LOGOUT:
//Re-save attempt (->sd should never be null here).
- node->node_created = iTimer->gettick(); //Refresh tick (avoid char-server load if connection is really bad)
+ node->node_created = timer->gettick(); //Refresh tick (avoid char-server load if connection is really bad)
chrif->save(node->sd, 1);
break;
default:
@@ -1170,10 +1170,10 @@ int chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of the
unsigned int tick;
struct status_change_data data;
struct status_change *sc = &sd->sc;
- const struct TimerData *timer;
+ const struct TimerData *td;
chrif_check(-1);
- tick = iTimer->gettick();
+ tick = timer->gettick();
WFIFOHEAD(char_fd, 14 + SC_MAX*sizeof(struct status_change_data));
WFIFOW(char_fd,0) = 0x2b1c;
@@ -1184,10 +1184,10 @@ int chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of the
if (!sc->data[i])
continue;
if (sc->data[i]->timer != INVALID_TIMER) {
- timer = iTimer->get_timer(sc->data[i]->timer);
- if (timer == NULL || timer->func != iStatus->change_timer || DIFF_TICK(timer->tick,tick) < 0)
+ td = timer->get(sc->data[i]->timer);
+ if (td == NULL || td->func != iStatus->change_timer || DIFF_TICK(td->tick,tick) < 0)
continue;
- data.tick = DIFF_TICK(timer->tick,tick); //Duration that is left before ending.
+ data.tick = DIFF_TICK(td->tick,tick); //Duration that is left before ending.
} else
data.tick = -1; //Infinite duration
data.type = i;
@@ -1342,7 +1342,7 @@ void chrif_on_disconnect(void) {
iMap->eraseallipport();
//Attempt to reconnect in a second. [Skotlex]
- iTimer->add_timer(iTimer->gettick() + 1000, check_connect_char_server, 0, 0);
+ timer->add(timer->gettick() + 1000, check_connect_char_server, 0, 0);
}
@@ -1643,17 +1643,17 @@ int do_init_chrif(void) {
auth_db = idb_alloc(DB_OPT_BASE);
auth_db_ers = ers_new(sizeof(struct auth_node),"chrif.c::auth_db_ers",ERS_OPT_NONE);
- iTimer->add_timer_func_list(check_connect_char_server, "check_connect_char_server");
- iTimer->add_timer_func_list(auth_db_cleanup, "auth_db_cleanup");
+ timer->add_func_list(check_connect_char_server, "check_connect_char_server");
+ timer->add_func_list(auth_db_cleanup, "auth_db_cleanup");
// establish map-char connection if not present
- iTimer->add_timer_interval(iTimer->gettick() + 1000, check_connect_char_server, 0, 0, 10 * 1000);
+ timer->add_interval(timer->gettick() + 1000, check_connect_char_server, 0, 0, 10 * 1000);
// wipe stale data for timed-out client connection requests
- iTimer->add_timer_interval(iTimer->gettick() + 1000, auth_db_cleanup, 0, 0, 30 * 1000);
+ timer->add_interval(timer->gettick() + 1000, auth_db_cleanup, 0, 0, 30 * 1000);
// send the user count every 10 seconds, to hide the charserver's online counting problem
- iTimer->add_timer_interval(iTimer->gettick() + 1000, send_usercount_tochar, 0, 0, UPDATE_INTERVAL);
+ timer->add_interval(timer->gettick() + 1000, send_usercount_tochar, 0, 0, UPDATE_INTERVAL);
return 0;
}