49 timers_table[i].
delay--;
50 if (timers_table[i].delay == 0) {
56 if (timers_table[i].delay <=
seconds()) {
110 timers_table[id].
mode = mode;
113 timers_table[id].
delay = delay;
static void cftimer_process_event(tag_t ob_tag)
Triggers the EVENT_TIMER of the given object.
#define TIMER_ERR_ID
Invalid timer id.
#define TIMER_ERR_OBJ
NULL object, or no EVENT_TIMER handler.
object * object_find_by_type_subtype(const object *who, int type, int subtype)
Find object in inventory.
int cftimer_destroy(int id)
Destroys an existing timer.
void cftimer_init(void)
Initialize timers.
cftimer timers_table[MAX_TIMERS]
The actual timers.
#define TIMER_MODE_CYCLES
Timer is in server cycles.
#define TIMER_MODE_DEAD
Used to mark a timer as unused in the list.
int cftimer_create(int id, long delay, object *ob, int mode)
Creates a new timer.
int cftimer_find_free_id(void)
Finds a free ID for a new timer.
#define EVENT_TIMER
Timer connected triggered it.
uint32_t tag_t
Object tag, unique during the whole game.
#define MAX_TIMERS
Maximum number of timers.
long seconds(void)
Return wall clock time in seconds.
void cftimer_process_timers(void)
Processes all timers.
tag_t ob_tag
Object associated to the timer.
object * object_find_by_tag_global(tag_t i)
Returns the object which has the count-variable equal to the argument.
#define TIMER_ERR_MODE
Invalid timer mode.
#define TIMER_ERR_NONE
No error.
Variables for the custom timers.
#define TIMER_MODE_SECONDS
Timer is in seconds.
long delay
Either server ticks before trigger, or trigger time.
Lauwenmark: an invisible object holding a plugin event hook.
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Execute an event on the specified object.
tag_t count
Unique object number for this object.