From 80e36aa669274637bcd5956fbf4020dba1d4739c Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 9 Feb 2013 01:51:36 -0800 Subject: Strictify timers --- src/char/char.cpp | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'src/char/char.cpp') diff --git a/src/char/char.cpp b/src/char/char.cpp index 775ac69..7954655 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -37,7 +37,11 @@ int server_freezeflag[MAX_MAP_SERVERS]; // Map-server anti-freeze system. Cou static int anti_freeze_enable = 0; static -int ANTI_FREEZE_INTERVAL = 6; +std::chrono::seconds ANTI_FREEZE_INTERVAL = std::chrono::seconds(6); + +constexpr +std::chrono::milliseconds DEFAULT_AUTOSAVE_INTERVAL = + std::chrono::minutes(5); // TODO replace all string forms of IP addresses with class instances static @@ -120,7 +124,8 @@ static int char_num, char_max; static int max_connect_user = 0; -int autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; +static +std::chrono::milliseconds autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; static int start_zeny = 500; static @@ -569,7 +574,7 @@ void mmo_char_sync(void) // Function to save (in a periodic way) datas in files //---------------------------------------------------- static -void mmo_char_sync_timer(timer_id, tick_t, custom_id_t, custom_data_t) +void mmo_char_sync_timer(TimerData *, tick_t) { if (pid != 0) { @@ -784,7 +789,7 @@ int make_new_char(int fd, const uint8_t *dat) char_dat[i].sp = char_dat[i].max_sp; char_dat[i].status_point = 0; char_dat[i].skill_point = 0; - char_dat[i].option = Option(0x0000); + char_dat[i].option = static_cast