Re: [code][newbie]A shutdown timer..or any timer for that matter.

From: Patrick Dughi (
Date: 03/30/99

> I was considering putting a timer in that would allow me to set a
> shutdown time...(kind of like *ix system shutdown). Where should I pulse
> the timer and what should I use for a flag to start the timer? A bool?
> Global bool? Should I just do it all somehow in comm.c?
        I'd just say, create one global time_t variable, set it to 0 on
startup.  If it's ever > than 0, then check and see if time(0) is greater
than it, and if so, shutdown now.  Your interface would be the most
difficult part, and if it's a hardship, I recommend just doing something
like allowing shutdown to have a minute argument.

        shutdown die 20

        Then you take and set your global time_t variable to time(0) +
60*20, and you're done.


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST