+2006-09-15 Daigo Moriwaki <daigo at debian dot org>
+
+ * [shogi-server]
+ - Remove the trip in a password. Now the password is hashed.
+
2006-09-09 Daigo Moriwaki <daigo at debian dot org>
* [shogi-server]
# Idetifier of the player in the rating system
attr_accessor :id
- # Trip (password) for the rating player id
- attr_reader :trip
-
# Name of the player
attr_accessor :name
##
# Parses str in the LOGIN command, sets up @id and @trip
#
- def parse_password(str)
- @password, *trip = str.split(",") # used by rating
- trip = trip.join(",") # if no trip, *trip -> []; [].join(",") -> "";
- if trip.empty?
- @id = @trip = nil
+ def set_password(str)
+ if str && !str.empty?
+ @password = str.strip
+ @id = "%s+%s" % [@name, Digest::MD5.hexdigest(@password)]
else
- @trip = trip
- @id = "%s+%s" % [@name, Digest::MD5.hexdigest(@trip)]
+ @id = @password = nil
end
end
end
@eol = $1
str.chomp!
(login, @name, password, ext) = str.split
- parse_password(password)
+ set_password(password)
if (ext)
@protocol = "x1"
else