mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:41:10 +02:00
fix unpacking of other avatars in avatar mixer bulk packet
This commit is contained in:
parent
6bad72a18e
commit
e8fbfcab05
3 changed files with 8 additions and 11 deletions
|
@ -88,15 +88,12 @@ int main(int argc, const char* argv[]) {
|
||||||
|
|
||||||
// send back a packet with other active agent data to this agent
|
// send back a packet with other active agent data to this agent
|
||||||
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||||
if (agent->getLinkedData() != NULL
|
if (agent->getLinkedData() && !socketMatch(agentAddress, agent->getActiveSocket())) {
|
||||||
&& !socketMatch(agentAddress, agent->getActiveSocket())) {
|
|
||||||
currentBufferPosition = addAgentToBroadcastPacket(currentBufferPosition, &*agent);
|
currentBufferPosition = addAgentToBroadcastPacket(currentBufferPosition, &*agent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
agentList->getAgentSocket().send(agentAddress,
|
agentList->getAgentSocket().send(agentAddress, broadcastPacket, currentBufferPosition - broadcastPacket);
|
||||||
broadcastPacket,
|
|
||||||
currentBufferPosition - broadcastPacket);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PACKET_HEADER_DOMAIN:
|
case PACKET_HEADER_DOMAIN:
|
||||||
|
|
|
@ -52,7 +52,7 @@ void *receiveAgentData(void *args) {
|
||||||
// avatar mixer - this makes sure it won't be killed during silent agent removal
|
// avatar mixer - this makes sure it won't be killed during silent agent removal
|
||||||
avatarMixer = agentList->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER);
|
avatarMixer = agentList->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER);
|
||||||
|
|
||||||
if (avatarMixer != NULL) {
|
if (avatarMixer) {
|
||||||
avatarMixer->setLastHeardMicrostamp(usecTimestampNow());
|
avatarMixer->setLastHeardMicrostamp(usecTimestampNow());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ void *injectAudio(void *args) {
|
||||||
// look for an audio mixer in our agent list
|
// look for an audio mixer in our agent list
|
||||||
Agent* audioMixer = AgentList::getInstance()->soloAgentOfType(AGENT_TYPE_AUDIO_MIXER);
|
Agent* audioMixer = AgentList::getInstance()->soloAgentOfType(AGENT_TYPE_AUDIO_MIXER);
|
||||||
|
|
||||||
if (audioMixer != NULL) {
|
if (audioMixer) {
|
||||||
// until the audio mixer is setup for ping-reply, activate the public socket if it's not active
|
// until the audio mixer is setup for ping-reply, activate the public socket if it's not active
|
||||||
if (audioMixer->getActiveSocket() == NULL) {
|
if (!audioMixer->getActiveSocket()) {
|
||||||
audioMixer->activatePublicSocket();
|
audioMixer->activatePublicSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,9 +117,9 @@ int main(int argc, const char* argv[]) {
|
||||||
// move eve away from the origin
|
// move eve away from the origin
|
||||||
// pick a random point inside a 10x10 grid
|
// pick a random point inside a 10x10 grid
|
||||||
|
|
||||||
eve.setPosition(glm::vec3(randFloatInRange(-RANDOM_POSITION_MAX_DIMENSION, RANDOM_POSITION_MAX_DIMENSION),
|
eve.setPosition(glm::vec3(randFloatInRange(0, RANDOM_POSITION_MAX_DIMENSION),
|
||||||
1.33, // this should be the same as the avatar's pelvis standing height
|
1.33, // this should be the same as the avatar's pelvis standing height
|
||||||
randFloatInRange(-RANDOM_POSITION_MAX_DIMENSION, RANDOM_POSITION_MAX_DIMENSION)));
|
randFloatInRange(0, RANDOM_POSITION_MAX_DIMENSION)));
|
||||||
|
|
||||||
// face any instance of eve down the z-axis
|
// face any instance of eve down the z-axis
|
||||||
eve.setBodyYaw(0);
|
eve.setBodyYaw(0);
|
||||||
|
|
|
@ -123,7 +123,7 @@ void AgentList::processBulkAgentData(sockaddr *senderAddress, unsigned char *pac
|
||||||
uint16_t agentID = -1;
|
uint16_t agentID = -1;
|
||||||
|
|
||||||
while ((currentPosition - startPosition) < numTotalBytes) {
|
while ((currentPosition - startPosition) < numTotalBytes) {
|
||||||
currentPosition += unpackAgentId(currentPosition, &agentID);
|
unpackAgentId(currentPosition, &agentID);
|
||||||
memcpy(packetHolder + 1, currentPosition, numTotalBytes - (currentPosition - startPosition));
|
memcpy(packetHolder + 1, currentPosition, numTotalBytes - (currentPosition - startPosition));
|
||||||
|
|
||||||
Agent* matchingAgent = agentWithID(agentID);
|
Agent* matchingAgent = agentWithID(agentID);
|
||||||
|
|
Loading…
Reference in a new issue