From: beatles Date: Sat, 28 Jun 2008 07:15:42 +0000 (+0000) Subject: * [shogi-server] X-Git-Tag: 20170902~248 X-Git-Url: http://git.sourceforge.jp/view?p=shogi-server%2Fshogi-server.git;a=commitdiff_plain;h=9c7e207f5491877553134351ae13d0ec8dec7950;ds=sidebyside * [shogi-server] - A rating comment line is now written before the first move in a record file instead of after the last move, which allows other applications watching a game to recognize players in the middle of the game. --- diff --git a/changelog b/changelog index 70b2377..f394f70 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,14 @@ 2008-06-28 Daigo Moriwaki * [shogi-server] + - A rating comment line is now written before the first move in a + record file instead of after the last move, which allows other + applications watching a game to recognize players in the middle + of the game. + +2008-06-27 Daigo Moriwaki + + * [shogi-server] - Pairing players might not have shuffled players because of poor shuffling algorithm. This issue has been fixed. (Closes: #12661) diff --git a/shogi_server/game.rb b/shogi_server/game.rb index d649e8d..154db72 100644 --- a/shogi_server/game.rb +++ b/shogi_server/game.rb @@ -50,16 +50,6 @@ class GameResult log(@game.board.to_s.gsub(/^/, "\'")) end - def log_rating - log("'rating:%s\n" % [self.to_s]) if @game.rated? - end - - def to_s - black_name = @black.rated? ? @black.player_id : @black.name - white_name = @white.rated? ? @white.player_id : @white.name - return "%s:%s" % [black_name, white_name] - end - def notify_monitor(type) @game.each_monitor do |monitor| monitor.write_safe(sprintf("##[MONITOR][%s] %s\n", @game.game_id, type)) @@ -92,7 +82,6 @@ class GameResultWin < GameResult @black.name, black_result, @white.name, white_result]) - log_rating end end @@ -204,7 +193,6 @@ class GameResultDraw < GameResult def log_summary(type) log_board log("'summary:%s:%s draw:%s draw\n", type, @black.name, @white.name) - log_rating end end @@ -467,6 +455,11 @@ P8 * +KA * * * * * +HI * P9+KY+KE+GI+KI+OU+KI+GI+KE+KY + EOM + if rated? + black_name = @sente.rated? ? @sente.player_id : @sente.name + white_name = @gote.rated? ? @gote.player_id : @gote.name + @fh.puts("'rating:%s:%s" % [black_name, white_name]) + end end def show()