2 # -*- coding: utf-8 -*-
3 u"""Skeletal executable for the mudpy engine."""
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.
9 # core objects for the mudpy engine
12 # log an initial message
14 mudpy.log(u"Started mudpy with command line: " + u" ".join(sys.argv))
16 # fork and disassociate
17 mudpy.daemonize(mudpy.universe)
20 mudpy.create_pidfile(mudpy.universe)
22 # loop indefinitely while the world is not flagged for termination or
23 # there are still connected users
24 while not mudpy.universe.terminate_flag or mudpy.universe.userlist:
26 # the world was flagged for a reload of all code/data
27 if mudpy.universe.reload_flag: reload(mudpy)
29 # do what needs to be done on each pulse
32 # the loop has terminated, so save persistent data
36 mudpy.log(u"Shutting down now.")
38 # get rid of the pidfile
39 mudpy.remove_pidfile(mudpy.universe)