From 6e7dc65d5f1d6cde20d1c21321aa8a86e20b8e82 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 7 Aug 2013 22:38:01 -0700 Subject: [PATCH] hacking on not dumping voxels --- voxel-server/src/main.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/voxel-server/src/main.cpp b/voxel-server/src/main.cpp index c6a8a61ca1..7b60c6354e 100644 --- a/voxel-server/src/main.cpp +++ b/voxel-server/src/main.cpp @@ -66,6 +66,7 @@ bool shouldShowAnimationDebug = false; bool displayVoxelStats = false; bool debugVoxelReceiving = false; bool sendEnvironments = true; +bool dontDumpOnMove = false; // by default we dump on move EnvironmentData environmentData[3]; @@ -236,7 +237,10 @@ void deepestLevelVoxelDistributor(NodeList* nodeList, // if our view has changed, we need to reset these things... if (viewFrustumChanged) { - nodeData->nodeBag.deleteAll(); + if (!::dontDumpOnMove) { + printf("dumping nodeBag on move!\n"); + nodeData->nodeBag.deleteAll(); + } nodeData->map.erase(); } @@ -252,12 +256,18 @@ void deepestLevelVoxelDistributor(NodeList* nodeList, nodeData->stats.printDebugDetails(); } - // This is the start of "resending" the scene. - nodeData->nodeBag.insert(serverTree.rootNode); - // start tracking our stats bool isFullScene = (!viewFrustumChanged || !nodeData->getWantDelta()) && nodeData->getViewFrustumJustStoppedChanging(); + + // If we're starting a full scene, then definitely we want to empty the nodeBag + if (isFullScene) { + printf(">>> dumping nodeBag before fullscene!\n"); + nodeData->nodeBag.deleteAll(); + } nodeData->stats.sceneStarted(isFullScene, viewFrustumChanged, ::serverTree.rootNode, ::jurisdiction); + + // This is the start of "resending" the scene. + nodeData->nodeBag.insert(serverTree.rootNode); } // If we have something in our nodeBag, then turn them into packets and send them out... @@ -475,6 +485,15 @@ int main(int argc, const char * argv[]) { jurisdiction = new JurisdictionMap(jurisdictionRoot, jurisdictionEndNodes); } } + + // should we dump the voxels from the node bag on move? default to FALSE, we do dump + const char* DONT_DUMP_ON_MOVE = "--dontDumpOnMove"; + ::dontDumpOnMove = cmdOptionExists(argc, argv, DONT_DUMP_ON_MOVE); + if (::dontDumpOnMove) { + printf("dontDumpOnMove=TRUE we will not empty the node bag when clients move\n"); + } else { + printf("dontDumpOnMove=FALSE [default!] we will empty the node bag when clients move\n"); + } // should we send environments? Default is yes, but this command line suppresses sending const char* DONT_SEND_ENVIRONMENTS = "--dontSendEnvironments";