From 24bb2bbd61ea05741db78fab37b9166b0696135b Mon Sep 17 00:00:00 2001 From: Ritabrata Das Date: Sun, 2 Mar 2025 12:03:17 +0530 Subject: Ignor bots leaving, add player aircraft message to chat sync --- proxy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy.py b/proxy.py index 68bb6f7..5dd9cc7 100644 --- a/proxy.py +++ b/proxy.py @@ -143,9 +143,10 @@ async def handle_client(client_reader, client_writer): continue elif packet_type == "FSNETCMD_JOINREQUEST": - player.iff = FSNETCMD_JOINREQUEST(packet).iff + 1 + decode = FSNETCMD_JOINREQUEST(packet) + player.iff = decode.iff if DISCORD_ENABLED: - asyncio.create_task(discord_send_message(CHANNEL_ID, f"{player.username} has taken off! 🛫")) + asyncio.create_task(discord_send_message(CHANNEL_ID, f"{player.username} has took off in a {decode.aircraft}! 🛫")) elif packet_type == "FSNETCMD_AIRPLANESTATE": player.aircraft.add_state(FSNETCMD_AIRPLANESTATE(packet)) #TODO: Do we want to convert all this to plugins? Probably not, but there is duplicated functionality @@ -263,7 +264,7 @@ async def handle_client(client_reader, client_writer): """ if not player.connection_closed: player.connection_closed = True - if DISCORD_ENABLED : + if DISCORD_ENABLED and not player.is_a_bot: await discord_send_message(CHANNEL_ID, f"{player.username} has left the server!") await close_connection(client_writer, server_writer) -- cgit v1.2.3