mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge pull request #163 from birarda/no-avatars
remove half-baked ping reply setup from avatar mixer
This commit is contained in:
commit
ea219cdd16
2 changed files with 14 additions and 15 deletions
|
@ -60,7 +60,6 @@ int main(int argc, const char* argv[])
|
|||
|
||||
agentList->startDomainServerCheckInThread();
|
||||
agentList->startSilentAgentRemovalThread();
|
||||
agentList->startPingUnknownAgentsThread();
|
||||
|
||||
sockaddr *agentAddress = new sockaddr;
|
||||
unsigned char *packetData = new unsigned char[MAX_PACKET_SIZE];
|
||||
|
@ -70,28 +69,27 @@ int main(int argc, const char* argv[])
|
|||
*broadcastPacket = PACKET_HEADER_BULK_AVATAR_DATA;
|
||||
|
||||
unsigned char* currentBufferPosition = NULL;
|
||||
int agentIndex = 0;
|
||||
|
||||
while (true) {
|
||||
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);
|
||||
|
||||
|
||||
currentBufferPosition = broadcastPacket + 1;
|
||||
agentIndex = 0;
|
||||
|
||||
// send back a packet with other active agent data to this agent
|
||||
for (AgentList::iterator avatarAgent = agentList->begin();
|
||||
avatarAgent != agentList->end();
|
||||
avatarAgent++) {
|
||||
if (avatarAgent->getLinkedData() != NULL
|
||||
&& !socketMatch(agentAddress, avatarAgent->getActiveSocket())) {
|
||||
currentBufferPosition = addAgentToBroadcastPacket(currentBufferPosition, &*avatarAgent);
|
||||
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||
if (agent->getLinkedData() != NULL
|
||||
&& !socketMatch(agentAddress, agent->getActiveSocket())) {
|
||||
currentBufferPosition = addAgentToBroadcastPacket(currentBufferPosition, &*agent);
|
||||
}
|
||||
|
||||
agentIndex++;
|
||||
}
|
||||
|
||||
agentList->getAgentSocket().send(agentAddress,
|
||||
|
@ -107,9 +105,8 @@ int main(int argc, const char* argv[])
|
|||
}
|
||||
}
|
||||
|
||||
agentList->stopDomainServerCheckInThread();
|
||||
agentList->stopSilentAgentRemovalThread();
|
||||
agentList->stopPingUnknownAgentsThread();
|
||||
agentList->stopDomainServerCheckInThread();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -259,7 +259,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