mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
Starting agent count at 1 to allow for 0 to be non-id specifier and packing the id into boadcast packet
This commit is contained in:
parent
a76f8a46cd
commit
a1691f54a1
1 changed files with 7 additions and 2 deletions
|
@ -25,14 +25,14 @@ AgentList::AgentList() : agentSocket(AGENT_SOCKET_LISTEN_PORT) {
|
|||
linkedDataCreateCallback = NULL;
|
||||
audioMixerSocketUpdate = NULL;
|
||||
voxelServerAddCallback = NULL;
|
||||
lastAgentId = 0;
|
||||
lastAgentId = 1;
|
||||
}
|
||||
|
||||
AgentList::AgentList(int socketListenPort) : agentSocket(socketListenPort) {
|
||||
linkedDataCreateCallback = NULL;
|
||||
audioMixerSocketUpdate = NULL;
|
||||
voxelServerAddCallback = NULL;
|
||||
lastAgentId = 0;
|
||||
lastAgentId = 1;
|
||||
}
|
||||
|
||||
AgentList::~AgentList() {
|
||||
|
@ -114,6 +114,11 @@ int AgentList::unpackAgentId(unsigned char *packedData, uint16_t *agentId) {
|
|||
return sizeof(uint16_t);
|
||||
}
|
||||
|
||||
int AgentList::packAgentId(unsigned char *packStore, uint16_t agentId) {
|
||||
memcpy(&agentId, packStore, sizeof(uint16_t));
|
||||
return sizeof(uint16_t);
|
||||
}
|
||||
|
||||
int AgentList::updateList(unsigned char *packetData, size_t dataBytes) {
|
||||
int readAgents = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue