Explicitly invoke Python 3.x in shebang lines
[mudpy.git] / bin / mudpy
1 #!/usr/bin/env python3
2 """Skeletal executable for the mudpy engine."""
3
4 # Copyright (c) 2004-2016 Jeremy Stanley <fungi@yuggoth.org>. Permission
5 # to use, copy, modify, and distribute this software is granted under
6 # terms provided in the LICENSE file distributed with this software.
7
8 # core objects for the mudpy engine
9 import imp
10 import os
11 import sys
12 sys.path.append(os.path.realpath("lib"))
13
14 import mudpy
15
16 # start it up
17 mudpy.misc.setup()
18
19 # loop indefinitely while the world is not flagged for termination or
20 # there are still connected users
21 while not mudpy.misc.universe.terminate_flag or mudpy.misc.universe.userlist:
22
23     # the world was flagged for a reload of all code/data
24     if mudpy.misc.universe.reload_flag:
25         imp.reload(mudpy)
26         mudpy.misc.reload_data()
27         mudpy.misc.universe.reload_flag = False
28
29     # do what needs to be done on each pulse
30     mudpy.misc.on_pulse()
31
32 # shut it all down
33 mudpy.misc.finish()