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