Removed single quote parsing from player 'connect' and 'create' command parsers.

This commit is contained in:
Trent Robbins 2016-09-26 01:53:32 -07:00 committed by Griatch
parent cd04ea4c62
commit 89c3a1f846
2 changed files with 11 additions and 11 deletions

View file

@ -15,7 +15,7 @@ DEFAULT_SCREEN = \
If you need to create an account, type (without the <>'s):
{wcreate <username> <password>{n
If you have spaces in your username, enclose it in quotes.
If you have spaces in your username, enclose it in double quotes.
Enter {whelp{n for more info. {wlook{n will re-show this screen.
{b=============================================================={n""" \
% (settings.SERVERNAME, utils.get_evennia_version())

View file

@ -188,7 +188,7 @@ class CmdUnconnectedConnect(COMMAND_DEFAULT_CLASS):
Use the create command to first create an account before logging in.
If you have spaces in your name, enclose it in quotes.
If you have spaces in your name, enclose it in double quotes.
"""
key = "connect"
aliases = ["conn", "con", "co"]
@ -212,10 +212,10 @@ class CmdUnconnectedConnect(COMMAND_DEFAULT_CLASS):
return
args = self.args
# extract quoted parts
parts = [part.strip() for part in re.split(r"\"|\'", args) if part.strip()]
# extract double quote parts
parts = [part.strip() for part in re.split(r"\"", args) if part.strip()]
if len(parts) == 1:
# this was (hopefully) due to no quotes being found, or a guest login
# this was (hopefully) due to no double quotes being found, or a guest login
parts = parts[0].split(None, 1)
# Guest login
if len(parts) == 1 and parts[0].lower() == "guest":
@ -251,7 +251,7 @@ class CmdUnconnectedCreate(COMMAND_DEFAULT_CLASS):
This creates a new player account.
If you have spaces in your name, enclose it in quotes.
If you have spaces in your name, enclose it in double quotes.
"""
key = "create"
aliases = ["cre", "cr"]
@ -264,14 +264,14 @@ class CmdUnconnectedCreate(COMMAND_DEFAULT_CLASS):
session = self.caller
args = self.args.strip()
# extract quoted parts
parts = [part.strip() for part in re.split(r"\"|\'", args) if part.strip()]
# extract double quoted parts
parts = [part.strip() for part in re.split(r"\"", args) if part.strip()]
if len(parts) == 1:
# this was (hopefully) due to no quotes being found
parts = parts[0].split(None, 1)
if len(parts) != 2:
string = "\n Usage (without <>): create <name> <password>" \
"\nIf <name> or <password> contains spaces, enclose it in quotes."
"\nIf <name> or <password> contains spaces, enclose it in double quotes."
session.msg(string)
return
playername, password = parts
@ -298,7 +298,7 @@ class CmdUnconnectedCreate(COMMAND_DEFAULT_CLASS):
if not re.findall('^[\w. @+-]+$', password) or not (3 < len(password)):
string = "\n\r Password should be longer than 3 characers. Letters, spaces, digits and @\.\+\-\_ only." \
"\nFor best security, make it longer than 8 characters. You can also use a phrase of" \
"\nmany words if you enclose the password in quotes."
"\nmany words if you enclose the password in double quotes."
session.msg(string)
return
@ -415,7 +415,7 @@ You are not yet logged into the game. Commands available at this point:
{wquit{n - abort the connection
First create an account e.g. with {wcreate Anna c67jHL8p{n
(If you have spaces in your name, use quotes: {wcreate "Anna the Barbarian" c67jHL8p{n
(If you have spaces in your name, use double quotes: {wcreate "Anna the Barbarian" c67jHL8p{n
Next you can connect to the game: {wconnect Anna c67jHL8p{n
You can use the {wlook{n command if you want to see the connect screen again.