From 7e74ceff2b7d32c934fa2e42fefaee45cfab4ff9 Mon Sep 17 00:00:00 2001 From: Skipper Date: Thu, 13 Feb 2025 22:22:13 +0000 Subject: Started to wrap FSNETCMD round YSchat --- lib/YSchat.py | 6 +----- proxy.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/YSchat.py b/lib/YSchat.py index d3db201..980a11b 100644 --- a/lib/YSchat.py +++ b/lib/YSchat.py @@ -1,6 +1,5 @@ from struct import pack, unpack from lib.PacketManager.packets import FSNETCMD_TEXTMESSAGE -#Re-write this to wrap the FSNETCMD_TEXTMESSAGE class def send(buffer: bytes): """ @@ -18,7 +17,4 @@ def message(msg: str): """ Generate packets for sending messages """ - decode = "l" + str(len(msg) + 2) + "s" - msg_buffer = bytes(msg, 'utf-8') - buffer = pack(decode, 0, msg_buffer) - return reply(32, buffer) + return FSNETCMD_TEXTMESSAGE.encode(msg,True) diff --git a/proxy.py b/proxy.py index 3ca6394..82fe90b 100644 --- a/proxy.py +++ b/proxy.py @@ -6,7 +6,7 @@ Lisenced under GPLv3 import asyncio from struct import unpack, pack from lib.parseFlightData import parseFlightData -from lib import YSchat, YSplayer, YSendFlight, YSundead, YSviaversion, Player, Aircraft +from lib import YSchat, YSviaversion, Player, Aircraft from lib.plugin_manager import PluginManager from lib.PacketManager.PacketManager import PacketManager from lib.PacketManager.packets import * -- cgit v1.2.3