fix: enhance debug output for local ID in handleDomainListReply

This commit is contained in:
MayaTheShy
2025-11-10 00:39:56 -05:00
parent 1a56257349
commit c449c452b3

View File

@@ -955,6 +955,12 @@ void OverteClient::handleDomainListReply(const char* data, size_t len) {
// Read domain local ID (16-bit) - this is in LITTLE-ENDIAN, not big-endian!
// Do NOT use ntohs() - just read directly on x86
if (offset + 2 > len) return;
// Debug: show the exact bytes at this position
std::cout << "[OverteClient] LocalID bytes at offset " << offset << ": "
<< std::hex << std::setfill('0') << std::setw(2) << (int)(unsigned char)data[offset] << " "
<< std::setw(2) << (int)(unsigned char)data[offset+1] << std::dec << std::endl;
uint16_t localID;
std::memcpy(&localID, data + offset, sizeof(uint16_t)); // Direct read, little-endian
offset += 2;
@@ -962,7 +968,7 @@ void OverteClient::handleDomainListReply(const char* data, size_t len) {
// Store our local ID for use in sourced packets
m_localID = localID;
std::cout << "[OverteClient] Local ID: " << localID << std::endl;
std::cout << "[OverteClient] Local ID: " << localID << " (0x" << std::hex << localID << std::dec << ")" << std::endl;
// Read permissions (32-bit)
if (offset + 4 > len) return;