class ClientPregame (Engine):
    # Constructor {{{1
    def __init__ (self, loop, client):
        print 'C: Begin pregame.'
        Engine.__init__(self, loop)
        self.client = client

        self.world = None
        self.conversation = None

    def setup(self):
        pipe = self.client.get_pipe()
        flavor = SetupWorld
        callback = self.setup_world
        self.conversation = SimpleReceive(pipe, flavor, callback)
        self.conversation.start()

    # Update, Callbacks, and Methods {{{1
    def update(self, time):
        if not self.conversation.finished(): self.conversation.update()
        else: self.exit_engine()

    def setup_world(self, message):
        self.world = message.world
        self.world.set_owner_identity(message.identity)

    def successor (self):
        pipe = self.client.get_pipe()
        forum = Forum(pipe, safe=False)

        return ClientGame(self.loop, forum, self.world)
    
    def teardown (self):
        pass
 def setup(self):
     pipe = self.client.get_pipe()
     flavor = SetupWorld
     callback = self.setup_world
     self.conversation = SimpleReceive(pipe, flavor, callback)
     self.conversation.start()