def sendPacket(self, packet): try: UGAMEClientProtocol.sendPacket(self, packet) self.screenObj.addLine("< " + str(packet)) except Exception: exc_type, exc_value, exc_traceback = sys.exc_info() self.screenObj.addLine(" EEE sendPacket failed: " + str(packet)) for exline in traceback.format_exception(exc_type, exc_value, exc_traceback): for line in exline.split('\n'): self.screenObj.addLine(" EEE " + str(line))
def sendPacket(self, packet): if packet.type == PACKET_POKER_TABLE_QUIT: self.scheduleTableAbort(self.getGame(packet.game_id)) elif packet.type == PACKET_POKER_SIT_OUT: game = self.getGame(packet.game_id) if game: game.sitOutNextTurn(packet.serial) self.schedulePacket(PacketPokerSitOutNextTurn(game_id = packet.game_id, serial = packet.serial)) elif packet.type == PACKET_POKER_SIT: game = self.getGame(packet.game_id) if game: game.sitRequested(packet.serial) self.schedulePacket(PacketPokerSitRequest(game_id = packet.game_id, serial = packet.serial)) elif packet.type == PACKET_QUIT: self.abortAllTables() UGAMEClientProtocol.sendPacket(self, packet)