Exemplo n.º 1
0
    def connect_to_host(self):
        self.send_message(MessageCode.NEW_CONNECTION, Team.NONE,
                          str(self.nickname))

        # Block until we receive the map information back from the host.
        while not self.map_data:
            try:
                self.network_step(blocking=True)
            except Exception as err:
                print("Failed to connect to host. Aborting.")
                ERROR_LOGGER.exception("Failed to connect to host", err)
                SESSION.reset()
                publish_game_event(EventType.E_QUIT_BATTLE, {})
                break
Exemplo n.º 2
0
 def destroy(self):
     super().destroy()
     if SESSION:
         SESSION.reset()