mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
Merge pull request #211 from birarda/master
refactor wake microstamp update for solo agents in DS
This commit is contained in:
commit
6d77124d21
1 changed files with 7 additions and 6 deletions
|
@ -119,11 +119,6 @@ int main(int argc, const char * argv[])
|
||||||
agentType,
|
agentType,
|
||||||
agentList->getLastAgentId())) {
|
agentList->getLastAgentId())) {
|
||||||
agentList->increaseAgentId();
|
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;
|
currentBufferPos = broadcastPacket + 1;
|
||||||
|
@ -147,8 +142,14 @@ int main(int argc, const char * argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
double timeNow = usecTimestampNow();
|
||||||
// this is the agent, just update last receive to now
|
// 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