-#! /usr/bin/ruby1.9.1
+#! /usr/bin/ruby
# $Id$
#
# Author:: NABEYA Kenichi, Daigo Moriwaki
# MAIN
#
+ONE_DAY = 3600 * 24 # in seconds
+
ShogiServer.reload
# Return
Sat 22:00
Sun 13:00
+ PAREMETER SETTING
+
+ In addition, this configuration file allows to set parameters
+ for the specific Floodaget group. A list of parameters is the
+ following:
+
+ * pairing_factory:
+ Specifies a factory function name generating a pairing
+ method which will be used in a specific Floodgate game.
+ ex. set pairing_factory floodgate_zyunisen
+ * sacrifice:
+ Specifies a sacrificed player.
+ ex. set sacrifice gps500+e293220e3f8a3e59f79f6b0efffaa931
+
LICENSE
GPL versoin 2 or later
player = ShogiServer::Player::new(str, client, eol)
login = ShogiServer::Login::factory(str, player)
if (current_player = $league.find(player.name))
+ # Even if a player is in the 'game' state, when the status of the
+ # player has not been updated for more than a day, it is very
+ # likely that the player is stalling. In such a case, a new player
+ # can override the current player.
if (current_player.password == player.password &&
- current_player.status != "game")
- log_message(sprintf("user %s login forcely", player.name))
+ (current_player.status != "game" ||
+ Time.now - current_player.modifiled_at > ONE_DAY))
+ log_message("user %s login forcely (previously modified at %s)" % [player.name, player.modified_at])
current_player.kill
else
login.incorrect_duplicated_player(str)
$league.dir = $topdir
config = {}
+ config[:BindAddress] = "0.0.0.0"
config[:Port] = port
config[:ServerType] = WEBrick::Daemon if $options["daemon"]
config[:Logger] = $logger