summaryrefslogtreecommitdiff
path: root/src/common/timer.h
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-03-24 20:24:47 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-03-24 22:43:26 -0700
commitef740ac0479a5a4f4240db63b84531599a26a983 (patch)
treeacd1f7acfbba606beb4565fe4d520e8721a4d18e /src/common/timer.h
parenta2306446c86b3333e69b082e41ae76ba71a42d9d (diff)
downloadtmwa-ef740ac0479a5a4f4240db63b84531599a26a983.tar.gz
tmwa-ef740ac0479a5a4f4240db63b84531599a26a983.tar.bz2
tmwa-ef740ac0479a5a4f4240db63b84531599a26a983.tar.xz
tmwa-ef740ac0479a5a4f4240db63b84531599a26a983.zip
Fix timer bugs in previous version
The most visible effect of this was that the map-server would never actually connect with the char-server
Diffstat (limited to 'src/common/timer.h')
-rw-r--r--src/common/timer.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/common/timer.h b/src/common/timer.h
index 4fa5db8..2a38e04 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -3,7 +3,8 @@
# include "sanity.h"
-enum TIMER_TYPE {
+enum TIMER_TYPE
+{
TIMER_ONCE_AUTODEL = 1,
TIMER_INTERVAL = 2,
};
@@ -32,7 +33,7 @@ struct TimerData
/// Type of timer - 0 initially
enum TIMER_TYPE type;
/// Repeat rate
- uint32_t interval;
+ interdb_val_t interval;
};
/// Server time, in milliseconds, since the epoch,
@@ -44,24 +45,16 @@ tick_t gettick_nocache (void);
/// the next 255 times
tick_t gettick (void);
-timer_id add_timer (tick_t tick, timer_func func, custom_id_t id,
- custom_data_t data);
-timer_id add_timer_interval (tick_t tick, timer_func func, custom_id_t id,
- custom_data_t data, interdb_val_t interval);
+timer_id add_timer (tick_t, timer_func, custom_id_t, custom_data_t);
+timer_id add_timer_interval (tick_t, timer_func, custom_id_t, custom_data_t, interdb_val_t);
void delete_timer (timer_id, timer_func);
-tick_t addtick_timer (timer_id tid, interdb_val_t tick);
+tick_t addtick_timer (timer_id, interdb_val_t);
struct TimerData *get_timer (timer_id tid);
/// Do all timers scheduled before tick, and return the number of milliseconds until the next timer happens
interdb_val_t do_timer (tick_t tick);
-// debugging
-static void add_timer_func_list (timer_func, char *) __attribute__((deprecated));
-static inline void add_timer_func_list (timer_func UNUSED, char *UNUSED) {}
-// used to just call free(), which doesn't matter when we're exiting
-static void timer_final () __attribute__((deprecated));
-static inline void timer_final() {};
#endif // TIMER_H