mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 06:09:55 +02:00
hook the avatar mixer up to the new domain server check in method
This commit is contained in:
parent
d95d3eba3b
commit
dae8032cd8
1 changed files with 12 additions and 3 deletions
|
@ -66,7 +66,6 @@ int main(int argc, const char* argv[]) {
|
||||||
|
|
||||||
agentList->linkedDataCreateCallback = attachAvatarDataToAgent;
|
agentList->linkedDataCreateCallback = attachAvatarDataToAgent;
|
||||||
|
|
||||||
agentList->startDomainServerCheckInThread();
|
|
||||||
agentList->startSilentAgentRemovalThread();
|
agentList->startSilentAgentRemovalThread();
|
||||||
|
|
||||||
sockaddr *agentAddress = new sockaddr;
|
sockaddr *agentAddress = new sockaddr;
|
||||||
|
@ -80,8 +79,19 @@ int main(int argc, const char* argv[]) {
|
||||||
|
|
||||||
uint16_t agentID = 0;
|
uint16_t agentID = 0;
|
||||||
Agent* avatarAgent = NULL;
|
Agent* avatarAgent = NULL;
|
||||||
|
|
||||||
|
timeval lastDomainServerCheckIn = {};
|
||||||
|
// we only need to hear back about avatar agents from the DS
|
||||||
|
AgentList::getInstance()->setAgentTypesOfInterest(&AGENT_TYPE_AVATAR, 1);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
|
// send a check in packet to the domain server if DOMAIN_SERVER_CHECK_IN_USECS has elapsed
|
||||||
|
if (usecTimestampNow() - usecTimestamp(&lastDomainServerCheckIn) >= DOMAIN_SERVER_CHECK_IN_USECS) {
|
||||||
|
gettimeofday(&lastDomainServerCheckIn, NULL);
|
||||||
|
AgentList::getInstance()->sendDomainServerCheckIn();
|
||||||
|
}
|
||||||
|
|
||||||
if (agentList->getAgentSocket()->receive(agentAddress, packetData, &receivedBytes)) {
|
if (agentList->getAgentSocket()->receive(agentAddress, packetData, &receivedBytes)) {
|
||||||
switch (packetData[0]) {
|
switch (packetData[0]) {
|
||||||
case PACKET_HEADER_HEAD_DATA:
|
case PACKET_HEADER_HEAD_DATA:
|
||||||
|
@ -129,7 +139,6 @@ int main(int argc, const char* argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
agentList->stopSilentAgentRemovalThread();
|
agentList->stopSilentAgentRemovalThread();
|
||||||
agentList->stopDomainServerCheckInThread();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue