mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 00:52:27 +02:00
smarter wake microstamp update for solo agents in DS
This commit is contained in:
parent
c793f3385c
commit
cfd4a4a44a
1 changed files with 7 additions and 6 deletions
|
@ -119,11 +119,6 @@ int main(int argc, const char * argv[])
|
|||
agentType,
|
||||
agentList->getLastAgentId())) {
|
||||
agentList->increaseAgentId();
|
||||
} else if (packetData[0] == PACKET_HEADER_DOMAIN_RFD) {
|
||||
// if this is a previous agent, and they are re-reporting for duty
|
||||
// then we need to update the first receive time
|
||||
Agent* refreshedAgent = agentList->agentWithAddress((sockaddr*) &agentLocalAddress);
|
||||
refreshedAgent->setWakeMicrostamp(usecTimestampNow());
|
||||
}
|
||||
|
||||
currentBufferPos = broadcastPacket + 1;
|
||||
|
@ -147,8 +142,14 @@ int main(int argc, const char * argv[])
|
|||
}
|
||||
}
|
||||
} else {
|
||||
double timeNow = usecTimestampNow();
|
||||
// this is the agent, just update last receive to now
|
||||
agent->setLastHeardMicrostamp(usecTimestampNow());
|
||||
agent->setLastHeardMicrostamp(timeNow);
|
||||
|
||||
if (packetData[0] == PACKET_HEADER_DOMAIN_RFD
|
||||
&& memchr(SOLO_AGENT_TYPES, agentType, sizeof(SOLO_AGENT_TYPES))) {
|
||||
agent->setWakeMicrostamp(timeNow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue