Imported from archive.
[mudpy.git] / bin / mudpy
diff --git a/mudpy b/bin/mudpy
similarity index 50%
rename from mudpy
rename to bin/mudpy
index 230ab0e..0dfefd2 100755 (executable)
--- 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()