OSDN Git Service

game format changed
authornabeken <nabeken@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Sun, 11 Jul 2004 15:29:53 +0000 (15:29 +0000)
committernabeken <nabeken@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Sun, 11 Jul 2004 15:29:53 +0000 (15:29 +0000)
shogi-server

index feee48b..e9eb01d 100755 (executable)
@@ -21,7 +21,7 @@ Max_Write_Queue_Size = 1000
 Max_Identifier_Length = 32
 Default_Timeout = 60            # for single socket operation
 
-Default_Game_Name = "default:1500:0"
+Default_Game_Name = "default-1500-0"
 
 One_Time = 10
 Least_Time_Per_Move = 1
@@ -162,6 +162,7 @@ class Player
 
   def to_s
     if ((status == "game_waiting") ||
+        (status == "start_waiting") ||
         (status == "agree_waiting") ||
         (status == "game"))
       if (@sente)
@@ -267,7 +268,7 @@ class Player
           end
         when /^%%HELP/
           write_help
-        when /^%%GAME\s+(\S+)\s+([\+\-]+)$/
+        when /^%%GAME\s+(\S+)\s+([\+\-])/
           game_name = $1
           sente_str = $2
           if (! good_game_name?(game_name))
@@ -574,7 +575,7 @@ class Game
   def initialize(game_name, player0, player1)
     @monitors = Array::new
     @game_name = game_name
-    if (@game_name =~ /:(\d+):(\d+)/)
+    if (@game_name =~ /-(\d+)-(\d+)$/)
       @total_time = $1.to_i
       @byoyomi = $2.to_i
     end
@@ -995,7 +996,7 @@ def parse_command_line
 end
 
 def good_game_name?(str)
-  if ((str =~ /^(.+):\d+:\d+$/) &&
+  if ((str =~ /^(.+)-\d+-\d+$/) &&
       (good_identifier?($1)))
     return true
   else