Exemplo n.º 1
0
 def makeReady(self):
     PyChess.makeReady(self)
     
     self.connection = FICSConnection("freechess.org",self.ports,
                                      self.username, self.password)
     self.connection.connect("connectingMsg", self.__showConnectLog)
     self.connection._connect()
     
     self.connection.glm.connect("addPlayer", self.__onAddPlayer)
     self.connection.glm.connect("removePlayer", self.__onRemovePlayer)
     self.connection.cm.connect("privateMessage", self.__onTell)
     self.connection.alm.connect("logOut", self.__onLogOut)
     self.connection.bm.connect("playBoardCreated", self.__onPlayBoardCreated)
     self.connection.bm.connect("curGameEnded", self.__onGameEnded)
     self.connection.bm.connect("boardUpdate", self.__onBoardUpdate)
     self.connection.om.connect("onChallengeAdd", self.__onChallengeAdd)
     self.connection.om.connect("onOfferAdd", self.__onOfferAdd)
     self.connection.adm.connect("onAdjournmentsList", self.__onAdjournmentsList)
     self.connection.em.connect("onAmbiguousMove", self.__onAmbiguousMove)
     self.connection.em.connect("onIllegalMove", self.__onAmbiguousMove)
     
     self.connection.adm.queryAdjournments()
     self.connection.lvm.setVariable("autoflag", True)
     
     self.connection.fm.setFingerNote(1,
         "PyChess is the chess engine bundled with the PyChess %s " % pychess.VERSION +
         "chess client. This instance is owned by %s, but acts " % self.owner +
         "quite autonomously.")
     
     self.connection.fm.setFingerNote(2,
         "PyChess is 100% Python code and is released under the terms of " +
         "the GPL. The evalution function is largely equal to the one of" +
         "GnuChess, but it plays quite differently.")
     
     self.connection.fm.setFingerNote(3,
         "PyChess runs on an elderly AMD Sempron(tm) Processor 3200+, 512 " +
         "MB DDR2 Ram, but is built to take use of 64bit calculating when " +
         "accessible, through the gpm library.")
     
     self.connection.fm.setFingerNote(4,
         "PyChess uses a small 500 KB openingbook based solely on Kasparov " +
         "games. The engine doesn't have much endgame knowledge, but might " +
         "in some cases access an online endgamedatabase.")
     
     self.connection.fm.setFingerNote(5,
         "PyChess will allow any pause/resume and adjourn wishes, but will " +
         "deny takebacks. Draw, abort and switch offers are accepted, " +
         "if they are found to be an advance. Flag is auto called, but " +
         "PyChess never resigns. We don't want you to forget your basic " +
         "mating skills.")