Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!gatech!emory!dtscp1!joel From: joel@dtscp1.UUCP (Joel Rives) Newsgroups: comp.sources.games.bugs Subject: Re: Yet Another Galactic Bloodshed Problem... Keywords: AGH! Message-ID: <688@dtscp1.UUCP> Date: 12 May 89 17:34:14 GMT References: <12985@ut-emx.UUCP> Reply-To: joel@dtscp1.UUCP (Joel Rives) Organization: Digital Transmission Systems (a subsidiary of DCA), Duluth, GA Lines: 24 In article <12985@ut-emx.UUCP> ted@ut-emx.UUCP (Ted Woodward) writes: >Also, some docs on exactly what the daemon does would be useful-- >I don't particularly want to plod thru its sources right now... The source for the actual demon itself is fairly small and contained in the file daemon.c. Basically, it forks a process which seperates itself from the invokers terminal process (so, that it will persist after the user that has invoked the daemon has logged off). This child process then sets up a state and puts itself to sleep for a short while. When the process wakes up, it compares a state variable (setable in tweakables.h) to the current time stamp of the host machine. If it is time to run the turn, this daemon calls the function doturn() to handle the necissary dirty work and then puts itself back to sleep again. The same sort of functionality could be had very simply by making use of the Unix 'at' command (on Unix machines -- of course :-). This method has an advantage over the daemon process in that it is independant of whether the machine goes down at some point during the day. Unless the daemon process is set up to be automatically started when the machine comes up, the turns will cease to be updated until such time as the game controller can log on and start the daemon again. Joel