Lots of goodies in this one. More work on the default web front page, a few extra utility functions for functions_db as well. Some cleanup in the session code to use some of the new abstraction I added a while back. Player's last login time is now also set on the User object. Issue 28: Forward slashes causing crashes, found by Kuros, fixed by me.
This commit is contained in:
parent
270db06820
commit
e2cc754441
7 changed files with 57 additions and 25 deletions
|
|
@ -89,9 +89,9 @@ def cmd_inventory(cdat):
|
|||
|
||||
money = int(pobject.get_attribute_value("MONEY", default=0))
|
||||
if money == 1:
|
||||
money_name = functions_db.get_server_config("MONEY_NAME_SINGULAR")
|
||||
money_name = gameconf.get_configvalue("MONEY_NAME_SINGULAR")
|
||||
else:
|
||||
money_name = functions_db.get_server_config("MONEY_NAME_PLURAL")
|
||||
money_name = gameconf.get_configvalue("MONEY_NAME_PLURAL")
|
||||
|
||||
session.msg("You have %d %s." % (money,money_name))
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ def cmd_connect(cdat):
|
|||
password = cdat['uinput']['splitted'][2]
|
||||
|
||||
# Match an email address to an account.
|
||||
email_matches = functions_db.get_dbref_from_email(uemail)
|
||||
email_matches = functions_db.get_user_from_email(uemail)
|
||||
|
||||
autherror = "Specified email does not match any accounts!"
|
||||
# No username match
|
||||
|
|
@ -36,7 +36,6 @@ def cmd_connect(cdat):
|
|||
if not user.check_password(password):
|
||||
session.msg(autherror)
|
||||
else:
|
||||
user = email_matches[0]
|
||||
uname = user.username
|
||||
session.login(user)
|
||||
|
||||
|
|
@ -70,7 +69,7 @@ def cmd_create(cdat):
|
|||
# Search for a user object with the specified username.
|
||||
account = User.objects.filter(username=uname)
|
||||
# Match an email address to an account.
|
||||
email_matches = functions_db.get_dbref_from_email(email)
|
||||
email_matches = functions_db.get_user_from_email(email)
|
||||
|
||||
if not account.count() == 0:
|
||||
session.msg("There is already a player with that name!")
|
||||
|
|
@ -79,8 +78,8 @@ def cmd_create(cdat):
|
|||
elif len(password) < 3:
|
||||
session.msg("Your password must be 3 characters or longer.")
|
||||
else:
|
||||
functions_db.create_user(cdat, uname, email, password)
|
||||
|
||||
functions_db.create_user(cdat, uname, email, password)
|
||||
|
||||
def cmd_quit(cdat):
|
||||
"""
|
||||
We're going to maintain a different version of the quit command
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue