From 2f1a034696f075ed2ac64a611210bacf6f12020d Mon Sep 17 00:00:00 2001 From: FreezeEngine Date: Sat, 5 Oct 2024 20:45:37 +0300 Subject: [PATCH 1/2] Revert "fix TextPacket" This reverts commit 0cc28c6e7a6ab2a08c3c74c93d6f77d1fb1976dd. --- src/client/hook/impl/PacketHooks.cpp | 2 +- src/sdk/common/network/packet/TextPacket.cpp | 1 + src/sdk/common/network/packet/TextPacket.h | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/hook/impl/PacketHooks.cpp b/src/client/hook/impl/PacketHooks.cpp index 3cb9bdd8..a67337b0 100644 --- a/src/client/hook/impl/PacketHooks.cpp +++ b/src/client/hook/impl/PacketHooks.cpp @@ -133,7 +133,7 @@ void PacketHooks::PacketHandlerDispatcherInstance_handle(void* instance, void* n val2.val = util::StrToWStr(pkt->source); PluginManager::Event::Value val3{ L"xuid" }; - val3.val = L""; // No longer exists + val3.val = util::StrToWStr(pkt->xboxUserId); PluginManager::Event::Value isChat{ L"isChat" }; isChat.val = (pkt->type == SDK::TextPacketType::CHAT || pkt->type == SDK::TextPacketType::RAW diff --git a/src/sdk/common/network/packet/TextPacket.cpp b/src/sdk/common/network/packet/TextPacket.cpp index a0df9cb3..62e8502f 100644 --- a/src/sdk/common/network/packet/TextPacket.cpp +++ b/src/sdk/common/network/packet/TextPacket.cpp @@ -9,5 +9,6 @@ void SDK::TextPacket::chat(std::string const& message) { this->str = message; this->source = SDK::ClientInstance::get()->getLocalPlayer()->playerName; + this->xboxUserId = SDK::ClientInstance::get()->minecraftGame->xuid; this->type = TextPacketType::CHAT; } diff --git a/src/sdk/common/network/packet/TextPacket.h b/src/sdk/common/network/packet/TextPacket.h index 777693b5..06c716d3 100644 --- a/src/sdk/common/network/packet/TextPacket.h +++ b/src/sdk/common/network/packet/TextPacket.h @@ -22,6 +22,10 @@ namespace SDK { TextPacketType type; std::string source; std::string str; + std::vector params; + bool translationNeeded = false; + std::string xboxUserId; + std::string platformChatId; TextPacket() = default; From 837059b58002f9852c5c4690b039e28458337bbf Mon Sep 17 00:00:00 2001 From: FreezeEngine Date: Sat, 5 Oct 2024 21:41:18 +0300 Subject: [PATCH 2/2] Text packet actual fix --- src/sdk/common/network/packet/TextPacket.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sdk/common/network/packet/TextPacket.h b/src/sdk/common/network/packet/TextPacket.h index 06c716d3..8f43decb 100644 --- a/src/sdk/common/network/packet/TextPacket.h +++ b/src/sdk/common/network/packet/TextPacket.h @@ -22,6 +22,7 @@ namespace SDK { TextPacketType type; std::string source; std::string str; + std::optional filteredMessage; std::vector params; bool translationNeeded = false; std::string xboxUserId;