Esempio n. 1
0
    def __init__(self, connection, ficsgame, timemodel):
        assert ficsgame.game_type in GAME_TYPES.values()
        GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
        self.connection = connection
        self.ficsgame = ficsgame
        self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)

        connections = self.connections
        connections[connection.bm].append(
            connection.bm.connect("boardUpdate", self.onBoardUpdate))
        connections[connection.bm].append(
            connection.bm.connect("obsGameEnded", self.onGameEnded))
        connections[connection.bm].append(
            connection.bm.connect("curGameEnded", self.onGameEnded))
        connections[connection.bm].append(
            connection.bm.connect("gamePaused", self.onGamePaused))
        connections[connection.om].append(
            connection.om.connect("onActionError", self.onActionError))
        connections[connection].append(
            connection.connect("disconnected", self.onDisconnected))

        rated = "rated" if ficsgame.rated else "unrated"
        # This is in the format that ficsgames.org writes these PGN headers
        self.tags["Event"] = "FICS %s %s game" % (rated,
                                                  ficsgame.game_type.fics_name)
        self.tags["Site"] = "FICS"
Esempio n. 2
0
 def __init__(self, minutes, inc, rated, game_type):
     assert minutes is None or isinstance(minutes, int), type(minutes)
     assert inc is None or isinstance(inc, int), inc
     assert isinstance(rated, bool), rated
     assert game_type is None or game_type is GAME_TYPES_BY_FICS_NAME["wild"] \
         or game_type in GAME_TYPES.values(), game_type
     GObject.GObject.__init__(self)
     self.minutes = minutes
     self.inc = inc
     self.rated = rated
     self.game_type = game_type
Esempio n. 3
0
 def __init__(self, minutes, inc, rated, game_type):
     assert minutes is None or isinstance(minutes, int), type(minutes)
     assert inc is None or isinstance(inc, int), inc
     assert isinstance(rated, bool), rated
     assert game_type is None or game_type is GAME_TYPES_BY_FICS_NAME["wild"] \
         or game_type in GAME_TYPES.values(), game_type
     GObject.GObject.__init__(self)
     self.minutes = minutes
     self.inc = inc
     self.rated = rated
     self.game_type = game_type
    def __init__(self, connection, ficsgame, timemodel):
        assert ficsgame.game_type in GAME_TYPES.values()
        GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
        self.connection = connection
        self.ficsgame = ficsgame
        self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)
        self.gmwidg_ready = asyncio.Event()
        self.kibitz_task = None
        self.disconnected = False

        connections = self.connections
        connections[connection.bm].append(
            connection.bm.connect("boardSetup", self.onBoardSetup))
        connections[connection.bm].append(
            connection.bm.connect("exGameReset", self.onExGameReset))
        connections[connection.bm].append(
            connection.bm.connect("gameUndoing", self.onGameUndoing))
        connections[connection.bm].append(
            connection.bm.connect("timesUpdate", self.onTimesUpdate))
        connections[connection.bm].append(
            connection.bm.connect("obsGameEnded", self.onGameEnded))
        connections[connection.bm].append(
            connection.bm.connect("curGameEnded", self.onGameEnded))
        connections[connection.bm].append(
            connection.bm.connect("gamePaused", self.onGamePaused))
        connections[connection.bm].append(
            connection.bm.connect("madeExamined", self.onMadeExamined))
        connections[connection.bm].append(
            connection.bm.connect("madeUnExamined", self.onMadeUnExamined))
        connections[connection.om].append(
            connection.om.connect("onActionError", self.onActionError))
        connections[connection.cm].append(
            connection.cm.connect("kibitzMessage", self.onKibitzMessage))
        connections[connection.cm].append(
            connection.cm.connect("whisperMessage", self.onWhisperMessage))
        connections[connection.cm].append(
            connection.cm.connect("observers_received",
                                  self.onObserversReceived))
        connections[connection].append(
            connection.connect("disconnected", self.onDisconnected))

        rated = "rated" if ficsgame.rated else "unrated"
        # This is in the format that ficsgames.org writes these PGN headers
        ics = "ICC" if self.connection.ICC else "FICS"
        self.tags["Event"] = "%s %s %s game" % (
            ics,
            rated,
            ficsgame.game_type.fics_name,
        )
        self.tags[
            "Site"] = "chessclub.com" if self.connection.ICC else "freechess.org"
Esempio n. 5
0
    def __init__(self, connection, ficsgame, timemodel):
        assert ficsgame.game_type in GAME_TYPES.values()
        GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
        self.connection = connection
        self.ficsgame = ficsgame
        self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)
        self.gmwidg_ready = asyncio.Event()
        self.kibitz_task = None
        self.disconnected = False

        connections = self.connections
        connections[connection.bm].append(connection.bm.connect(
            "boardSetup", self.onBoardSetup))
        connections[connection.bm].append(connection.bm.connect(
            "exGameReset", self.onExGameReset))
        connections[connection.bm].append(connection.bm.connect(
            "gameUndoing", self.onGameUndoing))
        connections[connection.bm].append(connection.bm.connect(
            "timesUpdate", self.onTimesUpdate))
        connections[connection.bm].append(connection.bm.connect(
            "obsGameEnded", self.onGameEnded))
        connections[connection.bm].append(connection.bm.connect(
            "curGameEnded", self.onGameEnded))
        connections[connection.bm].append(connection.bm.connect(
            "gamePaused", self.onGamePaused))
        connections[connection.bm].append(connection.bm.connect(
            "madeExamined", self.onMadeExamined))
        connections[connection.bm].append(connection.bm.connect(
            "madeUnExamined", self.onMadeUnExamined))
        connections[connection.om].append(connection.om.connect(
            "onActionError", self.onActionError))
        connections[connection.cm].append(connection.cm.connect(
            "kibitzMessage", self.onKibitzMessage))
        connections[connection.cm].append(connection.cm.connect(
            "whisperMessage", self.onWhisperMessage))
        connections[connection.cm].append(connection.cm.connect(
            "observers_received", self.onObserversReceived))
        connections[connection].append(connection.connect("disconnected",
                                                          self.onDisconnected))

        rated = "rated" if ficsgame.rated else "unrated"
        # This is in the format that ficsgames.org writes these PGN headers
        ics = "ICC" if self.connection.ICC else "FICS"
        self.tags["Event"] = "%s %s %s game" % (ics, rated, ficsgame.game_type.fics_name)
        self.tags["Site"] = "chessclub.com" if self.connection.ICC else "freechess.org"
