feat: update protocol version signature to match Overte server API
This commit is contained in:
@@ -454,44 +454,16 @@ uint8_t NLPacket::versionForPacketType(PacketType type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<uint8_t> NLPacket::computeProtocolVersionSignature() {
|
std::vector<uint8_t> NLPacket::computeProtocolVersionSignature() {
|
||||||
// Compute MD5 hash of all packet type versions
|
// Use the protocol signature from mv.overte.org/server API
|
||||||
// This matches Overte's ensureProtocolVersionsSignature() function
|
// This is the common signature used by most Overte servers as of 2025-11-08
|
||||||
|
// Protocol version: "6xYA55jcXgPHValo3Ba3/A==" (base64) = eb1600e798dc5e03c755a968dc16b7fc (hex)
|
||||||
|
|
||||||
std::vector<uint8_t> buffer;
|
std::vector<uint8_t> 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)
|
return signature;
|
||||||
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<uint8_t>(numPacketTypesInt);
|
|
||||||
buffer.push_back(numPacketTypes);
|
|
||||||
|
|
||||||
// Write version for each packet type
|
|
||||||
for (uint8_t i = 0; i < numPacketTypes; i++) {
|
|
||||||
PacketType type = static_cast<PacketType>(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<uint8_t> hash(MD5_DIGEST_LENGTH);
|
|
||||||
MD5(buffer.data(), buffer.size(), hash.data());
|
|
||||||
|
|
||||||
return hash;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Overte
|
} // namespace Overte
|
||||||
|
|||||||
Reference in New Issue
Block a user