From 30b70b2055f4743773e3defccc4eb9a5279af231 Mon Sep 17 00:00:00 2001 From: recklesscoder <57289227+recklesscoder@users.noreply.github.com> Date: Sat, 4 Mar 2023 16:34:10 +0100 Subject: [PATCH] Misc collected fixes (#1497) --- CommonClient.py | 2 +- Generate.py | 2 +- Main.py | 3 +-- WebHostLib/static/assets/tracker.js | 2 ++ WebHostLib/templates/macros.html | 2 +- worlds/factorio/Technologies.py | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CommonClient.py b/CommonClient.py index 92f8d76a..02dd55da 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -63,7 +63,7 @@ class ClientCommandProcessor(CommandProcessor): def _cmd_received(self) -> bool: """List all received items""" - logger.info(f'{len(self.ctx.items_received)} received items:') + self.output(f'{len(self.ctx.items_received)} received items:') for index, item in enumerate(self.ctx.items_received, 1): self.output(f"{self.ctx.item_names[item.item]} from {self.ctx.player_names[item.player]}") return True diff --git a/Generate.py b/Generate.py index dadabd7a..afb34f11 100644 --- a/Generate.py +++ b/Generate.py @@ -107,7 +107,7 @@ def main(args=None, callback=ERmain): player_files = {} for file in os.scandir(args.player_files_path): fname = file.name - if file.is_file() and not file.name.startswith(".") and \ + if file.is_file() and not fname.startswith(".") and \ os.path.join(args.player_files_path, fname) not in {args.meta_file_path, args.weights_file_path}: path = os.path.join(args.player_files_path, fname) try: diff --git a/Main.py b/Main.py index 2ef61f5d..ba1787b0 100644 --- a/Main.py +++ b/Main.py @@ -38,7 +38,7 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No world = MultiWorld(args.multi) logger = logging.getLogger() - world.set_seed(seed, args.race, str(args.outputname if args.outputname else world.seed)) + world.set_seed(seed, args.race, str(args.outputname) if args.outputname else None) world.plando_options = args.plando_options world.shuffle = args.shuffle.copy() @@ -53,7 +53,6 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No world.enemy_damage = args.enemy_damage.copy() world.beemizer_total_chance = args.beemizer_total_chance.copy() world.beemizer_trap_chance = args.beemizer_trap_chance.copy() - world.timer = args.timer.copy() world.countdown_start_time = args.countdown_start_time.copy() world.red_clock_time = args.red_clock_time.copy() world.blue_clock_time = args.blue_clock_time.copy() diff --git a/WebHostLib/static/assets/tracker.js b/WebHostLib/static/assets/tracker.js index 23e7f979..1a24b95c 100644 --- a/WebHostLib/static/assets/tracker.js +++ b/WebHostLib/static/assets/tracker.js @@ -1,5 +1,7 @@ const adjustTableHeight = () => { const tablesContainer = document.getElementById('tables-container'); + if (!tablesContainer) + return; const upperDistance = tablesContainer.getBoundingClientRect().top; const containerHeight = window.innerHeight - upperDistance; diff --git a/WebHostLib/templates/macros.html b/WebHostLib/templates/macros.html index ba6f33a9..927ec10f 100644 --- a/WebHostLib/templates/macros.html +++ b/WebHostLib/templates/macros.html @@ -22,7 +22,7 @@ {% for patch in room.seed.slots|list|sort(attribute="player_id") %}