diff options
| author | Ritabrata Das <[email protected]> | 2025-03-02 12:03:17 +0530 |
|---|---|---|
| committer | Ritabrata Das <[email protected]> | 2025-03-02 12:03:17 +0530 |
| commit | 24bb2bbd61ea05741db78fab37b9166b0696135b (patch) | |
| tree | 9efd6f6b3d5442c7d1959238dacda053dfac1bc7 | |
| parent | 520853a8a659f0dc296f0d5fb301913cbee37688 (diff) | |
Ignor bots leaving, add player aircraft message to chat sync
| -rw-r--r-- | proxy.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |
