X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=bin%2Fmudpy;fp=mudpy;h=0dfefd2a78e52c8fa392b115374560014be1294b;hp=230ab0e001ce9f6bcc7ef8287e79b9aaae88afb0;hb=8bf6b7a787510321b75e477079ebf70ac150d853;hpb=518f0aad04432b4bf0405520e659db3d6ba00a76 diff --git a/mudpy b/bin/mudpy similarity index 50% rename from mudpy rename to bin/mudpy index 230ab0e..0dfefd2 100755 --- a/mudpy +++ b/bin/mudpy @@ -7,34 +7,25 @@ u"""Skeletal executable for the mudpy engine.""" # terms provided in the LICENSE file distributed with this software. # core objects for the mudpy engine +import os.path, sys +sys.path.append( os.path.realpath(u"lib") ) import mudpy -# log an initial message -import sys -mudpy.log(u"Started mudpy with command line: " + u" ".join(sys.argv)) - -# fork and disassociate -mudpy.daemonize(mudpy.universe) - -# make the pidfile -mudpy.create_pidfile(mudpy.universe) +# start it up +mudpy.misc.setup() # loop indefinitely while the world is not flagged for termination or # there are still connected users -while not mudpy.universe.terminate_flag or mudpy.universe.userlist: +while not mudpy.misc.universe.terminate_flag or mudpy.misc.universe.userlist: # the world was flagged for a reload of all code/data - if mudpy.universe.reload_flag: reload(mudpy) + if mudpy.misc.universe.reload_flag: + reload(mudpy) + mudpy.misc.reload_data() + mudpy.misc.universe.reload_flag = False # do what needs to be done on each pulse - mudpy.on_pulse() - -# the loop has terminated, so save persistent data -mudpy.universe.save() - -# log a final message -mudpy.log(u"Shutting down now.") - -# get rid of the pidfile -mudpy.remove_pidfile(mudpy.universe) + mudpy.misc.on_pulse() +# shut it all down +mudpy.misc.finish()