shogi-server source
Révision | f565a12329d70a6917348483d655b5e9bd383ee0 (tree) |
---|---|
l'heure | 2013-12-17 22:46:22 |
Auteur | Daigo Moriwaki <daigo@debi...> |
Commiter | Daigo Moriwaki |
Fixed issues on usiToCsa.rb.
- Corrected type of TORYO
- Corrected keep alive packet
@@ -372,7 +372,7 @@ class BridgeState | ||
372 | 372 | |
373 | 373 | case str.strip |
374 | 374 | when /^bestmove\s+resign/ |
375 | - server_puts "%TYORO" | |
375 | + server_puts "%TORYO" | |
376 | 376 | when /^bestmove\swin/ |
377 | 377 | server_puts "%KACHI" |
378 | 378 | when /^bestmove\s+(.*)/ |
@@ -522,6 +522,7 @@ end | ||
522 | 522 | def server_puts(str) |
523 | 523 | log_server_send str |
524 | 524 | $server.puts str |
525 | + $bridge_state.update_last_server_send_time | |
525 | 526 | end |
526 | 527 | |
527 | 528 | # Start an engine process |
@@ -613,9 +614,9 @@ def main_loop | ||
613 | 614 | ret, = select([$server, $engine], nil, nil, 60) |
614 | 615 | unless ret |
615 | 616 | # Send keep-alive |
616 | - if @bridge_state.too_quiet? | |
617 | + if $bridge_state.too_quiet? | |
617 | 618 | $server.puts "" |
618 | - @bridge_state.update_last_server_send_time | |
619 | + $bridge_state.update_last_server_send_time | |
619 | 620 | end |
620 | 621 | next |
621 | 622 | end |