## $Id$
## Copyright (C) 2004 NABEYA Kenichi (aka nanami@2ch)
-## Copyright (C) 2007-2008 Daigo Moriwaki (daigo at debian dot org)
+## Copyright (C) 2007-2012 Daigo Moriwaki (daigo at debian dot org)
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@name = nil
@password = nil
@rate = 0
+ @estimated_rate = 0
@win = 0
@loss = 0
@last_game_win = false
# Score in the rating sysem
attr_accessor :rate
+ # Estimated rate for unrated player (rate == 0)
+ # But this value is not persisted and cleared when player logs off.
+ attr_accessor :estimated_rate
+
# Number of games for win and loss in the rating system
attr_accessor :win, :loss
@main_thread = Thread::current
@write_queue = ShogiServer::TimeoutQueue.new(WRITE_THREAD_WATCH_INTERVAL)
@player_logger = nil
+ @last_command_at = Time.now
start_write_thread
end
attr_accessor :protocol, :eol, :game, :mytime
attr_accessor :main_thread
attr_reader :socket_buffer
+ # It is updated whenever a player sends a new command
+ attr_accessor :last_command_at
def setup_logger(dir)
log_file = File.join(dir, "%s.log" % [simple_player_id])