2 """Skeletal executable for the mudpy engine."""
4 # Copyright (c) 2006 mudpy, Jeremy Stanley <fungi@yuggoth.org>, all rights reserved.
5 # Licensed per terms in the LICENSE file distributed with this software.
7 # core objects for the mudpy engine
10 # a consistent list so we can reimport these on reload
21 for item in importlist: exec("from mudpy import " + item)
23 # log an initial message
24 log("Started mudpy with command line: " + " ".join(argv))
26 # fork and disassociate
30 create_pidfile(universe)
32 # loop indefinitely while the world is not flagged for termination or
33 # there are connected users
34 while not universe.terminate_flag or universe.userlist:
36 # the world was flagged for a reload of all code/data
37 if universe.reload_flag:
39 # reload the mudpy module
41 for item in importlist: exec("from mudpy import " + item)
43 # do what needs to be done on each pulse
46 # the loop has terminated, so save persistent data
50 log("Shutting down now.")
52 # get rid of the pidfile
53 remove_pidfile(universe)