From 19ac5fec99c54086f52a17b254e98b37192a9627 Mon Sep 17 00:00:00 2001 From: Ritabrata Das Date: Tue, 4 Mar 2025 15:55:34 +0530 Subject: Complete crash on ground plugin and some api changes --- plugins/crash_on_ground.py | 9 ++++++++- plugins/radar.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/crash_on_ground.py b/plugins/crash_on_ground.py index fb9d080..4cc334b 100644 --- a/plugins/crash_on_ground.py +++ b/plugins/crash_on_ground.py @@ -1,6 +1,6 @@ # This plugin renders the dead plane until crashes in ground # Thus disabling mid air dispawning when dead -from lib.PacketManager.packets import FSNETCMD_REMOVEAIRPLANE, FSNETCMD_READBACK +from lib.PacketManager.packets import FSNETCMD_REMOVEAIRPLANE, FSNETCMD_READBACK, FSNETCMD_GETDAMAGE ENABLED = True @@ -11,6 +11,7 @@ class Plugin: def register(self, plugin_manager): self.plugin_manager = plugin_manager #self.plugin_manager.register_hook('on_unjoin', self.on_death) + #self.plugin_manager.register_hook('on_add_object_server', self.on_join) self.plugin_manager.register_hook('on_remove_airplane_server', self.on_death) def on_death(self, data, player, message_to_client, message_to_server): @@ -18,6 +19,12 @@ class Plugin: if player.aircraft.id == FSNETCMD_REMOVEAIRPLANE(data).object_id: return True else: + decode = FSNETCMD_REMOVEAIRPLANE(data) + b = FSNETCMD_GETDAMAGE.encode(decode.object_id, 1, 1, + player.aircraft.id, 10000, + 11, 0, True) + message_to_client.append(b) + message_to_server.append(b) a = FSNETCMD_READBACK.encode(2, player.aircraft.id, True) message_to_server.append(a) return False diff --git a/plugins/radar.py b/plugins/radar.py index 7636dc4..e09447d 100644 --- a/plugins/radar.py +++ b/plugins/radar.py @@ -9,7 +9,7 @@ import struct import traceback ENABLED = True -RADIUS = 5000 # in meters, within this range planes with different IFF can see each other. +RADIUS = 9000 # in meters, within this range planes with different IFF can see each other. flying_players = {} -- cgit v1.2.3