OSDN Git Service

Start up shogi-server in foreground
[shogi-server/shogi-server.git] / shogi_server / command.rb
index 5b25200..dedbaae 100644 (file)
@@ -499,7 +499,7 @@ module ShogiServer
     def call
       if (! Login::good_game_name?(@game_name))
         @player.write_safe(sprintf("##[ERROR] bad game name: %s.\n", @game_name))
-        if (/^(.+)-\d+-\d+$/ =~ @game_name)
+        if (/^(.+)-\d+-\d+F?$/ =~ @game_name)
           if Login::good_identifier?($1)
             # do nothing
           else
@@ -552,7 +552,7 @@ module ShogiServer
             board = Board.new
             begin
               board.set_from_moves(moves_array)
-            rescue => err
+            rescue
               # it will never happen since moves have already been checked
               log_error "Failed to set up a buoy game: #{moves}"
               return :continue
@@ -775,7 +775,7 @@ module ShogiServer
       # found two players: p1 and p2
       log_info("Starting a buoy game: %s with %s and %s" % [@game_name, p1.name, p2.name])
       buoy.decrement_count(buoy_game)
-      game = Game::new(@game_name, p1, p2, board)
+      Game::new(@game_name, p1, p2, board)
       return :continue
 
     rescue WrongMoves => e
@@ -857,7 +857,7 @@ module ShogiServer
       byo_time   = nil
 
       if @source_game.split("+").size >= 2 &&
-         /^([^-]+)-(\d+)-(\d+)/ =~ @source_game.split("+")[1]
+         /^([^-]+)-(\d+)-(\d+F?)/ =~ @source_game.split("+")[1]
         name       = $1
         total_time = $2
         byo_time   = $3