import mudpy
-# 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.misc.universe.terminate_flag or mudpy.misc.universe.userlist:
+def main():
- # the world was flagged for a reload of all code/data
- if mudpy.misc.universe.reload_flag:
- imp.reload(mudpy)
- mudpy.misc.reload_data()
- mudpy.misc.universe.reload_flag = False
+ # start it up
+ mudpy.misc.setup()
- # do what needs to be done on each pulse
- mudpy.misc.on_pulse()
+ # loop indefinitely while the world is not flagged for termination or
+ # there are still connected users
+ while (not mudpy.misc.universe.terminate_flag or
+ mudpy.misc.universe.userlist):
-# shut it all down
-mudpy.misc.finish()
+ # the world was flagged for a reload of all code/data
+ if mudpy.misc.universe.reload_flag:
+ imp.reload(mudpy)
+ mudpy.misc.reload_data()
+ mudpy.misc.universe.reload_flag = False
+
+ # do what needs to be done on each pulse
+ mudpy.misc.on_pulse()
+
+ # shut it all down
+ mudpy.misc.finish()
+
+
+if __name__ == '__main__':
+ sys.exit(main())