def add_player_to_game(client): if not client.player: lobby_logger.error( 'Client could not be moved to the game, there was no player obj.') client.send('misc', db.get_msg('lobby.login_error')) client.close() else: lobby_logger.info("Adding player:%s to the game" % client.player.name) client.send('state', 'game') client.send('misc', db.get_msg('lobby.enter_game')) client.add_cycle(engine.cycle(client.send, 6, "player_hms", client.player)) client.add_cycle(engine.cycle(heal_tick, 6, [client])) room = world.get_room(client.player.room) room.contents.add_player(client) do_look(client, None, None) do_pi(client, None, None)
## setup logging This kinda feels wrong, but i need debug output on the imports ## here. import logging logging.basicConfig(level=logging.DEBUG) ## set the django settings module import os os.environ['DJANGO_SETTINGS_MODULE'] = 'lib.settings' mainLogger = logging.getLogger('main') mainLogger.info("Server Starting up.") from mud import Client, mudtime from pants import Server, engine if __name__ == '__main__': engine.cycle(mudtime.update, 1) Server(Client).listen(4000) engine.start()