From 856fd396ba6378669c73f4b65ccc353a1a1fed89 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Fri, 30 Sep 2016 05:54:59 +0000 Subject: [PATCH] was missing a couple breaks - she's fixed --- .../CentralServer/src/shared/CentralServer.cpp | 3 +++ .../include/public/sharedFoundation/CrcConstexpr.hpp | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/server/application/CentralServer/src/shared/CentralServer.cpp b/engine/server/application/CentralServer/src/shared/CentralServer.cpp index 30e6d470..6ec9aead 100755 --- a/engine/server/application/CentralServer/src/shared/CentralServer.cpp +++ b/engine/server/application/CentralServer/src/shared/CentralServer.cpp @@ -1057,6 +1057,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons launchCommoditiesServer(); launchStartingPlanetServers(); + break; } case constcrc("RequestChunkMessage") : { @@ -1082,6 +1083,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons //@todo: figure out some way to handle this (such as forwarding to PlanetServers), or remove every case where it's sent //forceUnload(t.getId(),t.getPermaDelete()); + break; } //Character Creation Messages case constcrc("ConnectionCreateCharacter") : { @@ -1195,6 +1197,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons else { DEBUG_REPORT_LOG(true, ("Could not send name lock response to client because unable to determine which connection server to use.\n")); } + break; } case constcrc("RequestOIDsMessage") : { DEBUG_REPORT_LOG(true, ("Got RequestOIDsMessage.\n")); diff --git a/engine/shared/library/sharedFoundation/include/public/sharedFoundation/CrcConstexpr.hpp b/engine/shared/library/sharedFoundation/include/public/sharedFoundation/CrcConstexpr.hpp index 33c1f75a..d70fed60 100644 --- a/engine/shared/library/sharedFoundation/include/public/sharedFoundation/CrcConstexpr.hpp +++ b/engine/shared/library/sharedFoundation/include/public/sharedFoundation/CrcConstexpr.hpp @@ -50,19 +50,19 @@ constexpr static const uint32 crctable[256] = 0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4 }; -// ====================================================================== +constexpr uint32 CRC_INIT = 0xFFFFFFFF; constexpr const uint32 constcrc(const char *string) { - uint32 crc = 0xFFFFFFFF; + uint32 crc = 0; if (!string) return 0; - for (; *string; ++string) + for (crc = CRC_INIT; *string; ++string) crc = crctable[((crc>>24) ^ static_cast(*string)) & 0xFF] ^ (crc << 8); - return (crc ^ 0xFFFFFFFF); + return (crc ^ CRC_INIT); } // ======================================================================