From ba5480e17626a6332fbc8fe58cecc2217fb6af75 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Fri, 2 Aug 2013 15:38:50 -0700 Subject: [PATCH] added command line options for jurisdiction settings --- voxel-server/src/main.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/voxel-server/src/main.cpp b/voxel-server/src/main.cpp index 329e8d803c..5d7489135a 100644 --- a/voxel-server/src/main.cpp +++ b/voxel-server/src/main.cpp @@ -456,11 +456,22 @@ int main(int argc, const char * argv[]) { printf("about to readFromFile().... jurisdictionFile=%s\n", jurisdictionFile); jurisdiction = new JurisdictionMap(jurisdictionFile); printf("after readFromFile().... jurisdictionFile=%s\n", jurisdictionFile); + } else { + const char* JURISDICTION_ROOT = "--jurisdictionRoot"; + const char* jurisdictionRoot = getCmdOption(argc, argv, JURISDICTION_ROOT); + if (jurisdictionRoot) { + printf("jurisdictionRoot=%s\n", jurisdictionRoot); + } - // test writing the file... - printf("about to writeToFile().... jurisdictionFile=%s\n", jurisdictionFile); - jurisdiction->writeToFile(jurisdictionFile); - printf("after writeToFile().... jurisdictionFile=%s\n", jurisdictionFile); + const char* JURISDICTION_ENDNODES = "--jurisdictionEndNodes"; + const char* jurisdictionEndNodes = getCmdOption(argc, argv, JURISDICTION_ENDNODES); + if (jurisdictionEndNodes) { + printf("jurisdictionEndNodes=%s\n", jurisdictionEndNodes); + } + + if (jurisdictionRoot || jurisdictionEndNodes) { + jurisdiction = new JurisdictionMap(jurisdictionRoot, jurisdictionEndNodes); + } } NodeList* nodeList = NodeList::createInstance(NODE_TYPE_VOXEL_SERVER, listenPort);