mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 03:53:52 +02:00
simplify the avatar mixer communication while publicly accessible
This commit is contained in:
parent
1ceda66ab8
commit
7b8d377eb4
2 changed files with 8 additions and 6 deletions
|
@ -58,12 +58,9 @@ int main(int argc, const char* argv[])
|
|||
|
||||
agentList->linkedDataCreateCallback = attachAvatarDataToAgent;
|
||||
|
||||
agentList->startDomainServerCheckInThread();
|
||||
agentList->startSilentAgentRemovalThread();
|
||||
agentList->startPingUnknownAgentsThread();
|
||||
|
||||
sockaddr *agentAddress = new sockaddr;
|
||||
sockaddr_in* agentAddressIn;
|
||||
unsigned char *packetData = new unsigned char[MAX_PACKET_SIZE];
|
||||
ssize_t receivedBytes = 0;
|
||||
|
||||
|
@ -77,6 +74,11 @@ int main(int argc, const char* argv[])
|
|||
if (agentList->getAgentSocket().receive(agentAddress, packetData, &receivedBytes)) {
|
||||
switch (packetData[0]) {
|
||||
case PACKET_HEADER_HEAD_DATA:
|
||||
// add this agent if we don't have them yet
|
||||
if (agentList->addOrUpdateAgent(agentAddress, agentAddress, packetData[0], agentList->getLastAgentId())) {
|
||||
agentList->increaseAgentId();
|
||||
}
|
||||
|
||||
// this is positional data from an agent
|
||||
agentList->updateAgentWithData(agentAddress, packetData, receivedBytes);
|
||||
|
||||
|
@ -106,9 +108,7 @@ int main(int argc, const char* argv[])
|
|||
}
|
||||
}
|
||||
|
||||
agentList->stopDomainServerCheckInThread();
|
||||
agentList->stopSilentAgentRemovalThread();
|
||||
agentList->stopPingUnknownAgentsThread();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -253,7 +253,9 @@ bool AgentList::addOrUpdateAgent(sockaddr *publicSocket, sockaddr *localSocket,
|
|||
// to use the local socket information the domain server gave us
|
||||
sockaddr_in *publicSocketIn = (sockaddr_in *)publicSocket;
|
||||
audioMixerSocketUpdate(publicSocketIn->sin_addr.s_addr, publicSocketIn->sin_port);
|
||||
} else if (newAgent->getType() == AGENT_TYPE_VOXEL) {
|
||||
} else if (newAgent->getType() == AGENT_TYPE_VOXEL || newAgent->getType() == AGENT_TYPE_AVATAR_MIXER) {
|
||||
// this is currently the cheat we use to talk directly to our test servers on EC2
|
||||
// to be removed when we have a proper identification strategy
|
||||
newAgent->activatePublicSocket();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue