end
def Login.good_game_name?(str)
- if ((str =~ /^(.+)-\d+-\d+$/) && (good_identifier?($1)))
+ if ((str =~ /^(.+)-\d+-\d+F?$/) && (good_identifier?($1)))
return true
else
return false
end
def Login.good_identifier?(str)
- if str =~ /\A[\w@\-\.]{1,#{Max_Identifier_Length}}\z/
+ max = $options["max-identifier"]
+ if str =~ /\A[\w@\-\.]{1,#{max}}\z/
return true
else
return false
end
def Login.factory(str, player)
- (login, player.name, password, ext) = str.chomp.split
+ (_, player.name, password, ext) = str.chomp.split
if ext
return Loginx1.new(player, password)
else
def process
@player.write_safe(sprintf("LOGIN:%s OK\n", @player.name))
- log_message(sprintf("user %s run in %s mode", @player.name, @player.protocol))
+ log_message("user %s run in %s mode" % [(@player.rated? ? @player.player_id : @player.name),
+ @player.protocol])
end
def incorrect_duplicated_player(str)
# turn character "+" or "-"; false otherwise
#
def parse_gamename_turn(str)
- if str =~ /^(.+)-\d+-\d+-(\w)$/
+ if str =~ /^(.+)-\d+-\d+F?-(\w)$/
case $2
when "b","B"
return [str[0, str.length-2], "+"]