diff --git a/MultiServer.py b/MultiServer.py index 0601e179152c..c3cd50b108c1 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -218,8 +218,9 @@ def __init__(self, host: str, port: int, server_password: str, password: str, lo self.allow_releases = {} self.host = host self.port = port - self.server_password = server_password - self.password = password + # None if None else str.strip() + self.server_password = server_password and server_password.strip() + self.password = password and password.strip() self.server = None self.countdown_timer = 0 self.received_items = {} @@ -2320,7 +2321,7 @@ def value_type(input_text: str): return input_text.lower() not in {"off", "0", "false", "none", "null", "no"} elif value_type == str and option_name.endswith("password"): def value_type(input_text: str): - return None if input_text.lower() in {"null", "none", '""', "''"} else input_text + return None if input_text.lower().strip() in {"null", "none", '""', "''"} else input_text.strip() elif value_type == str and option_name.endswith("mode"): valid_values = {"goal", "enabled", "disabled"} valid_values.update(("auto", "auto_enabled") if option_name != "remaining_mode" else []) diff --git a/WebHostLib/generate.py b/WebHostLib/generate.py index 0bd9f7e5e066..a24fc24917ae 100644 --- a/WebHostLib/generate.py +++ b/WebHostLib/generate.py @@ -35,7 +35,8 @@ def get_meta(options_source: dict, race: bool = False) -> Dict[str, Union[List[s "remaining_mode": str(options_source.get("remaining_mode", ServerOptions.remaining_mode)), "collect_mode": str(options_source.get("collect_mode", ServerOptions.collect_mode)), "item_cheat": bool(int(options_source.get("item_cheat", not ServerOptions.disable_item_cheat))), - "server_password": str(options_source.get("server_password", None)), + # None if None else str.strip() + "server_password": str(options_source.get("server_password") and options_source["server_password"].strip()), } generator_options = { "spoiler": int(options_source.get("spoiler", GeneratorOptions.spoiler)),