OSDN Git Service

Apply CSA Protocol V1.2.1 for MAX_MOVES
authorDaigo Moriwaki <daigo@debian.org>
Sat, 17 Jan 2015 01:18:40 +0000 (10:18 +0900)
committerDaigo Moriwaki <daigo@debian.org>
Sat, 17 Jan 2015 01:18:40 +0000 (10:18 +0900)
shogi-server
shogi_server/board.rb
shogi_server/game.rb
shogi_server/game_result.rb

index d6695b7..8468b1f 100755 (executable)
@@ -276,7 +276,7 @@ def check_command_line
   $options["max-moves"] ||= 256
   $options["max-moves"] = $options["max-moves"].to_i
 
-  $options["least-time-per-move"] ||= 1
+  $options["least-time-per-move"] ||= 0
   $options["least-time-per-move"] = $options["least-time-per-move"].to_i
 end
 
index eb2efaa..bcf8887 100644 (file)
@@ -626,7 +626,7 @@ EOF
   #   - :uchifuzume 
   #   - :oute_kaihimore 
   #   - (:outori will not be returned)
-  #   - :max_moves_draw
+  #   - :max_moves
   #
   def handle_one_move(str, sente=nil)
     if (str =~ /^([\+\-])(\d)(\d)(\d)(\d)([A-Z]{2})/)
@@ -719,7 +719,7 @@ EOF
     # When running test cases $options might be nil.
     if $options && $options["max-moves"] &&
        $options["max-moves"] > 0 && @move_count >= $options["max-moves"]
-      return :max_moves_draw
+      return :max_moves
     end
 
     return :normal
index 4ddd121..f610a95 100644 (file)
@@ -292,7 +292,7 @@ class Game
     elsif (move_status == :oute_kaihimore)
       # the current player losed
       @result = GameResultOuteKaihiMoreWin.new(self, @next_player, @current_player)
-    elsif (move_status == :max_moves_draw)
+    elsif (move_status == :max_moves)
       @result = GameResultMaxMovesDraw.new(self, @current_player, @next_player)
     else
       finish_flag = false
index 20c5057..678ef3f 100644 (file)
@@ -346,13 +346,13 @@ end
 class GameResultMaxMovesDraw < GameResultDraw
   def initialize(game, winner, loser)
     super
-    @log_summary_type = "max_moves_draw"
-    @result_type      = "#MAX_MOVES_DRAW"
+    @log_summary_type = "max_moves"
+    @result_type      = "#MAX_MOVES"
   end
 
   def process
     @players.each do |player|
-      player.write_safe("#MAX_MOVES_DRAW\n#DRAW\n")
+      player.write_safe("#MAX_MOVES\n#CENSORED\n")
     end
     # no log
     log_summary