diff options
| -rw-r--r-- | lib/plugin_manager.py | 2 | ||||
| -rw-r--r-- | lib/triggerRespectiveHook.py | 4 | ||||
| -rw-r--r-- | proxy.py | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/plugin_manager.py b/lib/plugin_manager.py index 5cc93d2..0a9174c 100644 --- a/lib/plugin_manager.py +++ b/lib/plugin_manager.py @@ -10,7 +10,7 @@ class PluginManager: def __init__(self): self.plugins = {} self.hooks= {} - self.commands = {} + self.commands = {'help': None} self.help_message = "List of Available Commands:\n" self.load_plugins() diff --git a/lib/triggerRespectiveHook.py b/lib/triggerRespectiveHook.py index 25801a0..f7dc443 100644 --- a/lib/triggerRespectiveHook.py +++ b/lib/triggerRespectiveHook.py @@ -59,7 +59,7 @@ def triggerRespectiveHook(packet_type, packet, player, message_to_client, messag keep_message = plugin_manager.triggar_hook('on_list', packet, player, message_to_client, message_to_server) else: keep_message = True - debug(f"Unknown packet type {packet_type}, C2S") + debug(f"Unimplemented packet type {packet_type}, C2S") return keep_message @@ -122,6 +122,6 @@ def triggerRespectiveHookServer(packet_type, packet, player, message_to_client, keep_message = plugin_manager.triggar_hook('on_list_server', packet, player, message_to_client, message_to_server) else: keep_message = True - debug(f"Unknown packet type {packet_type}, S2C") + debug(f"Unimplemented packet type {packet_type}, S2C") return keep_message @@ -40,7 +40,8 @@ class ColoredFormatter(logging.Formatter): def format(self, record): log_color = COLORS.get(record.levelname, COLORS["RESET"]) reset = COLORS["RESET"] - log_message = f"{log_color}{record.levelname}: {record.getMessage()}{reset}" + file_name = record.pathname.split('/')[-1] # Extract just the filename + log_message = f"{log_color}{record.levelname} [{file_name}:{record.lineno}]: {record.getMessage()}{reset}" return log_message logging.basicConfig(level=LOGGING_LEVEL) @@ -286,5 +287,6 @@ if __name__ == "__main__": asyncio.run(discord_send_message(CHANNEL_ID, "✅ Server has started.")) asyncio.run(start_proxy()) except KeyboardInterrupt: - asyncio.run(discord_send_message(CHANNEL_ID, "❌ Server has stopped.")) + if DISCORD_ENABLED: + asyncio.run(discord_send_message(CHANNEL_ID, "❌ Server has stopped.")) info("Goodbye!") |
