mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 16:22:51 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
d7f37e5972
4 changed files with 9 additions and 7 deletions
|
@ -74,6 +74,7 @@
|
|||
#include <PerfStat.h>
|
||||
#include <SharedUtil.h>
|
||||
#include <PacketHeaders.h>
|
||||
#include <AvatarData.h>
|
||||
|
||||
#include "ViewFrustum.h"
|
||||
|
||||
|
@ -1310,7 +1311,7 @@ void *networkReceive(void *args)
|
|||
AgentList::getInstance()->processBulkAgentData(&senderAddress,
|
||||
incomingPacket,
|
||||
bytesReceived,
|
||||
(sizeof(float) * 3) + (sizeof(uint16_t) * 3));
|
||||
BYTES_PER_AVATAR);
|
||||
break;
|
||||
default:
|
||||
AgentList::getInstance()->processAgentData(&senderAddress, incomingPacket, bytesReceived);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <cstring>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <SharedUtil.h>
|
||||
#include <PacketHeaders.h>
|
||||
|
||||
#include "AvatarData.h"
|
||||
|
@ -69,7 +70,6 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
|||
|
||||
// called on the other agents - assigns it to my views of the others
|
||||
void AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||
|
||||
// increment to push past the packet header
|
||||
sourceBuffer++;
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
#include <AgentData.h>
|
||||
|
||||
const int BYTES_PER_AVATAR = 30;
|
||||
|
||||
class AvatarData : public AgentData {
|
||||
public:
|
||||
AvatarData();
|
||||
|
|
|
@ -109,7 +109,7 @@ void AgentList::processBulkAgentData(sockaddr *senderAddress, unsigned char *pac
|
|||
|
||||
unsigned char *startPosition = (unsigned char *)packetData;
|
||||
unsigned char *currentPosition = startPosition + 1;
|
||||
unsigned char *packetHolder = new unsigned char[numBytesPerAgent + 1];
|
||||
unsigned char packetHolder[numBytesPerAgent + 1];
|
||||
|
||||
packetHolder[0] = PACKET_HEADER_HEAD_DATA;
|
||||
|
||||
|
@ -122,13 +122,12 @@ void AgentList::processBulkAgentData(sockaddr *senderAddress, unsigned char *pac
|
|||
int matchingAgentIndex = indexOfMatchingAgent(agentID);
|
||||
|
||||
if (matchingAgentIndex >= 0) {
|
||||
|
||||
updateAgentWithData(&agents[matchingAgentIndex], packetHolder, numBytesPerAgent + 1);
|
||||
}
|
||||
|
||||
currentPosition += numBytesPerAgent;
|
||||
}
|
||||
|
||||
delete[] packetHolder;
|
||||
}
|
||||
|
||||
void AgentList::updateAgentWithData(sockaddr *senderAddress, unsigned char *packetData, size_t dataBytes) {
|
||||
|
|
Loading…
Reference in a new issue