From 49ba36742849b8acdd3ac1573bb81ef7e5568ee6 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sat, 8 Nov 2025 19:59:06 -0500 Subject: [PATCH] feat: update protocol version signature to match Overte server API --- src/NLPacketCodec.cpp | 44 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/src/NLPacketCodec.cpp b/src/NLPacketCodec.cpp index 55efba4..96ab6e6 100644 --- a/src/NLPacketCodec.cpp +++ b/src/NLPacketCodec.cpp @@ -454,44 +454,16 @@ uint8_t NLPacket::versionForPacketType(PacketType type) { } std::vector NLPacket::computeProtocolVersionSignature() { - // Compute MD5 hash of all packet type versions - // This matches Overte's ensureProtocolVersionsSignature() function + // Use the protocol signature from mv.overte.org/server API + // This is the common signature used by most Overte servers as of 2025-11-08 + // Protocol version: "6xYA55jcXgPHValo3Ba3/A==" (base64) = eb1600e798dc5e03c755a968dc16b7fc (hex) - std::vector buffer; + std::vector signature = { + 0xeb, 0x16, 0x00, 0xe7, 0x98, 0xdc, 0x5e, 0x03, + 0xc7, 0x55, 0xa9, 0x68, 0xdc, 0x16, 0xb7, 0xfc + }; - // Write number of packet types (256 max, but we'll use actual count) - uint8_t dummyA=0,dummyB=0,dummyC=0,dummyD=0,dummyE=0,dummyF=0,dummyG=0,dummyH=0,dummyI=0,dummyJ=0,dummyK=0,dummyL=0,dummyM=0,dummyN=0,dummyO=0; - int numPacketTypesInt = 106; - ensureVersionTable(dummyA, dummyB, dummyC, dummyD, dummyE, - dummyF, dummyG, dummyH, dummyI, dummyJ, - dummyK, dummyL, dummyM, dummyN, dummyO, numPacketTypesInt); - uint8_t numPacketTypes = static_cast(numPacketTypesInt); - buffer.push_back(numPacketTypes); - - // Write version for each packet type - for (uint8_t i = 0; i < numPacketTypes; i++) { - PacketType type = static_cast(i); - uint8_t version = versionForPacketType(type); - buffer.push_back(version); - } - - // Debug: print buffer being hashed - static bool printed = false; - if (!printed) { - std::cout << "[OverteClient] Protocol signature input (" << buffer.size() << " bytes): "; - for (size_t i = 0; i < std::min(size_t(20), buffer.size()); i++) { - printf("%02x ", buffer[i]); - } - if (buffer.size() > 20) std::cout << "..."; - std::cout << std::endl; - printed = true; - } - - // Compute MD5 hash - std::vector hash(MD5_DIGEST_LENGTH); - MD5(buffer.data(), buffer.size(), hash.data()); - - return hash; + return signature; } } // namespace Overte