Daemon event_d

Documentation for the daemons-event_d daemon in /daemons/event_d.c.

Module Information

The event_d handles events on the MUD, and can schedule things either in “real world time” or on MUD time. How time is defined on the mud is defined in <config/time.h> and should be configured there via admtool.

admtool -> Game configuration -> Settings

The event_d only handles day names, hours, minutes and seconds and disregards day count, day in a month, month names and years. This is left up to you to extend should you want to.

This daemon on purpose does not handle event like the yearly filling of the Xmas stockings or things that happen rarely - they are left for the wizards to kick off. This daemon handles things that happen often enough that players should experience them a few times per week depending on the settings in the /include/config/time.h file.

Thus the main focus is on weekly scheduled events, i.e. John goes to the bank at 16 with money suitcase Wednesdays and Saturdays (“00 16 2,5”), Bob goes to the cafe to buy a sandwich for lunch everyday (except Sunday) at 11:45 (“45 11 0-6”).

Functions

mixed week_day(mixed d)

If given an integer argument, returns the name of the day. If given a string name, returns the day number (0-X) - see config/time.h. If not not found, returns -1.

string *week_days()

Returns an array of the week days as defined in config/time.h.

int game_days_per_day()

Returns the number of game days we have per real days as defined in config/time.h.

varargs string time_to_weekday(int time)

Returns the week day name given time or uses time().

varargs string time_to_str(int time)

Translates the integer time into a string with weekday, hour, minute and seconds. The string returned will be in game time as defined in config/time.h.

varargs int str_to_time(string date)

Translates a string time into an integer that matches the next timestamp that matches the string. This will be from maximum one week away from the time given.

File generated by Lima 1.1a4 reStructured Text daemon.