summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRitabrata Das <[email protected]>2025-02-23 10:39:10 +0530
committerRitabrata Das <[email protected]>2025-02-23 10:39:10 +0530
commit20b1b5b1ce90514f4a51e5edd073dc6e6ed60d0e (patch)
tree66c9dd300414a7b1305fc45a3a0689ae21f8fe31 /plugins
parent4ef8b7a861baa1dfc773c4efd27e570f79dcb873 (diff)
Make radar position aribitary
Diffstat (limited to 'plugins')
-rw-r--r--plugins/aircraft_replacer.py8
-rw-r--r--plugins/radar.py4
2 files changed, 7 insertions, 5 deletions
diff --git a/plugins/aircraft_replacer.py b/plugins/aircraft_replacer.py
index 1515a6a..f2db5a9 100644
--- a/plugins/aircraft_replacer.py
+++ b/plugins/aircraft_replacer.py
@@ -19,7 +19,7 @@ class Plugin:
self.plugin_manager.register_hook('on_add_object_server', self.on_add_object_server)
# self.plugin_manager.register_hook('on_flight_data_server', self.on_flight_data_server)
self.plugin_manager.register_hook('on_join_request', self.on_join_request)
-
+
def on_add_object_server(self, data, player, messages_to_client, *args):
packet = FSNETCMD_ADDOBJECT(data)
@@ -43,18 +43,18 @@ class Plugin:
# packet.position = [0,2000.0,0]
# packet.velocity = [25,0,25]
# messages_to_client.append(packet.to_packet())
-
+
# self.first_add_object = False
# return False
# return True
-
+
def on_join_request(self, data, player, messages_to_client, message_to_server, *args):
packet = FSNETCMD_JOINREQUEST(data)
#Replace the aircraft:
packet.aircraft = "EUROFIGHTER_TYPHOON"
message_to_server.append(packet.to_packet())
return False
-
+
# def on_receive(self, data, player, messages_to_client, *args):
# if ENABLED:
# if abs(player.aircraft.last_packet.g_value)> G_LIM:
diff --git a/plugins/radar.py b/plugins/radar.py
index 4695f06..7636dc4 100644
--- a/plugins/radar.py
+++ b/plugins/radar.py
@@ -58,7 +58,9 @@ class Plugin:
return True
else:
try:
- position_data = struct.pack("3f", 10000, 1000.0, 1000.0)
+ # This is a really arbitary position thats hard to reach, better would
+ # be to randomise it for every time the server starts.
+ position_data = struct.pack("3f", 10e7, 10e7, 10e7)
if decode.packet_version == 4 or 5:
updated_data = data[:14] + position_data + data[26:]
else: