From 0e6ab98c6febf8db8bb8bb8aff2960e038460c85 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Sun, 13 Apr 2025 18:09:00 +0200 Subject: [PATCH] MP: Logging, test js parameters (broken) --- project.godot | 1 + scenes/main.gd | 8 ++++++++ signalsrv/signalsrv.py | 9 ++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/project.godot b/project.godot index b9b9a88..c493726 100644 --- a/project.godot +++ b/project.godot @@ -20,6 +20,7 @@ config/icon="res://icon.svg" [autoload] MorseState="*res://autoloads/morse_state.gd" +Utils="*res://autoloads/utils.gd" [display] diff --git a/scenes/main.gd b/scenes/main.gd index 4c386df..26190d9 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -29,6 +29,14 @@ func _ready(): if multiplayer_enabled: %MultiplayerButton.visible = true + + + print("External freq: ", Utils.get_external_freq_param()) + if Utils.get_external_freq_param(): + + _on_multiplayer_button_pressed() + + # FIXME: make this dependant on button OS.open_midi_inputs() print(OS.get_connected_midi_inputs()) diff --git a/signalsrv/signalsrv.py b/signalsrv/signalsrv.py index ff22ddd..67d79f8 100644 --- a/signalsrv/signalsrv.py +++ b/signalsrv/signalsrv.py @@ -1,11 +1,18 @@ import asyncio +import datetime import json +import logging import re from websockets.asyncio.server import serve __VERSION__ = "0.0.1" +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s %(name)s %(levelname)s %(message)s" +) + class Client: freqs = {} @@ -53,7 +60,7 @@ class Client: await self._send_error("Invalid format in json") continue - print(f"{self.client} wrote:", data) + print(f"{datetime.datetime.now()} {self.client} wrote:", data) match data["cmd"]: case "quit":