Esempio n. 6
0
    def __init__(self, connection, ficsgame, timemodel):
        assert ficsgame.game_type in GAME_TYPES.values()
        GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
        self.connection = connection
        self.ficsgame = ficsgame
        self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)

        connections = self.connections
        connections[connection.bm].append(connection.bm.connect("boardUpdate", self.onBoardUpdate))
        connections[connection.bm].append(connection.bm.connect("obsGameEnded", self.onGameEnded))
        connections[connection.bm].append(connection.bm.connect("curGameEnded", self.onGameEnded))
        connections[connection.bm].append(connection.bm.connect("gamePaused", self.onGamePaused))
        connections[connection.om].append(connection.om.connect("onActionError", self.onActionError))
        connections[connection].append(connection.connect("disconnected", self.onDisconnected))

        rated = "rated" if ficsgame.rated else "unrated"
        # This is in the format that ficsgames.org writes these PGN headers
        self.tags["Event"] = "FICS %s %s game" % (rated, ficsgame.game_type.fics_name)
        self.tags["Site"] = "FICS"
Esempio n. 7
0
    def __init__(self, connection, ficsgame, timemodel):
        assert ficsgame.game_type in GAME_TYPES.values()
        GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
        self.connection = connection
        self.ficsgame = ficsgame
        self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)
        self.gmwidg_ready = threading.Event()

        connections = self.connections
        connections[connection.bm].append(
            connection.bm.connect("boardUpdate", self.onBoardUpdate))
        connections[connection.bm].append(
            connection.bm.connect("exGameBackward", self.onExGameBackward))
        connections[connection.bm].append(
            connection.bm.connect("timesUpdate", self.onTimesUpdate))
        connections[connection.bm].append(
            connection.bm.connect("obsGameEnded", self.onGameEnded))
        connections[connection.bm].append(
            connection.bm.connect("curGameEnded", self.onGameEnded))
        connections[connection.bm].append(
            connection.bm.connect("gamePaused", self.onGamePaused))
        connections[connection.bm].append(
            connection.bm.connect("madeExamined", self.onMadeExamined))
        connections[connection.bm].append(
            connection.bm.connect("madeUnExamined", self.onMadeUnExamined))
        connections[connection.om].append(
            connection.om.connect("onActionError", self.onActionError))
        connections[connection.cm].append(
            connection.cm.connect("kibitzMessage", self.onKibitzMessage))
        connections[connection.cm].append(
            connection.cm.connect("whisperMessage", self.onWhisperMessage))
        connections[connection.cm].append(
            connection.cm.connect("observers_received",
                                  self.onObserversReceived))
        connections[connection].append(
            connection.connect("disconnected", self.onDisconnected))

        rated = "rated" if ficsgame.rated else "unrated"
        # This is in the format that ficsgames.org writes these PGN headers
        self.tags["Event"] = "FICS %s %s game" % (rated,
                                                  ficsgame.game_type.fics_name)
        self.tags["Site"] = "freechess.org"
Esempio n. 8
0
    def __init__(self, connection, ficsgame, timemodel):
        assert ficsgame.game_type in GAME_TYPES.values()
        GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
        self.connection = connection
        self.ficsgame = ficsgame
        self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)
        self.gmwidg_ready = threading.Event()

        connections = self.connections
        connections[connection.bm].append(connection.bm.connect(
            "boardUpdate", self.onBoardUpdate))
        connections[connection.bm].append(connection.bm.connect(
            "timesUpdate", self.onTimesUpdate))
        connections[connection.bm].append(connection.bm.connect(
            "obsGameEnded", self.onGameEnded))
        connections[connection.bm].append(connection.bm.connect(
            "curGameEnded", self.onGameEnded))
        connections[connection.bm].append(connection.bm.connect(
            "gamePaused", self.onGamePaused))
        connections[connection.bm].append(connection.bm.connect(
            "madeExamined", self.onMadeExamined))
        connections[connection.bm].append(connection.bm.connect(
            "madeUnExamined", self.onMadeUnExamined))
        connections[connection.om].append(connection.om.connect(
            "onActionError", self.onActionError))
        connections[connection.cm].append(connection.cm.connect(
            "kibitzMessage", self.onKibitzMessage))
        connections[connection.cm].append(connection.cm.connect(
            "whisperMessage", self.onWhisperMessage))
        connections[connection.cm].append(connection.cm.connect(
            "observers_received", self.onObserversReceived))
        connections[connection].append(connection.connect("disconnected",
                                                          self.onDisconnected))

        rated = "rated" if ficsgame.rated else "unrated"
        # This is in the format that ficsgames.org writes these PGN headers
        self.tags["Event"] = "FICS %s %s game" % (rated,
                                                  ficsgame.game_type.fics_name)
        self.tags["Site"] = "freechess.org"