diff options
| -rw-r--r-- | asciifarm/client/__main__.py | 4 | ||||
| -rw-r--r-- | asciifarm/client/gameclient.py | 4 | ||||
| -rwxr-xr-x | asciifarm/client/main.py | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/asciifarm/client/__main__.py b/asciifarm/client/__main__.py index 294336f..2841ae9 100644 --- a/asciifarm/client/__main__.py +++ b/asciifarm/client/__main__.py @@ -10,7 +10,7 @@ if __package__ == "asciifarm.client": from . import main else: import os.path - sys.path.append(os.path.join(os.path.dirname(__file__), "..")) - from client import main + sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) + from asciifarm.client import main main.main() diff --git a/asciifarm/client/gameclient.py b/asciifarm/client/gameclient.py index 6f85e0d..9903533 100644 --- a/asciifarm/client/gameclient.py +++ b/asciifarm/client/gameclient.py @@ -64,6 +64,10 @@ class Client: print("error: name is already taken", file=sys.stderr) self.close() return + if error == "invalidname": + print("error: "+ msg[2], file=sys.stderr) + self.close() + return self.log(error) if msgType == 'field': field = msg[1] diff --git a/asciifarm/client/main.py b/asciifarm/client/main.py index fa8a074..de77d09 100755 --- a/asciifarm/client/main.py +++ b/asciifarm/client/main.py @@ -32,7 +32,7 @@ def main(argv=None): Kill the goblins and plant the seeds. ~troido""", formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-n', '--name', help='Your player name (must be unique!). Defaults to username', default=getpass.getuser()) + parser.add_argument('-n', '--name', help='Your player name (must be unique!). Defaults to username', default="~"+getpass.getuser()) parser.add_argument("-a", "--address", help="The address of the socket. When the socket type is 'abstract' this is just a name. When it is 'unix' this is a filename. When it is 'inet' is should be in the format 'address:port', eg 'localhost:8080'. Defaults depends on the socket type") parser.add_argument("-s", "--socket", help="the socket type. 'unix' is unix domain sockets, 'abstract' is abstract unix domain sockets and 'inet' is inet sockets. ", choices=["abstract", "unix", "inet"], default="abstract") parser.add_argument('-k', '--keybindings', help='The script with the keybindings. This file is a snippet of hy script.', default="keybindings") |
