shogi-server source
Revision | 310d29371b9fea5ea71cdb26a393df2dfefc5b57 (tree) |
---|---|
Time | 2004-07-12 00:29:53 |
Author | nabeken <nabeken@b8c6...> |
Commiter | nabeken |
game format changed
@@ -21,7 +21,7 @@ Max_Write_Queue_Size = 1000 | ||
21 | 21 | Max_Identifier_Length = 32 |
22 | 22 | Default_Timeout = 60 # for single socket operation |
23 | 23 | |
24 | -Default_Game_Name = "default:1500:0" | |
24 | +Default_Game_Name = "default-1500-0" | |
25 | 25 | |
26 | 26 | One_Time = 10 |
27 | 27 | Least_Time_Per_Move = 1 |
@@ -162,6 +162,7 @@ class Player | ||
162 | 162 | |
163 | 163 | def to_s |
164 | 164 | if ((status == "game_waiting") || |
165 | + (status == "start_waiting") || | |
165 | 166 | (status == "agree_waiting") || |
166 | 167 | (status == "game")) |
167 | 168 | if (@sente) |
@@ -267,7 +268,7 @@ class Player | ||
267 | 268 | end |
268 | 269 | when /^%%HELP/ |
269 | 270 | write_help |
270 | - when /^%%GAME\s+(\S+)\s+([\+\-]+)$/ | |
271 | + when /^%%GAME\s+(\S+)\s+([\+\-])/ | |
271 | 272 | game_name = $1 |
272 | 273 | sente_str = $2 |
273 | 274 | if (! good_game_name?(game_name)) |
@@ -574,7 +575,7 @@ class Game | ||
574 | 575 | def initialize(game_name, player0, player1) |
575 | 576 | @monitors = Array::new |
576 | 577 | @game_name = game_name |
577 | - if (@game_name =~ /:(\d+):(\d+)/) | |
578 | + if (@game_name =~ /-(\d+)-(\d+)$/) | |
578 | 579 | @total_time = $1.to_i |
579 | 580 | @byoyomi = $2.to_i |
580 | 581 | end |
@@ -995,7 +996,7 @@ def parse_command_line | ||
995 | 996 | end |
996 | 997 | |
997 | 998 | def good_game_name?(str) |
998 | - if ((str =~ /^(.+):\d+:\d+$/) && | |
999 | + if ((str =~ /^(.+)-\d+-\d+$/) && | |
999 | 1000 | (good_identifier?($1))) |
1000 | 1001 | return true |
1001 | 1002 | else |