1 2017-09-03 Daigo Moriwaki <daigo at debian dot org>
3 * [shogi-server] Write game results in categorical files
4 The shogi-server now writes down game results in the following
5 files, depending on a game class:
7 - 00LIST.floodgate: floodgate games
8 - 00LIST.others: non-floodgate games
11 2017-09-02 Daigo Moriwaki <daigo at debian dot org>
13 * [shogi-server] Write more game results in record files
14 As the CSA Record Format standard states, "%TIME_UP" and
15 "%SENNICHITE" are now recorded in CSA files when a game ends for
16 timed up or sennichite respectively.
18 * [shogi-server, mk_game_results, mk_rate] Change schema to add number of
19 moves The format of an internal game result summary file, '00LIST',
20 has been changed to add number of moves of a game, which would be of
21 help for a script calculating rating scores.
23 * Update Revision to 20170902
25 2017-02-26 Daigo Moriwaki <daigo at debian dot org>
27 * utils/csa-filter.rb: Allow csa-filter.rb to filter games by a winner or loser
28 New command lines, --winner <player> or --loser <player>, are now
29 supported to supply extra filtering conditions. Note that each
30 filter is combined as AND condition.
32 - % ./csa-filter.rb ~/Downloads/20160314 --white gpsfish_xeon --loser gpsfish_xeon
33 - % ./csa-filter.rb ~/Downloads/20160314 --white gpsfish_xeon --winner gpsfish_xeon
36 2016-12-11 Daigo Moriwaki <daigo at debian dot org>
38 * Update Revision to 20161211.
41 2016-12-09 Daigo Moriwaki <daigo at debian dot org>
43 * Allow util/statistics.rb to set a filtering condition of found files
44 Regarding util/statistics.rb, add a new command line option,
45 --filter regexp, to process files that are matched with a regexp.
46 It would make it easier to calculate statistics of certain games.
49 2016-11-26 Daigo Moriwaki <daigo at debian dot org>
51 * [shogi-server] Allow to customize maximum lenght of a login indentifier
53 - The current maximum length of a login identifier is 32. Some
54 private uses require longer player names to distinguish each other
55 by specifying randomly generated tokens. It would of help to add a
56 new command line option --max-identifier to overwrite the default
58 * Build a Docker image for Shogi-server
60 - Build a Docker image
62 - Running a local shogi-server would look like
63 % docker pull shogiserver/shogiserver
64 % docker run -p 4081:4081 -v `pwd`/logs:/logs shogiserver/shogiserver
65 * [shogi-server] shogi_server/game.rb:
66 - Remove a debug message
68 2016-04-09 Daigo Moriwaki <daigo at debian dot org>
71 - Support Fischer time control.
72 * [shogi-server] Bump up the revision to 20160409.
74 2016-04-02 Daigo Moriwaki <daigo at debian dot org>
76 * [shogi-server] Support Fischer Time Control
78 - Fischer time control means that:
79 Before a player has made their move, a specified time increment is
80 added to their clock. Time can be accumulated, so if the player
81 moves within the delay period, their remaining time actually
83 (https://en.wikipedia.org/wiki/Chess_clock)
84 - New syntax of game names:
85 An 'F' suffix denotes a Fisher time in seconds. For example,
86 "floodgate-600-10F" specifies
88 + Total allotted time is 600 seconds for each player
89 + 10-second increment before a player's move in a Fischer way
90 - The server now proposes game conditions upon a game start with
91 - "Protocol_Version 1.2"
92 - "Increment:<n>" for Fischer Time Control
93 - Kifu files can include the following comment for Fischer Time
96 * [shogi-server] Fix some lint warnings.
98 2015-12-13 Daigo Moriwaki <daigo at debian dot org>
100 * [shogi-server] Enhance capability of Floodgate configuration file
101 - New parameter: Max_Moves, defined in the CSA protocol
102 ex. set Max_Moves 256
103 - New parameter: Least_Time_Per_Move, defined in the CSA protocol
104 ex. set Least_Time_Per_Move 0
105 - Proposed messages distributed to each player upon starting a new
106 game will include Max_Moves as well as Least_Time_Per_Move.
107 - CSA files produced by the server will include settings of
108 Max_Moves and Least_Time_Per_Move in comment lines as follows:
110 'Least_Time_Per_Move:0
111 - The official Shogi-server on wdoor.c.u-tokyo.ac.jp will
112 be running with different parameters, depending on game names.
113 a) Max_Moves will be 256 for floodgate-600-10 games;
115 b) Least_Time_Per_Move will be 0 for floodgate-600-10 games;
118 * [shogi-server] shogi_server/pairing.rb:
119 - LeastDiff attempts more trials, depending of a number of players
120 to be matched, top achieve more optimized matching combinations.
122 2015-11-27 Daigo Moriwaki <daigo at debian dot org>
124 * [shogi-server] shogi_server/time_clock.rb:
125 - A time consumed could be -1.
126 * The start time of a move is captured after sending a move to a
127 player of the next turn at the end of the giant lock
128 * The end time of the move is captured at the exact time when the
129 server receives it before the giant lock
130 Therefore, end_time < start_time is possible when a player returns a
132 Thanks to Tomoyuki Kaneko for reporting this issue.
135 2015-02-14 Daigo Moriwaki <daigo at debian dot org>
137 * util/statistics.rb:
138 - Updated to investigate floodgate-600-10 games.
139 Consult the result at
140 http://www.sgtpepper.net/hyspro/diary/20150214.html.
141 - Added a companion R script: histogram.R
143 2015-02-01 Daigo Moriwaki <daigo at debian dot org>
146 - shogi_server/login.rb: When players are logged in, log their
147 player_id if they have it.
149 2015-01-20 Daigo Moriwaki <daigo at debian dot org>
152 - Getting an absolute path of this file was wrong if it was a
153 symbolic link. This issue has been addressed.
155 - Links to details pages for players now use a relative path so
156 that it works on a testing site.
158 2015-01-17 Daigo Moriwaki <daigo at debian dot org>
161 - shogi-server, shogi_server/{command,game_result,player}.rb:
162 The change at 2014-10-13 was not worked as expected. Reworked.
163 A player, attempting to login with the current live player
164 stalling for more than a day, can forcibly override the current
167 2015-01-12 Daigo Moriwaki <daigo at debian dot org>
170 - shogi_server.rb: Follow an API change in a upstream class:
171 LogDevice.previous_period_end
173 2014-12-27 Daigo Moriwaki <daigo at debian dot org>
176 - When a non-rated player participates in Floodgate, the following exception
177 was thrown and a Floodgate game would not start:
178 undefined method `[]' for nil:NilClass
179 ["/home/shogi-server/www/x/shogi_server/pairing.rb:499:in `block
180 in calculate_diff_with_penalty'"
181 This issue has been resolved. Only players who have player ID
182 (i.e. those who log in with valid password) are now allowed to
183 participate in Floodgate as the spec web page
184 [http://shogi-server.sourceforge.jp/rating.html] describes.
186 2014-12-23 Daigo Moriwaki <daigo at debian dot org>
189 - Addressed Ruby incompatibility on ShogiServer::Usi::alphabetToDan.
190 It (and usiToCsa.rb) did not work with Ruby 1.9.3. This issue
192 Thanks to Hiraoka-san for debugging.
194 2014-12-18 Daigo Moriwaki <daigo at debian dot org>
196 * utils/eval_graph.rb:
197 - Gnuplot 4.6.6 drew evaluation-value lines with a dashed style.
198 This issue has now been addressed so that solid lines are used.
200 2014-11-30 Daigo Moriwaki <daigo at debian dot org>
205 2014-11-24 Daigo Moriwaki <daigo at debian dot org>
208 - Ruby 2.0.0 or later is recommended to use with shogi-server
209 since Ruby 1.8 reached its End-of-Life on the end of July, 2014.
211 - Addressed a warning of duplicated range in a regular expression.
213 2014-10-13 Daigo Moriwaki <daigo at debian dot org>
216 - A player, attempting to login with the current live player
217 stalling for more than a day, can forcibly override the current
219 - Kifu record files now includes rating scores of players at the
220 time when games start. Previously, for rating games, a record
221 file includes player IDs of both players with a line starting with
222 "'rating". Now it also shows rating scores for players who have
223 valid scores. The formats for black and white players are as
225 'black_rate:<player_id>:<score>
226 'white_rate:<player_id>:<score>
228 'rating:Test_sente+275876e34cf609db118f3d84b799a790:Test_gote+275876e34cf609db118f3d84b799a790
229 'black_rate:Test_sente+275876e34cf609db118f3d84b799a790:2763.0
230 'white_rate:Test_gote+275876e34cf609db118f3d84b799a790:2345.0
232 2014-10-12 Daigo Moriwaki <daigo at debian dot org>
235 - New feature: max moves
236 - New command line option: --max-moves n
237 When a game with the n-th move played does not end, make the
238 game a draw (default 256 in compliance with CSA Protocol V1.2
239 or later). Setting 0 disables this feature for
240 CSA Protocol V1.1.2 or before.
241 - Players will receive a new message, "#MAX_MOVES", upon an end
245 - A new log summary type, "max_moves", has been assigned for games
246 drawing with max moves.
247 'summary:max_moves:name_sente draw:name_gote draw
248 - Least time per move:
249 - New command line option: --least-time-per-move n
250 This option specifies a least time in second per move, which
251 is 0 second by default, meaning that a decimal
252 fraction of time for a move will be truncated in compliance
253 with CSA Protocol V1.2 or later.
254 Set 1 for CSA Protocol V1.1.2 or before.
256 2014-07-19 Daigo Moriwaki <daigo at debian dot org>
259 - Added a new option, --abnormal-threshold n:
260 Games that end with the 'abnormal' status are counted in
261 win/lost games for the rating calculation if a game plays more
262 than n plies. Otherwise (or if n is zero), abnormal games are
263 counted out of rating games.
265 2014-01-07 Daigo Moriwaki <daigo at debian dot org>
268 - Released: Revision "20140107"
270 2013-12-29 Daigo Moriwaki <daigo at debian dot org>
273 - Previously, parameters in Floodgate time configuration file were
274 not applied to actual instances. This issue has been fixed.
276 2013-12-21 Daigo Moriwaki <daigo at debian dot org>
279 - shogi_server/pairing.rb: Impose penalty on matches between
282 2013-12-15 Daigo Moriwaki <daigo at debian dot org>
285 - Listen on only IPv4 explicitly. Under ruby 1.9.3p194, without
286 any bind addresses, ruby attempts to listen on both "0.0.0.0"
287 and "::". Specifying "::" on Linux leads to listen on both IPv4
288 and IPv6, which results in a warning message saying "Address
289 already in use - bind(2)".
291 - Released: Revision "20131215"
293 2013-12-14 Daigo Moriwaki <daigo at debian dot org>
296 - Added a new program, bin/usiToCsa.rb, which is a bridge for a
297 USI engine to connect to the Shogi-server.
298 - bin/usiToCsa is a sample wrapper script.
300 2013-12-13 Daigo Moriwaki <daigo at debian dot org>
303 - shogi_server/league/floodgate_thread.rb:
304 - Added a log message.
306 2013-12-08 Daigo Moriwaki <daigo at debian dot org>
309 - shogi-server/shogi_server/pairing.rb:
310 - Modified comment for LeastDiff match.
311 - Changed log messages and levels.
313 2013-12-07 Daigo Moriwaki <daigo at debian dot org>
316 - shogi_server/pairing.rb, player.rb:
317 Simplify estimated rate of unrated players (less memory).
318 - Enhanced syntax of Floodgate time configuration file.
319 Now it supports "set sacrifice <player_id>"; it sets a
320 sacrificed player for a specific Floodgate game.
321 ex. set sacrifice gps500+e293220e3f8a3e59f79f6b0efffaa931
323 2013-12-05 Daigo Moriwaki <daigo at debian dot org>
326 - Added a new pairing method, ShogiServer::ExcludeUnratedPlayers,
327 which filters out unrated players.
328 - Enhanced syntax of Floodgate time configuration file.
329 Now it supports "set pairing_factory <function_name>"; it sets a
330 factory function name generating a pairing method which will be
331 used in a specific Floodgate game.
332 ex. set pairing_factory floodgate_zyunisen
333 - Implemented conversion of move representation between CSA format
336 2013-11-24 Daigo Moriwaki <daigo at debian dot org>
339 - shogi_server/league/floodgate.rb: Improved robustness against
340 empty file under ruby 1.9.3p194
342 - Previously, reloading in daemon mode failed on
343 ruby 1.9.3p194. This issue has been fixed.
344 - Listen on only IPv4 explicitly. Under ruby 1.9.3p194, without
345 any bind addresses, ruby attempts to listen on both "0.0.0.0"
346 and "::". Specifying "::" on Linux leads to listen on both IPv4
347 and IPv6, which results in a warning message saying "Address
348 already in use - bind(2)".
350 - Fixed for reading Japanese comments under ruby1.9.3p194.
351 * mk_rate-from-grep, mk_rate-grep:
352 - Removed files that are no longer used.
354 2013-11-23 Daigo Moriwaki <daigo at debian dot org>
357 - gsl library may be provided as a gem
358 - Now duplicated inputs are checked and skipped.
359 * test/TC_floodgate.rb
360 - Improved randomness check so that it works on Ruby 2.0.0 as well
362 2013-11-04 Daigo Moriwaki <daigo at debian dot org>
365 - Added a new option, --ignore, which is imported from
368 - Flush after each output line.
369 * Rleased: Revision "20131104"
371 2013-09-08 Daigo Moriwaki <daigo at debian dot org>
374 - shogi_server/{game,time_clock}.rb:
375 When StopWatchClock is used, "Time_Unit:" of starting messages
376 in CSA protocol supplies "1min".
378 2013-04-07 Daigo Moriwaki <daigo at debian dot org>
381 - shogi_server/{game,time_clock}.rb:
382 Adds variations of thinking time calculation: ChessClock
383 (current) and StopWatchClock (new).
384 StopWatchClock, which is usually used at official games of human
385 professional players, is a clock where thiking time less than a
386 miniute is regarded as zero.
387 To select StopWatchClock, use a special game name with "060"
388 byoyomi time. ex. "gamename_1500_060".
390 2013-03-31 Daigo Moriwaki <daigo at debian dot org>
393 - %%FORK command: %%FORK <source_game> [<new_buoy_game>] [<nth-move>]
394 The new_buoy_game parameter is now optional. If it is not
395 supplied, Shogi-server generates a new buoy game name from
397 - command.rb: More elaborate error messages for the %%GAME command.
399 2013-03-20 Daigo Moriwaki <daigo at debian dot org>
402 - New pairing algorithm: ShogiServer::Pairing::LeastDiff
403 This pairing algorithm aims to minimize the total differences of
404 matching players' rates. It also includes penalyties when a match
405 is same as the previous one or a match is between human players.
406 It is based on a discussion with Yamashita-san on
407 http://www.sgtpepper.net/kaneko/diary/20120511.html.
409 2013-02-23 Daigo Moriwaki <daigo at debian dot org>
412 - New command: %%FORK <source_game> <new_buoy_game> [<nth-move>]
413 Fork a new game from the posistion where the n-th (starting from
414 one) move of a source game is played. The new game should be a
415 valid buoy game name. The default value of n is the position
416 where the previous position of the last one.
417 - The objective of this command: The shogi-server may be used as
418 the back end server of computer-human match where a human player
419 plays with a real board and someone, or a proxy, inputs moves to
420 the shogi-server. If the proxy happens to enter a wrong move,
421 with this command you can restart a new buoy game from the
422 previous stable position.
423 ex. %%FORK server-denou-14400-60+p1+p2+20130223185013 buoy_denou-14400-60
425 2012-12-30 Daigo Moriwaki <daigo at debian dot org>
428 - Backported a5c94012656902e73e00f46e7a4c7004b24d4578:
429 test/TC_logger.rb depeneded on a specific directory where it was
430 running on. This issues has been fixed.
431 - Backported 87d145bd1f1a14a33f5f6fbc78b63a1952f1ca90 and
432 2df8c798aeb7f0e77735e893fd1370c2c6f15c4d:
433 shogi_server/floodgate.rb: Generating next time around the new
434 year day by reading configuration files did not work correctly.
435 This issue has been fixed.
437 2012-12-28 Daigo Moriwaki <daigo at debian dot org>
440 - shogi_server/pairing.rb:
441 + There was a bug in the logic avoiding human-human match.
442 This issue has been fixed.
443 + Improved the logic avoiding human-human match. Human-human
444 matches will less likely happen.
446 2012-01-07 Daigo Moriwaki <daigo at debian dot org>
449 - Added shogi_server/compatible.rb, which implements compatible
450 methods and allows Ruby 1.8.7 to run the server.
451 - test/TC_floodgate.rb failed with Ruby 1.8.7. This issue has
453 - test/TC_uchifuzume.rb did not run with Ruby 1.8.7. This issue
455 - test/TC_league.rb failed with Ruby 1.8.7. This issue has been
457 * csa-file-filter,mk_game_results,mk_html,mk_rate:
458 - Updated documents in the command files.
459 Both Ruby 1.9.3 and 1.8.7 are supported.
460 - Make their shebang consistent (/usr/bin/ruby1.9.1)
462 - Both Ruby 1.9.3 and 1.8.7 are supported.
463 * Renewed year of copyright notice in each file.
465 2012-01-06 Daigo Moriwaki <daigo at debian dot org>
468 - test/TC_logger.rb depeneded on a specific directory where it was
469 running on. This issues has been fixed.
471 2012-01-01 Daigo Moriwaki <daigo at debian dot org>
474 - shogi_server/floodgate.rb: Generating next time around the new
475 year day by reading configuration files did not work correctly.
476 This issue has been fixed.
478 2011-12-18 Daigo Moriwaki <daigo at debian dot org>
481 - shogi_server/board.rb, piece.rb: Refactoring to cache OU pieces,
482 which was inspired by 81SquareShogi-server's change
483 (74b24b88c843f1dd767412475b117481d1d5e8eb).
484 - Added shogi-server-profile to take profile of shogi-server.
485 * [mk_rate] [mk_game_results]
486 - Supports Ruby 1.9.3.
488 2011-12-12 Daigo Moriwaki <daigo at debian dot org>
491 - Support Ruby 1.9.3.
492 - Result of test/benchmark.rb
494 - CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
497 - ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
498 - ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
499 - Server: ruby1.8 (or ruby1.9.1) ./shogi-server hoge 4000
500 - Clients: ruby1.8 (or ruby1.9.1) -d ./benchmark.rb
501 csa/wdoor+floodgate-900-0+gps_normal+gps_l+20100507120007.csa 20
502 - Scores in seconds: (the smaller, the better)
505 server 1.8.7 20 sec 21 sec
508 2010-10-06 Daigo Moriwaki <daigo at debian dot org>
511 - mk_rate: the usage was not updated.
512 Thanks to Hoki-san to report this issue. (Closes: #23358)
514 2010-09-18 Daigo Moriwaki <daigo at debian dot org>
517 - shogi_server/board.rb, game.rb: For hadicapped games, wrong
518 initial positions were delivered to players and monitors. This
519 issue has been fixed. (Closes: #23245)
520 Thanks to HIDETCHI for reporting the issue.
522 2010-09-05 Daigo Moriwaki <daigo at debian dot org>
525 - shogi_server/login.rb: Enhanced the CSA Login mode.
526 Logging in the server with the CSA mode, users are now allowed to
527 specify a turn preference in an enhanced gamename string which
528 looks like <gamename>-<time>-<time>-<turn>. The first three
529 parts are a regular game definition. The last "-<turn>"
531 + Without -<turn> (i.e. same as the previous behavior), there
532 is no turn preference. A user's turn will be defined randomly.
533 + <turn> is either "B" for black or "W" for white.
535 2010-09-04 Daigo Moriwaki <daigo at debian dot org>
538 - shogi_server/{board,command,game,league,player}.rb
539 The Buoy behavior is changed.
540 + Starting a buoy game, players are notified a starting game
541 position with the initial position and moves, instead of a
543 + Players are allowed to start buoy games with specific turns.
544 ex. %%GAME buoy_foo-1500-0 +
546 2010-08-05 Daigo Moriwaki <daigo at debian dot org>
549 - shogi_server/command.rb: Prevent a possible password from be
550 logged in a log file when players send invalid LOGIN-like commands.
551 Thanks to Tomoyuki Kaneko for this idea.
553 2010-08-03 Daigo Moriwaki <daigo at debian dot org>
556 - sample/{check_file.rb,check_time.rb,check_time2.rb,test_time.rb}:
557 Added new files to test an issue where mtime of log files was
558 earlier than system time.
559 - shogi_server/league/floodgate_thread.rb: SetupFloodgate#start
560 now returns an instance correctly.
561 - ../shogi_server.rb, ../shogi_server/util.rb: Refactored
562 mkdir_for to Mkdir.mkdir_for.
563 - ../shogi_server/game.rb: mkdir_p will be performed in a global
564 mutex of ShogiServer::Mkdir.
566 2010-07-25 Daigo Moriwaki <daigo at debian dot org>
569 - shogi_server/command.rb:
570 + For an unknown error command log, an empty line is no longer logged.
571 + Commands specific to 81Dojo, starting with '%%%', are just
572 ignored instead of unknown command errors.
574 + Refactoring. Added test/TC_logger.rb to test
575 ShogiServer::Logger class.
576 + Fixed race condition: creating a new directory to archive
577 logs may have caused race condition, which ended up with
578 making the server unavailable. This issue has been fixed.
580 + Improved fault tolerance of the server.
582 2010-07-23 Daigo Moriwaki <daigo at debian dot org>
585 - shogi_server/league/floodgate_thread.rb: When the server run
586 with DEBUG mode, it ended up with an undefined variable error.
587 This issue has been fixed.
589 2010-07-17 Daigo Moriwaki <daigo at debian dot org>
592 - shogi_server.rb, shogi_server/board.rb, shogi_server/move.rb
593 - Refactoring: Board can now move_to() and move_back() a move
594 instead of deep_copy().
596 2010-07-11 Daigo Moriwaki <daigo at debian dot org>
599 - shogi_server/player.rb: Set initial values to BasicPlayer's
601 - shogi_server/league.rb: Improved performance of
602 Persistant#get_players. It took about 20 seconds for a large
603 size of players (5,300 lines in players.yaml). Now it completes in an
606 2010-06-22 Daigo Moriwaki <daigo at debian dot org>
609 - A new command line option:
610 --floodgate-names GameStringA[,GameStringB[,...]]
611 where a game string should be a valid game name such as
614 Note: Without this option, no floodgate games are started. If
615 you want floodgate-900-0 to run, which was default enabled in
616 previous versions, you need to specify the game name in this new
618 - Floodgate time configuration file:
619 You need to set starting times of floodgate groups in
620 configuration files under the top directory. Each floodgate
621 group requires a corresponding configuration file named
622 "<game_name>.conf". The file will be re-read once just after a
625 For example, a floodgate-3600-30 game group requires
626 floodgate-3600-30.conf. However, for floodgate-900-0 and
627 floodgate-3600-0, which were default enabled in previous
628 versions, configuration files are optional if you are happy with
629 default time settings.
632 # This is a comment line
636 DoW := "Sun" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" |
637 "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" |
638 "Friday" | "Saturday"
646 2010-06-01 Daigo Moriwaki <daigo at debian dot org>
649 - shogi_server/command.rb: Fixed an issue that MONITOR2OFF did not
650 work. Thanks to HIDECHI and koudayu.
652 2010-05-10 Daigo Moriwaki <daigo at debian dot org>
655 - test/*.rb: Improved performance and stability of tests
656 - shogi_server/player.rb: Help the write_thread to terminate
658 2010-05-06 Daigo Moriwaki <daigo at debian dot org>
661 - Previously mk_rate did not count in draw games. Now a draw game
662 is considered to weight 0.5 win and 0.5 loss. Respect
663 Inaniwa-shogi which strategically aims to draw.
664 - a new command line option, --skip-draw-games. In this mode, draw
665 games are just ignored as mk_rate previously did.
667 2010-04-25 Daigo Moriwaki <daigo at debian dot org>
670 - shogi_server/player.rb:
671 Log a warning message in a case that a player closes a
674 2010-04-13 Daigo Moriwaki <daigo at debian dot org>
677 - shogi_server/command.rb:
678 Equality of MonitorHandler class was wrong. %%MONITOROFF and
679 %%MONITOR2OFF may cause unexpected behavior. This issue has been
680 fixed. Thanks to Kota Fujiwara for reporting.
682 2010-03-07 Daigo Moriwaki <daigo at debian dot org>
685 - If two sequential moves from a player are identical, the last
686 one will be ignored and a game is in play. This situation might
687 happen with human players, especially on slow network,
688 impatiently sending a move twice.
690 2010-02-27 Daigo Moriwaki <daigo at debian dot org>
693 - The server now provides more accurate time control. Previously,
694 a player's thinking time included a time waiting to get the giant
695 lock. This may have caused games to time up, especially, during
698 2010-01-22 Daigo Moriwaki <daigo at debian dot org>
701 - Experimental feature: support handicapped games.
702 Game names that have the following prefixes are recognized as
703 handicapped games. Turn symbols "+" and "-" mean Uwate (expert)
704 and Shitate (beginner) respectively (i.e. Uwate players first).
705 "*" is not available.
715 2010-01-16 Daigo Moriwaki <daigo at debian dot org>
718 - shogi_server/command.rb, test/TC_command.rb
719 Proposal implementation of a new command called MONITOR2{ON,OFF}.
720 When the MONITOR2ON command is issued by a player, the server
721 immediately sends the player the entire contents of a record
722 file of the game, i.e. history of moves and so on, at that time.
723 Then, the server will forward subsequent moves like they are
724 appended to the record file.
725 - Behavior changed: A player monitoring a game with MONITORON will
726 not receive Game#show again when a gaming player resigns (:toryo).
728 2010-01-10 Daigo Moriwaki <daigo at debian dot org>
730 * Converted the repository from Subversion to Git.
732 2009-12-26 Daigo Moriwaki <daigo at debian dot org>
735 - The server can now provide multiple floodgate modes such as
736 floodgate-900-0 and floodgate-3600-0.
738 2009-12-25 Daigo Moriwaki <daigo at debian dot org>
741 - shogi-server: The command line option --floodgate-history has
742 been deprecated. The server will decide history file names such
743 as 'floodgate_history_900_0.yaml' and
744 'floodgate_history_3600_0.yaml', and then put them in the top
747 2009-12-20 Daigo Moriwaki <daigo at debian dot org>
750 - shogi_server/player.rb: Added new methods: is_human? and
752 A human player is recommended to use a name ending with '_human'.
753 ex. 'hoge_human', 'hoge_human@p1'
754 - shogi_server/pairing.rb: Added a new class:
755 StartGameWithoutHumans, which tries to make pairs trying to
756 avoid a human-human match. This is now enabled instead of the
757 previous class: StartGame.
758 - shogi-server, shogi_server/league/floodgate.rb:
759 Changed the argument of Floodgate.new.
761 2009-12-04 Daigo Moriwaki <daigo at debian dot org>
764 - The HUP signal is not supported by Ruby on Windows.
766 2009-11-11 Daigo Moriwaki <daigo at debian dot org>
769 - Added a new command line option: --base-date. You can specify a
770 base date to calculate rating scores. Games in the `future' are
771 ignored for the calculation.
773 2009-11-10 Daigo Moriwaki <daigo at debian dot org>
776 - The server logs a result of each game to a file named '00LIST',
777 which will be used to generate players.yaml. If the file does
778 not exist, the server will create one automatically.
779 Instruction to use the game result list file:
780 1. Make a list of game results from existing CSA files with
782 % ./mk_game_results dir_of_csa_files > 00LIST
783 2. Run the server. It appends a result of each game to
784 '00LIST' when the game finishes.
785 3. From the list of game results, calculate rating scores of
787 % ./mk_rate 00LIST > players.yaml
789 2009-11-08 Daigo Moriwaki <daigo at debian dot org>
792 - Split a pre-process collecting game results from csa files into
793 a new command, mk_game_results. Now, Generating players.yaml
794 requires two steps as follows:
795 % ./mk_game_results dir_of_csa_files > 00LIST
796 % ./mk_rate 00LIST > players.yaml
798 % ./mk_game_results dir_of_csa_files | ./mk_rate > players.yaml
801 2009-08-06 Daigo Moriwaki <daigo at debian dot org>
804 - A experimental new feature, codenamed Buoy: it allows players to
805 play a game starting with a specified position. First, a player
806 sets a buoy game with moves to a specific position. Then, two
807 players can play a new game with the game name.
809 + %%SETBUOY <game_name> <moves> [count]
811 ex. %%SETBUOY buoy_foo-900-0 +7776FU 10
812 ex. %%SETBUOY buoy_foo-1500-0 +7776FU-3334FU
813 - game_name is a valid game name with a prefix "buoy_".
815 - moves are initial moves from the Hirate position to a
816 specific position that you want to start with.
817 ex. +7776FU-3334FU+8786FU
818 - count is an optional attribute to tell how many times the
819 game can be played (default 1). The count is decremented
820 when the game finishes. If the count reaches zero, the buoy
821 game is removed automatically by the server.
823 + %%DELETEBUOY <game_name>
824 Delete a buoy game. The only owner who set up the game is
825 allowed to delete it.
826 ex. %%DELETEBUOY buoy_foo-900-0
827 - game_name is the buoy game name that was created.
828 + %%GETBUOYCOUNT <game_name>
829 Show a current count of the buoy game or -1 for non-existing
833 2009-07-11 Daigo Moriwaki <daigo at debian dot org>
836 - shogi_server/command.rb: refactored commands out of player.rb.
838 2009-06-18 Daigo Moriwaki <daigo at debian dot org>
841 - An empty floodgate_history.yaml caused a server error. This
842 issue has been fixed.
845 2009-06-17 Daigo Moriwaki <daigo at debian dot org>
848 - If a new game matched between two players is not started within
849 a certain time (default 120 seconds) (i.e. the agree_waiting or
850 start_waiting state lasts too long), the Server REJECTs the game.
853 2009-06-15 Daigo Moriwaki <daigo at debian dot org>
856 - When a Gote player AGREEd a new game and then a Sente player
857 logged out (LOGOUT), the Gote incorrectly received a LOGOUT message
858 from the server. Since Gote's state was not AGREEd or STARTed yet,
859 the Gote should be REJECTed. This issue has been fixed.
862 2009-06-14 Daigo Moriwaki <daigo at debian dot org>
865 - The Board could not recognize a certain pattern of
866 Oute-Sennichite. This issue has been fixed.
869 2009-03-22 Daigo Moriwaki <daigo at debian dot org>
871 * [utils/correct-bug14635.rb]
872 - Added a new file. This program corrects illegal lines introduced
875 2009-03-07 Daigo Moriwaki <daigo at debian dot org>
878 - Improved performance.
880 2009-02-15 Daigo Moriwaki <daigo at debian dot org>
883 - A duplicated comment that is the one of the previous (or older)
884 move might be erroneously recorded in a csa file. This issue has
885 been fixed. (Closes: #15080)
887 2009-02-11 Daigo Moriwaki <daigo at debian dot org>
889 * [utils/csa-filter.rb]
890 - Added a new file. This program filters CSA files.
892 2009-02-01 Daigo Moriwaki <daigo at debian dot org>
895 - The shogi-server records csa files of games in an illegal
896 format. This issue has been fixed. (Closes: #14635)
897 - A ##[MONITOR] command for showing a game result such as %TORYO
898 was not correct. This issue has been fixed.
900 2009-01-13 Daigo Moriwaki <daigo at debian dot org>
903 - It failed to proccess a game result, OuteKaihiMoreWin where a
904 checked king does not escape. This issue has been fixed.
906 2009-01-02 Daigo Moriwaki <daigo at debian dot org>
909 - shogi_server/timeout_queue.rb: the timeout parameter of the
910 constructor was not respected erroneously. This issue
912 - shogi_server/players.rb: When a player was finishing with its
913 write socket broken, there was a chance that the thread of the
914 player in the giant lock had to wait for a long time (about 20
915 seconds), which might cause threads of other players stop and
916 time out. (Closes: #14469)
918 2008-12-30 Daigo Moriwaki <daigo at debian dot org>
921 - Added a new option: --footer filename, which inserts contents of
922 the filename at the bottom of a generated page. A text specific to
923 wdoor should be written by using this option.
925 - It does no more depend on RDoc. RDoc::usage does not work well
928 2008-12-28 Daigo Moriwaki <daigo at debian dot org>
931 - Check kifu files more carefully so that files that contain
932 incomplete records are skipped.
933 - mk_rate might have failed to alloc due to out of memory. Now it
934 consumes less memory (about 200MB instead of 2GB).
935 - File names can be put into STDIN instead of specifying directory
936 names in command line arguments.
938 - New file. It filters kifu files and is of use for a pre-filter
941 2008-12-13 Daigo Moriwaki <daigo at debian dot org>
944 - Improved an existance check and etc. of directories specified
945 by command line options, especially in case of the daemon mode.
947 - A rotated log file is moved to $topdir/YYYY/MM/DD.
950 2008-11-27 Daigo Moriwaki <daigo at debian dot org>
953 - Added sample/*.sh for command line samples.
955 2008-11-24 Daigo Moriwaki <daigo at debian dot org>
958 - Added a new option --floodgate-history, which allows users to
959 specify a file name that stores the records of games. The
960 records are taken care of when games are matched.
962 2008-10-18 Daigo Moriwaki <daigo at debian dot org>
964 * [utils/eval_graph.rb]
965 - Display time control graphs as well.
966 Thanks to Nishimura-san for this idea.
969 2008-10-08 Daigo Moriwaki <daigo at debian dot org>
972 - Ruby 1.8.7 (or later) must be used. Ruby 1.8.6 is not supported.
973 - Daemon mode is available.
974 - shogi_server/piece_ky.rb is again merged with
975 shogi_server/piece.rb, then has been removed.
976 - Added a test case, TC_usi.rb.
978 2008-06-30 Daigo Moriwaki <daigo at debian dot org>
981 - Added a new option --player-log-dir, which allows users to log
982 messages that are received or sent to the wire.
984 2008-06-28 Daigo Moriwaki <daigo at debian dot org>
987 - A rating comment line is now written before the first move in a
988 record file instead of after the last move, which allows other
989 applications watching a game to recognize players in the middle
990 of the game. (Closes #12821)
991 - If a player, including a monitor, stuck at the time of sending
992 messages to the wire, which means that the giant lock was locked,
993 it might have prevented other players from processing until
994 timeout occurred. This issue has been fixed. (Closes #12555)
996 2008-06-27 Daigo Moriwaki <daigo at debian dot org>
999 - Pairing players might not have shuffled players because of
1000 poor shuffling algorithm. This issue has been fixed.
1003 2008-06-25 Daigo Moriwaki <daigo at debian dot org>
1005 * [players_graph.rb]
1006 - Check invalid arguments. (Closes: #12856)
1008 2008-06-23 Daigo Moriwaki <daigo at debian dot org>
1011 - Added a new option: --fixed-rate and --fixed-rate-player
1012 whose rate always results in that rate. (Closes: #12800)
1014 2008-06-06 Daigo Moriwaki <daigo at debian dot org>
1017 - The source has been splited to multiple sub files.
1018 - The program now depends on rubygems and activesupport.
1019 - The program can reload the source files on the flight, by
1020 sending a HUP signal to the server.
1021 - The server log will be rotated daily.
1023 2008-05-18 Daigo Moriwaki <daigo at debian dot org>
1026 - Last game results (win or lose) of x1 players were not
1027 available on the next game. This issue has been fixed.
1028 Thanks to Tomoyuki Kaneko for debugging.
1029 - For draw games, "'rating" line in a .csa file was
1030 wrong (meaningless). This issue has been fixed.
1032 2008-05-16 Daigo Moriwaki <daigo at debian dot org>
1035 - The repository has been converted from CVS to Subversion.
1037 2008-05-13 Daigo Moriwaki <daigo at debian dot org>
1040 - Floodgate's thread could cause an error when players.yaml was
1041 cleared by another program (mk_rate). This issue has been
1043 - Give default values to BasicPlayer, which fixed undefined
1044 method error in Pairing.
1046 2008-05-10 Daigo Moriwaki <daigo at debian dot org>
1049 - The server could not recognize uchifuzume as an illegal move.
1050 This bug has been fixed.
1051 - The server crashed by an undefined method error.
1052 This issue has been fixed.
1054 2008-05-05 Daigo Moriwaki <daigo at debian dot org>
1057 - .csa files will be located in a sub directory such as
1058 "2008/05/05/*.csa". These days, we have many games in a day.
1059 This change will help users browse a file list.
1061 2008-05-03 Daigo Moriwaki <daigo at debian dot org>
1064 - Show players who have accessed in the last 30 minutes with
1067 2008-04-22 Daigo Moriwaki <daigo at debian dot org>
1070 - When YSS was not rated on the wdoor mode, wrong rate24 scores
1071 were displayed. This issue has been fixed. Now YSS absence
1074 2008-04-21 Daigo Moriwaki <daigo at debian dot org>
1077 - The half-life period is now configurable.
1078 ex $ ./mk_rate --half-life 14 --half-life-ignore 7 <records>
1080 2008-04-12 Daigo Moriwaki <daigo at debian dot org>
1083 - Renamed variables (@id) since they caused Ruby's warning.
1085 2008-04-11 Daigo Moriwaki <daigo at debian dot org>
1088 - Improved a way to handle diferred moves (2008-03-24's change),
1089 based on Tomoyuki Kaneko's patch.
1091 2008-04-01 Daigo Moriwaki <daigo at debian dot org>
1094 - An incorrect LOGIN crashed the server. This issue has been
1097 2008-03-24 Daigo Moriwaki <daigo at debian dot org>
1100 - Converting characters for comments in moves caused an error. This
1101 issue has been fixed.
1102 - If a player moves in the opponent's turn, it is illegal. But the
1103 current CSA protocol does not clearly define a way to tell so to
1104 the players. This shogi-server internally keeps such a move in a
1105 buffer and replay it when the player of the move gets his/her
1108 2008-03-16 Daigo Moriwaki <daigo at debian dot org>
1111 - Erroneously, Board#to_s's current player was always Black.
1112 It caused wrong determination of sennichite since it did not
1113 care about the current player of a state. This has been fixed.
1114 Thanks Takada-san for reporting this bug.
1116 2008-03-10 Daigo Moriwaki <daigo at debian dot org>
1118 * [util/players-graph.rb]
1119 - Applied Kaneko-san's patch, which also shows expected-rate24
1121 - Small PNG gets smaller.
1123 2008-03-08 Daigo Moriwaki <daigo at debian dot org>
1126 - Added an option --wdoor. In this mode, a rate expected at Shogi
1127 Club 24 is calculated from YSS's rating (he is 2400 now).
1129 2008-03-04 Daigo Moriwaki <daigo at debian dot org>
1132 - If the computed ratings do not stabilize, then mk_rate aborts.
1133 $ ./mk_rate dir && ./mk_rate dir > players.yaml
1134 can avoid rewriting the invalid ratings to the file.
1136 2008-02-23 Daigo Moriwaki <daigo at debian dot org>
1139 - A comment is converted to EUC-JP and then written in a log.
1140 Note that this conversion guesses the input encoding. Clients
1141 are recommended to send EUC-JP compatible strings to the
1144 2008-02-21 Daigo Moriwaki <daigo at debian dot org>
1146 * [util/players-graph.rb]
1147 - Released. Draw a chart for a player's rating score.
1149 2008-02-17 Daigo Moriwaki <daigo at debian dot org>
1152 - An illegal teban specified for Floodgate login could crash the
1153 server. This issue has been fixed.
1155 2008-02-16 Daigo Moriwaki <daigo at debian dot org>
1158 - Thread.abort_on_exception is now false, meaning that
1159 a thread's abort does not affect the others.
1160 - The uchifuzume check did not generate promoting moves, which
1161 could crash the server with illegal moves. This issue has
1164 2008-02-14 Daigo Moriwaki <daigo at debian dot org>
1167 - Added a new pairing variation, Swiss-like style. Winners at the
1168 previous games (his/her point of view, not the server's) are
1169 paired first, and then the others are matched. This is the
1171 - Pairing classes are located in a separate source file,
1172 pairing.rb. The file is 'load'ed each time to be used,
1173 meaning that modifying the code will be applied to a running
1175 - You can specify a single player who will be out of pairing
1176 when there are odd players waiting for Floodgate.
1178 2008-02-13 Daigo Moriwaki <daigo at debian dot org>
1181 - When there are odd players wating for Floodgate, the random
1182 pairing deletes the player who has ever played the most games.
1184 2008-02-08 Daigo Moriwaki <daigo at debian dot org>
1187 - For the Not-Yet-Rated group, those who have not connected
1188 recently are not listed.
1190 - Floodgate's thread checks the current time each 10 secs.
1192 2008-02-05 Daigo Moriwaki <daigo at debian dot org>
1194 * [mk_rate] [mk_html]
1195 - Display not-yet-rated players as well.
1197 - Use Yahoo! UI Library.
1199 2008-02-04 Daigo Moriwaki <daigo at debian dot org>
1201 * [shogi-server] [webserver]
1202 - In the daemon mode, if the specified directory was a relative
1203 path, the server could fail to start with a permission denied
1204 error. This issue has been fixed. The path is interpreted as
1205 an absolute path before switching to daemon.
1206 - In the daemon mode, a wrong process id was written in
1207 '--pid-file'. This issue has been fixed. Also, the pid file
1208 will be removed when the server shuts down.
1210 2008-02-03 Daigo Moriwaki <daigo at debian dot org>
1213 - Game names that are recognized as the floodgate mode are now
1214 /^floodgate-\d+-\d+$/.
1215 - Floodgate could not schedule the next time when it was the next
1216 day. This issue has been fixed.
1218 2008-02-02 Daigo Moriwaki <daigo at debian dot org>
1221 - Implemented a new feature, Floodgate mode, for covenience with
1222 public rating games. Now there is a special game "wdoor-900-0".
1223 Matching players for that game is scheduled each 30 minitues.
1225 2007-11-03 Daigo Moriwaki <daigo at debian dot org>
1228 - Support Ruby 1.8.6 patch level 111 (or higher) and GSL 1.10 (or higher).
1229 It may not work with lower verions.
1231 2007-09-06 Daigo Moriwaki <daigo at debian dot org>
1234 - The logic to detect Oute-Sennichite was not complete. Both players
1235 (checking side and escaping side) may cause Oute-Sennichite. The old
1236 logic only cared for the checking player. This issue has been fixed.
1238 2007-06-16 Daigo Moriwaki <daigo at debian dot org>
1241 - Initial version. This web server is an interface between HTTP and
1242 shogi-server. Shogi-server commands will be available over HTTP. As
1243 of now %%LIST and %%WHO commands are supported.
1245 - Bumped up GAME_LIMIT (from 10) to 15 because the calculation of
1246 rates sometimes went wrong (infinite values).
1248 2007-04-21 Daigo Moriwaki <daigo at debian dot org>
1251 - Implemented `CHALLENGE' command, and the server will respond with
1252 `CHALLENGE ACCEPTED'. Note that this command is dummy for this server
1253 because it is only available for CSA's official testing server and does
1254 not belong to the CSA standard protocol. Therefor, when clients receive
1255 `CHALLENGE ACCEPTED' from this server, they must ignore it.
1256 - Show revision in a start up message.
1258 2007-04-01 Daigo Moriwaki <daigo at debian dot org>
1261 - Implemented one of the keepalive protocol in CSA protocol; If clients
1262 send LF, the server sends back LF.
1263 - More care for socket errors.
1265 2007-03-27 Daigo Moriwaki <daigo at debian dot org>
1267 * [mk_rate] When there were too few games to rate players (i.e. no
1268 player to rate), mk_rate caused an error. Now it no longer shows
1271 2007-03-10 Daigo Moriwaki <daigo at debian dot org>
1273 * [mk_html] Popup shows additional information.
1275 2007-03-02 Daigo Moriwaki <daigo at debian dot org>
1278 - Use WEBrick for server framework.
1279 - Daemon mode is available.
1281 2007-02-26 Daigo Moriwaki <daigo at debian dot org>
1284 - Failed to show usage. This issue has been fixed.
1285 - Initial start of the server failed beacause of empty players.yaml.
1286 This issues has been fixed.
1288 2007-02-18 Daigo Moriwaki <daigo at debian dot org>
1291 - Show groups in the order specified in players.html.
1292 - Players who gamed recently have a background color.
1294 - Implemented half-life effect. Numbers of win/lose decrease by this effect.
1296 2006-11-26 Daigo Moriwaki <daigo at debian dot org>
1298 * [shogi-server] Sente (gote) was able to move gote's (sente's) hand.
1299 That move should be illegal. This issue has been fixed.
1301 2006-11-01 Daigo Moriwaki <daigo at debian dot org>
1303 * [mk_rate] Skip "abnormal" games, which were finished because of
1304 network failure or communication error. Recently some programs seem
1305 to have a lot of tries to connect to the Shogi Server at wdoor for
1306 debugging. We should ignore such games for a while to get a meaningful
1309 2006-10-30 Daigo Moriwaki <daigo at debian dot org>
1311 * [mk_rate][mk_html]
1312 - Put players into "connected" groups in order to
1313 show a correct, meaningful rating. In the group, each player has at
1314 least a game with other players.
1315 - The format of players.yaml was updated.
1316 * [shogi-server] Followed the new format of players.yaml.
1318 2006-10-08 Daigo Moriwaki <daigo at debian dot org>
1320 * [mk_rate] Corrected making win_loss_matrix.
1322 2006-10-02 Daigo Moriwaki <daigo at debian dot org>
1324 * [mk_rate] players who never win or lose are not rated in order
1325 the calculation to complete.
1327 2006-09-30 Daigo Moriwaki <daigo at debian dot org>
1329 * [shogi-server] The CSA mode supports the trip in a password.
1331 2006-09-22 Daigo Moriwaki <daigo at debian dot org>
1333 * [shogi-server] Refactored the login procedures.
1335 2006-09-21 Daigo Moriwaki <daigo at debian dot org>
1337 * [mk_rate] It failed parse draw games. Now this bug has been fixed.
1338 * [mk_html] Add CSS to look better.
1340 2006-09-15 Daigo Moriwaki <daigo at debian dot org>
1343 - Remove the trip in a password. Now the password is hashed.
1345 - Support @NORATE syntax in a name, which avoids the player is
1348 2006-09-09 Daigo Moriwaki <daigo at debian dot org>
1351 - Support a new command, %%VERSION. It shows the server's revision#.
1353 2006-09-07 Daigo Moriwaki <daigo at debian dot org>
1356 - Re-design: trip is now a suffix of the password, not name.
1357 - Simplified the output of %%RATING.
1359 - Support "@" indentificaton in a name; players with same
1360 before-@-names are mapped to one.
1362 2006-09-05 Daigo Moriwaki <daigo at debian dot org>
1364 * [mk_rate] Fix a bug. It solves the correct rate.
1366 2006-08-18 Daigo Moriwaki <daigo at debian dot org>
1368 * [mk_rate] Re-design.
1369 - Correct the equations.
1370 - Apply deaccelerated Newton method.
1372 2006-08-16 Daigo Moriwaki <daigo at debian dot org>
1375 - Fix a bug. Now it can see black/white players in a csa file.
1377 - Add a space in the output of %%RATING.
1379 2006-08-14 Daigo Moriwaki <daigo at debian dot org>
1381 * [mk_rate] Record numbers of win/loss games.
1382 * Add mk_html, which generates html from players.yaml
1383 * Fix test/test_board.rb. Now it works.
1384 * Add test/TC_ALL.rb to run all test cases.
1385 * [shogi-server] Fix a bug. Now it can show %%RATING even if it has no
1388 2006-08-11 Daigo Moriwaki <daigo at debian dot org>
1390 * Add mk_rate, which calculate rating scores.
1392 2006-08-10 Daigo Moriwaki <daigo at debian dot org>
1394 * Change the style of a comment line on the rated game.
1396 2006-08-07 Daigo Moriwaki <daigo at debian dot org>
1398 * Change the player id, which is now <name>+<hash_of_the_trip>.
1399 * Fix the max length of the login name with a trip.
1400 * Add a comment line about the rated game status in the CSA file.
1401 * Remove the rating system, which will be calculated by another
1404 2006-08-01 Daigo Moriwaki <daigo at debian dot org>
1406 * Add a command, %%RATING, to show a ranking sorted by rates.
1408 2006-07-31 Daigo Moriwaki <daigo at debian dot org>
1410 * Add a simple rating system.
1412 2006-07-30 Daigo Moriwaki <daigo at debian dot org>
1414 * Add a @move_counter in Board class, which is used by Shogi Viewer
1417 2006-04-28 Daigo Moriwaki <daigo at debian dot org>
1419 * Jishogi kachi declaration did not work. This bug has been fixed.
1420 Add debug lines to show a jishogi state.
1422 2006-04-08 Daigo Moriwaki <daigo at debian dot org>
1424 * Support CSA Protocol Version 1.1.
1425 * Change the declaration of Jishogi 1.1.
1427 2006-03-10 Daigo Moriwaki <daigo at debian dot org>
1429 * Kifu logs are always written in separate files.
1430 * Add a test case, test/TC_functional.rb
1431 * Some refactorings.