From c2ebd6fc9596b362b516c7bea137a01b252db724 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 22 May 2013 14:23:27 -0700 Subject: [PATCH] CR feedback --- libraries/shared/src/PacketHeaders.h | 6 ++++++ voxel-server/src/main.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libraries/shared/src/PacketHeaders.h b/libraries/shared/src/PacketHeaders.h index 39f81bf651..850eced59b 100644 --- a/libraries/shared/src/PacketHeaders.h +++ b/libraries/shared/src/PacketHeaders.h @@ -33,4 +33,10 @@ const PACKET_HEADER PACKET_HEADER_ENVIRONMENT_DATA = 'e'; const PACKET_HEADER PACKET_HEADER_DOMAIN_LIST_REQUEST = 'L'; const PACKET_HEADER PACKET_HEADER_DOMAIN_RFD = 'C'; + +// These are supported Z-Command +#define ERASE_ALL_COMMAND "erase all" +#define ADD_SCENE_COMMAND "add scene" +#define TEST_COMMAND "a message" + #endif diff --git a/voxel-server/src/main.cpp b/voxel-server/src/main.cpp index f5ee3c6e27..f4c05e1c31 100644 --- a/voxel-server/src/main.cpp +++ b/voxel-server/src/main.cpp @@ -594,9 +594,9 @@ int main(int argc, const char * argv[]) { printf("insert voxels - wantColorRandomizer=%s NEW r=%d,g=%d,b=%d \n", (::wantColorRandomizer?"yes":"no"),red,green,blue); } - voxelData[voxelCodeSize + 0]=red; - voxelData[voxelCodeSize + 1]=green; - voxelData[voxelCodeSize + 2]=blue; + voxelData[voxelCodeSize + 0] = red; + voxelData[voxelCodeSize + 1] = green; + voxelData[voxelCodeSize + 2] = blue; if (::shouldShowAnimationDebug) { float* vertices = firstVertexForCode(voxelData); @@ -628,16 +628,16 @@ int main(int argc, const char * argv[]) { printf("got Z message len(%ld)= %s\n", receivedBytes, command); while (totalLength <= receivedBytes) { - if (strcmp(command, (char*)"erase all") == 0) { + if (strcmp(command, ERASE_ALL_COMMAND) == 0) { printf("got Z message == erase all\n"); eraseVoxelTreeAndCleanupAgentVisitData(); } - if (strcmp(command, (char*)"add scene") == 0) { + if (strcmp(command, ADD_SCENE_COMMAND) == 0) { printf("got Z message == add scene\n"); addSphereScene(&randomTree); } - if (strcmp(command, (char*)"a message") == 0) { + if (strcmp(command, TEST_COMMAND) == 0) { printf("got Z message == a message, nothing to do, just report\n"); } totalLength += commandLength + 1; // 1 for null termination