mirror of
https://github.com/overte-org/overte.git
synced 2025-08-16 17:32:52 +02:00
make voxel server tree NOT a reaveraging tree, also, don't rebroadcast some Z commands to clients
This commit is contained in:
parent
25700ae490
commit
bf9c867611
1 changed files with 10 additions and 5 deletions
|
@ -49,7 +49,7 @@ int PACKETS_PER_CLIENT_PER_INTERVAL = 50;
|
|||
|
||||
const int MAX_VOXEL_TREE_DEPTH_LEVELS = 4;
|
||||
|
||||
VoxelTree randomTree(true); // this is a reaveraging tree
|
||||
VoxelTree randomTree(false); // this is NOT a reaveraging tree
|
||||
bool wantVoxelPersist = true;
|
||||
bool wantLocalDomain = false;
|
||||
|
||||
|
@ -643,16 +643,19 @@ int main(int argc, const char * argv[]) {
|
|||
int totalLength = sizeof(PACKET_HEADER_Z_COMMAND) + commandLength + 1; // 1 for null termination
|
||||
|
||||
printf("got Z message len(%ld)= %s\n", receivedBytes, command);
|
||||
|
||||
bool rebroadcast = true; // be default rebroadcast
|
||||
|
||||
while (totalLength <= receivedBytes) {
|
||||
if (strcmp(command, ERASE_ALL_COMMAND) == 0) {
|
||||
printf("got Z message == erase all\n");
|
||||
|
||||
eraseVoxelTreeAndCleanupAgentVisitData();
|
||||
rebroadcast = false;
|
||||
}
|
||||
if (strcmp(command, ADD_SCENE_COMMAND) == 0) {
|
||||
printf("got Z message == add scene\n");
|
||||
addSphereScene(&randomTree);
|
||||
rebroadcast = false;
|
||||
}
|
||||
if (strcmp(command, TEST_COMMAND) == 0) {
|
||||
printf("got Z message == a message, nothing to do, just report\n");
|
||||
|
@ -660,9 +663,11 @@ int main(int argc, const char * argv[]) {
|
|||
totalLength += commandLength + 1; // 1 for null termination
|
||||
}
|
||||
|
||||
// Now send this to the connected agents so they can also process these messages
|
||||
printf("rebroadcasting Z message to connected agents... agentList.broadcastToAgents()\n");
|
||||
agentList->broadcastToAgents(packetData, receivedBytes, &AGENT_TYPE_AVATAR, 1);
|
||||
if (rebroadcast) {
|
||||
// Now send this to the connected agents so they can also process these messages
|
||||
printf("rebroadcasting Z message to connected agents... agentList.broadcastToAgents()\n");
|
||||
agentList->broadcastToAgents(packetData, receivedBytes, &AGENT_TYPE_AVATAR, 1);
|
||||
}
|
||||
}
|
||||
// If we got a PACKET_HEADER_HEAD_DATA, then we're talking to an AGENT_TYPE_AVATAR, and we
|
||||
// need to make sure we have it in our agentList.
|
||||
|
|
Loading…
Reference in a new issue