feat: enhance domain list handling by interpreting potential count fields and updating request logic
This commit is contained in:
@@ -937,6 +937,13 @@ void OverteClient::handleDomainListReply(const char* data, size_t len) {
|
|||||||
if (len - offset >= 2) {
|
if (len - offset >= 2) {
|
||||||
uint16_t possibleCount16 = ntohs(*reinterpret_cast<const uint16_t*>(data + offset));
|
uint16_t possibleCount16 = ntohs(*reinterpret_cast<const uint16_t*>(data + offset));
|
||||||
std::cout << "[OverteClient] First 2 bytes as uint16 (big-endian): " << possibleCount16 << std::endl;
|
std::cout << "[OverteClient] First 2 bytes as uint16 (big-endian): " << possibleCount16 << std::endl;
|
||||||
|
|
||||||
|
// New observation: those 2 bytes might be flags or a node count
|
||||||
|
// Let's interpret them as little-endian too
|
||||||
|
uint16_t possibleCount16_le = *reinterpret_cast<const uint16_t*>(data + offset);
|
||||||
|
std::cout << "[OverteClient] First 2 bytes as uint16 (little-endian): " << possibleCount16_le << std::endl;
|
||||||
|
std::cout << "[OverteClient] As individual bytes: 0x" << std::hex << (int)(unsigned char)data[offset]
|
||||||
|
<< " 0x" << (int)(unsigned char)data[offset+1] << std::dec << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse assignment client nodes from the packet
|
// Parse assignment client nodes from the packet
|
||||||
@@ -1089,30 +1096,16 @@ void OverteClient::handleDomainListReply(const char* data, size_t len) {
|
|||||||
std::cout << "[OverteClient] Warning: No EntityServer found in assignment client list" << std::endl;
|
std::cout << "[OverteClient] Warning: No EntityServer found in assignment client list" << std::endl;
|
||||||
std::cout << "[OverteClient] This might be expected for non-authenticated connections." << std::endl;
|
std::cout << "[OverteClient] This might be expected for non-authenticated connections." << std::endl;
|
||||||
|
|
||||||
// Modern Overte doesn't advertise assignment clients in DomainList anymore
|
// The first DomainList reply might not include assignment clients
|
||||||
// Instead, we broadcast EntityQuery to discover EntityServer
|
// Request an updated DomainList now that the server knows our interests
|
||||||
std::cout << "[OverteClient] Broadcasting EntityQuery to discover EntityServer..." << std::endl;
|
std::cout << "[OverteClient] Requesting updated DomainList to get assignment clients..." << std::endl;
|
||||||
|
sendDomainListRequest();
|
||||||
|
|
||||||
// Try a range of common Overte assignment client ports
|
// Modern Overte: also try sending EntityQuery directly to domain server
|
||||||
// Overte assignment clients typically use ports in 48000-60000 range
|
// The domain server may forward it to the EntityServer or respond directly
|
||||||
std::vector<uint16_t> portRange;
|
std::cout << "[OverteClient] Sending EntityQuery to domain server as fallback..." << std::endl;
|
||||||
for (uint16_t port = 48000; port <= 52000; port += 500) {
|
m_entityServerPort = 0; // Will use domain server address
|
||||||
portRange.push_back(port);
|
sendEntityQuery();
|
||||||
}
|
|
||||||
// Add some specific common ports
|
|
||||||
portRange.push_back(40103);
|
|
||||||
portRange.push_back(40104);
|
|
||||||
portRange.push_back(48247);
|
|
||||||
|
|
||||||
for (uint16_t port : portRange) {
|
|
||||||
std::memcpy(&m_entityServerAddr, &m_udpAddr, m_udpAddrLen);
|
|
||||||
reinterpret_cast<sockaddr_in*>(&m_entityServerAddr)->sin_port = htons(port);
|
|
||||||
m_entityServerAddrLen = m_udpAddrLen;
|
|
||||||
m_entityServerPort = port;
|
|
||||||
sendEntityQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "[OverteClient] Sent EntityQuery to " << portRange.size() << " potential assignment client ports" << std::endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user