Fixed a bug with red_button introduced in a previous revision. Resolves issue95.

This commit is contained in:
Griatch 2010-09-02 07:48:39 +00:00
parent 900f6da80f
commit e114c33d8a
4 changed files with 12 additions and 9 deletions

View file

@ -39,20 +39,19 @@ class CmdConnect(MuxCommand):
if not arglist or len(arglist) < 2:
session.msg("\n\r Usage (without <>): connect <email> <password>")
return
uemail = arglist[0]
email = arglist[0]
password = arglist[1]
# Match an email address to an account.
email_match = PlayerDB.objects.get_player_from_email(uemail)
player = PlayerDB.objects.get_player_from_email(email)
# No playername match
if not email_match:
string = "The email '%s' does not match any accounts." % uemail
if not player:
string = "The email '%s' does not match any accounts." % email
string += "\n\r\n\rIf you are new you should first create a new account "
string += "using the 'create' command."
session.msg(string)
return
# We have at least one result, so we can check the password.
player = email_match
if not player.user.check_password(password):
session.msg("Incorrect password.")
return