From e8be80ccd793d1c763ffe499d26c0c40375f5424 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 24 May 2022 05:22:52 +0200 Subject: [PATCH] Network: remove "SlotAlreadyTaken" from docs and clients, as it was removed from the server in 0.2 --- CommonClient.py | 10 +++++----- FactorioClient.py | 1 - docs/network protocol.md | 3 +-- worlds/meritous/docs/setup_en.md | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CommonClient.py b/CommonClient.py index e7d079ee0798..62ed32a1b60f 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -347,7 +347,7 @@ async def send_death(self, death_text: str = ""): } }]) - async def update_death_link(self, death_link): + async def update_death_link(self, death_link: bool): old_tags = self.tags.copy() if death_link: self.tags.add("DeathLink") @@ -496,8 +496,6 @@ async def process_server_cmd(ctx: CommonContext, args: dict): ctx.event_invalid_slot() elif 'InvalidGame' in errors: ctx.event_invalid_game() - elif 'SlotAlreadyTaken' in errors: - raise Exception('Player slot already in use for that team') elif 'IncompatibleVersion' in errors: raise Exception('Server reported your client version as incompatible') elif 'InvalidItemsHandling' in errors: @@ -670,8 +668,10 @@ async def main(args): if args.url: url = urllib.parse.urlparse(args.url) args.connect = url.netloc - args.name = urllib.parse.unquote(url.username) - args.password = urllib.parse.unquote(url.password) + if url.username: + args.name = urllib.parse.unquote(url.username) + if url.password: + args.password = urllib.parse.unquote(url.password) colorama.init() diff --git a/FactorioClient.py b/FactorioClient.py index dd1792ca2a5a..31798392dde9 100644 --- a/FactorioClient.py +++ b/FactorioClient.py @@ -5,7 +5,6 @@ import string import copy import subprocess -import sys import time import random diff --git a/docs/network protocol.md b/docs/network protocol.md index b7e7ccc3ea05..3dca2b8f63ff 100644 --- a/docs/network protocol.md +++ b/docs/network protocol.md @@ -101,11 +101,10 @@ Sent to clients when the server refuses connection. This is sent during the init #### Arguments | Name | Type | Notes | | ---- | ---- | ----- | -| errors | list\[str\] | Optional. When provided, should contain any one of: `InvalidSlot`, `InvalidGame`, `SlotAlreadyTaken`, `IncompatibleVersion`, `InvalidPassword`, or `InvalidItemsHandling`. | +| errors | list\[str\] | Optional. When provided, should contain any one of: `InvalidSlot`, `InvalidGame`, `IncompatibleVersion`, `InvalidPassword`, or `InvalidItemsHandling`. | InvalidSlot indicates that the sent 'name' field did not match any auth entry on the server. InvalidGame indicates that a correctly named slot was found, but the game for it mismatched. -SlotAlreadyTaken indicates a connection with a different uuid is already established. IncompatibleVersion indicates a version mismatch. InvalidPassword indicates the wrong, or no password when it was required, was sent. InvalidItemsHandling indicates a wrong value type or flag combination was sent. diff --git a/worlds/meritous/docs/setup_en.md b/worlds/meritous/docs/setup_en.md index 4cfdb6fdb2b2..c829765e5321 100644 --- a/worlds/meritous/docs/setup_en.md +++ b/worlds/meritous/docs/setup_en.md @@ -58,7 +58,6 @@ More in-depth information about the game can be found in the game's help file, a - `Disconnected`: If the game does not reconnect automatically, you may need to save, quit, and reload the game to reconnect. Keep in mind that the game does not auto-save, and it is only possible to save the game at Save Tiles. - `InvalidSlot`, `InvalidGame`: Make sure the `slotname` in `meritous-ap.json` matches the name provided in your Meritous YAML file. -- `SlotAlreadyTaken`: Make sure Meritous Gaiden is not already running and connected to the server. - `IncompatibleVersion`: Make sure Meritous Gaiden has been updated to the latest version. - `InvalidPassword`: Make sure the `password` in `meritous-ap.json` matches the password for your game. If there is no password, either set this to `null` (no quotes) or omit/remove it completely. - `InvalidItemsHandling`: This is a bug and shouldn't happen if you downloaded a precompiled copy of the game. If you downloaded a precompiled copy, please let KewlioMZX know over GitHub or the AP Discord.