tmi2_fluffos_v2/
tmi2_fluffos_v2/bin/
tmi2_fluffos_v2/etc/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/ChangeLog.old/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/Win32/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/compat/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/compat/simuls/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/include/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/clone/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/command/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/data/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/etc/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/include/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/inherit/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/inherit/master/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/log/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/compiler/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/efuns/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/operators/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/u/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/tmp/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/windows/
tmi2_fluffos_v2/lib/
tmi2_fluffos_v2/lib/adm/
tmi2_fluffos_v2/lib/adm/daemons/languages/
tmi2_fluffos_v2/lib/adm/daemons/network/I3/
tmi2_fluffos_v2/lib/adm/daemons/virtual/
tmi2_fluffos_v2/lib/adm/daemons/virtual/template/
tmi2_fluffos_v2/lib/adm/news/
tmi2_fluffos_v2/lib/adm/obj/
tmi2_fluffos_v2/lib/adm/obj/master/
tmi2_fluffos_v2/lib/adm/priv/
tmi2_fluffos_v2/lib/adm/shell/
tmi2_fluffos_v2/lib/adm/tmp/
tmi2_fluffos_v2/lib/cmds/
tmi2_fluffos_v2/lib/d/
tmi2_fluffos_v2/lib/d/Conf/
tmi2_fluffos_v2/lib/d/Conf/adm/
tmi2_fluffos_v2/lib/d/Conf/boards/
tmi2_fluffos_v2/lib/d/Conf/cmds/
tmi2_fluffos_v2/lib/d/Conf/data/
tmi2_fluffos_v2/lib/d/Conf/logs/
tmi2_fluffos_v2/lib/d/Conf/obj/
tmi2_fluffos_v2/lib/d/Conf/text/help/
tmi2_fluffos_v2/lib/d/Fooland/adm/
tmi2_fluffos_v2/lib/d/Fooland/data/
tmi2_fluffos_v2/lib/d/Fooland/data/attic/
tmi2_fluffos_v2/lib/d/Fooland/items/
tmi2_fluffos_v2/lib/d/TMI/
tmi2_fluffos_v2/lib/d/TMI/adm/
tmi2_fluffos_v2/lib/d/TMI/boards/
tmi2_fluffos_v2/lib/d/TMI/data/
tmi2_fluffos_v2/lib/d/TMI/rooms/
tmi2_fluffos_v2/lib/d/grid/
tmi2_fluffos_v2/lib/d/grid/adm/
tmi2_fluffos_v2/lib/d/grid/data/
tmi2_fluffos_v2/lib/d/std/
tmi2_fluffos_v2/lib/d/std/adm/
tmi2_fluffos_v2/lib/data/adm/
tmi2_fluffos_v2/lib/data/adm/daemons/
tmi2_fluffos_v2/lib/data/adm/daemons/doc_d/
tmi2_fluffos_v2/lib/data/adm/daemons/emoted/
tmi2_fluffos_v2/lib/data/adm/daemons/network/http/
tmi2_fluffos_v2/lib/data/adm/daemons/network/services/mail_q/
tmi2_fluffos_v2/lib/data/adm/daemons/network/smtp/
tmi2_fluffos_v2/lib/data/adm/daemons/news/archives/
tmi2_fluffos_v2/lib/data/attic/connection/
tmi2_fluffos_v2/lib/data/attic/user/
tmi2_fluffos_v2/lib/data/std/connection/b/
tmi2_fluffos_v2/lib/data/std/connection/l/
tmi2_fluffos_v2/lib/data/std/user/a/
tmi2_fluffos_v2/lib/data/std/user/b/
tmi2_fluffos_v2/lib/data/std/user/d/
tmi2_fluffos_v2/lib/data/std/user/f/
tmi2_fluffos_v2/lib/data/std/user/l/
tmi2_fluffos_v2/lib/data/std/user/x/
tmi2_fluffos_v2/lib/data/u/d/dm/working/doc_d/
tmi2_fluffos_v2/lib/data/u/l/leto/doc_d/
tmi2_fluffos_v2/lib/data/u/l/leto/smtp/
tmi2_fluffos_v2/lib/doc/
tmi2_fluffos_v2/lib/doc/driverdoc/applies/
tmi2_fluffos_v2/lib/doc/driverdoc/applies/interactive/
tmi2_fluffos_v2/lib/doc/driverdoc/concepts/
tmi2_fluffos_v2/lib/doc/driverdoc/driver/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/arrays/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/buffers/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/compile/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/ed/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/filesystem/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/floats/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/functions/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/general/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/mappings/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/numbers/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/parsing/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/constructs/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/preprocessor/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/types/
tmi2_fluffos_v2/lib/doc/driverdoc/platforms/
tmi2_fluffos_v2/lib/doc/mudlib/
tmi2_fluffos_v2/lib/ftp/
tmi2_fluffos_v2/lib/include/driver/
tmi2_fluffos_v2/lib/log/
tmi2_fluffos_v2/lib/log/driver/
tmi2_fluffos_v2/lib/obj/net/
tmi2_fluffos_v2/lib/obj/shells/
tmi2_fluffos_v2/lib/obj/tools/
tmi2_fluffos_v2/lib/std/adt/
tmi2_fluffos_v2/lib/std/board/
tmi2_fluffos_v2/lib/std/body/
tmi2_fluffos_v2/lib/std/fun/
tmi2_fluffos_v2/lib/std/living/
tmi2_fluffos_v2/lib/std/object/
tmi2_fluffos_v2/lib/std/shop/
tmi2_fluffos_v2/lib/std/socket/
tmi2_fluffos_v2/lib/std/user/
tmi2_fluffos_v2/lib/std/virtual/
tmi2_fluffos_v2/lib/student/
tmi2_fluffos_v2/lib/student/kalypso/
tmi2_fluffos_v2/lib/student/kalypso/armor/
tmi2_fluffos_v2/lib/student/kalypso/rooms/
tmi2_fluffos_v2/lib/student/kalypso/weapons/
tmi2_fluffos_v2/lib/u/l/leto/
tmi2_fluffos_v2/lib/u/l/leto/cmds/
tmi2_fluffos_v2/lib/www/errors/
tmi2_fluffos_v2/lib/www/gateways/
tmi2_fluffos_v2/lib/www/images/
tmi2_fluffos_v2/old/
tmi2_fluffos_v2/win32/
The TMI-2 mudlib comes with a daemon process that keeps track of a game
calendar and time and game weather. The actual computing is done by the
file /adm/daemons/weather_d.c. Several data files in /adm/etc define the
configuration of the year and the weather patterns.
The daemon keeps track of the current time and weather, and makes announcements
to selected objects when they change. Any room may call the set_outside()
lfun, defined in /std/room.c, to make itself an outdoor room. When the
weather changes or the day phase changes, announcements are made to all
outside rooms; in addition, when using the look command in an outdoor
room the player will get information on the time and weather. Other objects
can also request to receive the announcements by calling the function
request_weather_notices(); they can use receive_message() to catch the
announcements and respond accordingly. They can call cease_weather_notices()
to be removed from the list of objects receiving announcements.
The first thing the daemon does is keep track of the time of day and the
position of the sun. The length of the day is defined in /include/weather_d.h
and the day is divided into various phases. Each phase has four items
associated with it, two integers and two strings. The first integer is the
length of the phase in real seconds. The second integer is 1 if there is
sunlight during this phase and 0 if not. The first string is the descrptive
message to be printed when someone "looks" in an outdoor room during that
phase (if the weather is clear: see below). The second string is the message
to be printed at the end of the phase before changing to the next phase.
The phase data is stored in /adm/etc/daytime.data. The default configuration
is 8 phases: sunrise, morning, noon, afternoon, sunset, twilight, night,
and dawn. The default day length is 7200 seconds or two hours of real time.
There is light in all phases except night.
The function change_phase() is called at create time and call_out's itself
to initiate the next phase change. It updates the current phase and prints
the phase change messages. The function query_current_day_phase() will
return the look message of the current phase.
The second thing the daemon does is keep track of the game time and date.
The file weather_d.h defines START_DAY, START_MONTH, and START_YEAR, which
are the beginning of time in game time, and START_GAME_TIME which is the
time() value at which time began. The default start date is Day 1 of the
first month of year 100. The default START_GAME_TIME is 63117000, which
corresponds to 0:00:00 January 1 1993. When the daemon is created, it
gets the current real time from the time() efun and sets the date and
year appropriately. It also starts the daytime cycle at the appropriate
moment: time is assumed to have begun at 0:00 game time on the start
date, with the first day phase beginning at that time. Since sunrise
is the first phase of day, this means that sunrise occurs each day at
0:00 game time in the default mudlib. You can alter this by altering
the order of the phases in daytime.data if you wish.
The number of days in a month, and the number of months in a year, are
determined by the file /adm/etc/month.data. The default year contains
six months; one of 31 days, one of 29 days, and four of 30 days. Thus
the default year is 180 days. You can changes the number of months, the
names of the months, and their lengths in days by altering the month.data
file.
The function init_game_time() does the initialization of the calendar
and the daytime phase. The function query_game_time() returns a string
like the ctime() string giving the current game time.
The third thing the daemon does is keep track of the phase of the phase
of the moon. The file moon.data tracks the phases of the moon: each phase
has an integer which is the number of days in that moon phase, and
a string which is the message printed when the player looks at the
night sky. At the end of each day, the change_phase() function calls
do_day_end which changes the moon phase if necessary. The function
query_current_moon_phase() returns the string describing the moon's
current state.
The fourth thing the daemon does is keep track of the weather. The
daemon permits a certain number of weather states, eg. sunny, cloudy,
rainy. With each state are associated 6 pieces of data. Three are
messages: one is printed when the player looks at the sky, one is
printed if the weather changes to that state from a state of better
weather, and one is printed if the weather changes to that state from
a worse state. The file is arranged from best weather states to worse
weather states, so the "better" message is printed if coming from a
weather state later in the file and the "worse" message if coming from
earlier in the file. Two data are integers: one is the length of the
state in real seconds and the other is 1 if this state is "inclement"
and 0 if not. An inclement state is one where the sun and moon cannot
be seen, ie completely cloudy. The last datum is an array of integers
which represent the chance of changing from the given state into any
other state, in the order given in the file. Thus, if there are three
states, and the second state has datum:
20 50 30
then when the second state ends, there is a 20 percent chance to go to
the first state, 50 percent to stay in the second state, and 30 percent
to go to the third state. No messages are printed if the new state and old
state are the same.
The function change_weather() is called at create time and call_outs itself
so that there is always one instance of it pending. It picks a random number
from 1 to 100 and makes the appropriate state change based on that random
number. The function query_current_weather() will return the string that
describes the current weather state. The function query_weather_message(),
which is used by the look command, returns a grand summary message which
gives the day phase state if the weather is clear, the weather string,
and the moon phase if it is nighttime. Usually you want to use
this one rather than do the checks yourself.
The function query_ambient_light() will check the weather and daytime and
return 1 if there is outdooor light and 0 if not. There is always outdoor
light in daytime: at nighttime there is outdoor light if the skies are clear,
otherwise there is not light.