From 37b79294be074be41396bcabada9e7d54fafba21 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sat, 25 Apr 2020 04:10:30 +0200 Subject: [PATCH] remember the last server address and ask to use it. --- MultiClient.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MultiClient.py b/MultiClient.py index 58dc7dc2..50ebe7f1 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -593,17 +593,20 @@ async def server_loop(ctx : Context, address = None): address = ctx.server_address if address is None: # see if this is an old connection try: - address = Utils.persistent_load()["servers"][ctx.auth] + address = Utils.persistent_load()["servers"]["default"] except Exception as e: logging.debug(f"Could not find cached server address. {e}") else: - logging.info(f"Using server {address} from the last time this rom was loaded. \n" - f"Should this be in error, use /connect ") + logging.info(f'Enter multiworld server address. Press enter to connect to {address}') + text = await console_input(ctx) + if text: + address = text + while not address: logging.info('Enter multiworld server address') address = await console_input(ctx) - Utils.persistent_store("servers", ctx.auth, address) + Utils.persistent_store("servers", "default", address) address = f"ws://{address}" if "://" not in address else address port = urllib.parse.urlparse(address).port or 38281