2 """Skeletal executable for the mudpy engine."""
4 # Copyright (c) 2005, 2006 Jeremy Stanley <fungi@yuggoth.org>. All rights
5 # reserved. Licensed per terms in the LICENSE file distributed with this
8 # core objects for the mudpy engine
11 # a consistent list so we can reimport these on reload
22 for item in importlist: exec("from mudpy import " + item)
24 # log an initial message
25 log("Started mudpy with command line: " + " ".join(argv))
27 # fork and disassociate
31 create_pidfile(universe)
33 # loop indefinitely while the world is not flagged for termination or
34 # there are connected users
35 while not universe.terminate_flag or universe.userlist:
37 # the world was flagged for a reload of all code/data
38 if universe.reload_flag:
40 # reload the mudpy module
42 for item in importlist: exec("from mudpy import " + item)
44 # do what needs to be done on each pulse
47 # the loop has terminated, so save persistent data
51 log("Shutting down now.")
53 # get rid of the pidfile
54 remove_pidfile(universe)