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("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"
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"
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"
def __init__ (self, connection, gameno, timemodel, variant, rated=False): GameModel.__init__(self, timemodel, variant) self.connection = connection self.gameno = gameno 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)) self.inControl = True self.rated = rated
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"
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"
def __init__(self, connection, gameno, timemodel, variant, rated=False): GameModel.__init__(self, timemodel, variant) self.connection = connection self.gameno = gameno 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)) self.inControl = True self.rated = rated