Пример #1
0
 def buildProtocol(self, addr):
     protocol = PokerClientFactory.buildProtocol(self, addr)
     pokerbot = PokerBot(self)
     protocol._poll = False
     protocol.registerHandler(True, PACKET_BOOTSTRAP,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_ERROR,
                              pokerbot._handleConnection)
     protocol.registerHandler('outbound', PACKET_SERIAL,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_BATCH_MODE,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_STREAM_MODE,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_ERROR,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_TABLE_LIST,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_TOURNEY_LIST,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_WIN,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_PLAYER_LEAVE,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_SEAT,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_BLIND_REQUEST,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_SELF_IN_POSITION,
                              pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_SELF_LOST_POSITION,
                              pokerbot._handleConnection)
     return protocol
Пример #2
0
 def buildProtocol(self, addr):
     protocol = PokerClientFactory.buildProtocol(self, addr)
     protocol._poll = False
     pokerstats = self.pokerstats
     pokerstats.connect()
     protocol.registerHandler(True, PACKET_POKER_MONITOR_EVENT, pokerstats.pokerMonitorEvent)
     protocol.registerHandler(True, PACKET_BOOTSTRAP, pokerstats.bootstrap)
     def ack_and_stop(protocol, packet):
         pokerstats.ack(protocol, packet)
         if self.stop_service_deferred:
             self.stop_service_deferred.callback(True)
     protocol.registerHandler(True, PACKET_ACK, ack_and_stop)
     return protocol
Пример #3
0
    def buildProtocol(self, addr):
        protocol = PokerClientFactory.buildProtocol(self, addr)
        protocol._poll = False
        pokerstats = self.pokerstats
        pokerstats.connect()
        protocol.registerHandler(True, PACKET_POKER_MONITOR_EVENT,
                                 pokerstats.pokerMonitorEvent)
        protocol.registerHandler(True, PACKET_BOOTSTRAP, pokerstats.bootstrap)

        def ack_and_stop(protocol, packet):
            pokerstats.ack(protocol, packet)
            if self.stop_service_deferred:
                self.stop_service_deferred.callback(True)

        protocol.registerHandler(True, PACKET_ACK, ack_and_stop)
        return protocol
Пример #4
0
 def buildProtocol(self, addr):
     protocol = PokerClientFactory.buildProtocol(self, addr)
     pokerbot = PokerBot(self)
     protocol._poll = False
     protocol.registerHandler(True, PACKET_BOOTSTRAP, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_ERROR, pokerbot._handleConnection)
     protocol.registerHandler('outbound', PACKET_SERIAL, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_BATCH_MODE, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_STREAM_MODE, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_ERROR, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_TABLE_LIST, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_TOURNEY_LIST, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_WIN, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_PLAYER_LEAVE, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_SEAT, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_BLIND_REQUEST, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_SELF_IN_POSITION, pokerbot._handleConnection)
     protocol.registerHandler(True, PACKET_POKER_SELF_LOST_POSITION, pokerbot._handleConnection)
     return protocol
Пример #5
0
 def buildProtocol(self, addr):
     protocol = PokerClientFactory.buildProtocol(self, addr)
     self.renderer.setProtocol(protocol)
     self.display.setProtocol(protocol)
     return protocol
Пример #6
0
 def buildProtocol(self, addr):
     protocol = PokerClientFactory.buildProtocol(self, addr)
     self.renderer.setProtocol(protocol)
     self.display.setProtocol(protocol)
     return protocol