mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
log username with "haven't heard from" messages
remove rebind on silent domain checkin
This commit is contained in:
parent
3d2b1dbf2b
commit
5b6911efa4
3 changed files with 6 additions and 10 deletions
|
@ -1735,7 +1735,12 @@ void DomainServer::nodePingMonitor() {
|
|||
nodeList->eachNode([now](const SharedNodePointer& node) {
|
||||
quint64 lastHeard = now - node->getLastHeardMicrostamp();
|
||||
if (lastHeard > 2 * USECS_PER_SECOND) {
|
||||
qCDebug(domain_server) << "Haven't heard from " << node->getPublicSocket() << " in " << lastHeard / USECS_PER_MSEC << " msec";
|
||||
QString username;
|
||||
DomainServerNodeData* nodeData = static_cast<DomainServerNodeData*>(node->getLinkedData());
|
||||
if(nodeData) {
|
||||
username = nodeData->getUsername();
|
||||
}
|
||||
qCDebug(domain_server) << "Haven't heard from " << node->getPublicSocket() << username << " in " << lastHeard / USECS_PER_MSEC << " msec";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -450,13 +450,8 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
|
||||
// Send duplicate check-ins in the exponentially increasing sequence 1, 1, 2, 4, ...
|
||||
static const int MAX_CHECKINS_TOGETHER = 20;
|
||||
static const int REBIND_CHECKIN_COUNT = 2;
|
||||
int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply();
|
||||
|
||||
if (outstandingCheckins > REBIND_CHECKIN_COUNT) {
|
||||
_nodeSocket.rebind();
|
||||
}
|
||||
|
||||
int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1;
|
||||
checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER);
|
||||
for (int i = 1; i < checkinCount; ++i) {
|
||||
|
|
|
@ -76,10 +76,6 @@ void Socket::rebind() {
|
|||
|
||||
void Socket::rebind(quint16 localPort) {
|
||||
_udpSocket.close();
|
||||
#ifdef WIN32
|
||||
WSAData ws;
|
||||
WSAStartup(MAKEWORD(2, 2), &ws);
|
||||
#endif
|
||||
bind(QHostAddress::AnyIPv4, localPort);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue