From 0bf2f0e92abffe661992bb634c4a491b4db5b303 Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:14:24 -0700 Subject: [PATCH] Added enum for rejection statuses --- dGame/dGameMessages/PropertyDataMessage.cpp | 19 ++++++++++--------- dGame/dGameMessages/PropertyDataMessage.h | 6 ++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/dGame/dGameMessages/PropertyDataMessage.cpp b/dGame/dGameMessages/PropertyDataMessage.cpp index 9a261a65..d763399d 100644 --- a/dGame/dGameMessages/PropertyDataMessage.cpp +++ b/dGame/dGameMessages/PropertyDataMessage.cpp @@ -64,17 +64,18 @@ void GameMessages::PropertyDataMessage::Serialize(RakNet::BitStream& stream) con stream.Write(0); - if (rejectionReason != "") stream.Write(2); - else if (moderatorRequested == true && rejectionReason == "") stream.Write(0); - else stream.Write(1); + if (rejectionReason != "") stream.Write(REJECTION_STATUS_REJECTED); + else if (moderatorRequested == true && rejectionReason == "") stream.Write(REJECTION_STATUS_PENDING); + else stream.Write(REJECTION_STATUS_APPROVED); // Does this go here??? - // const auto& rejectionReasonConverted = GeneralUtils::ASCIIToUTF16(rejectionReason); - // stream.Write(uint32_t(rejectionReasonConverted.size())); - // for (uint32_t i = 0; i < rejectionReasonConverted.size(); ++i) { - // stream.Write(uint16_t(rejectionReasonConverted[i])); - // } - stream.Write(0); + const auto& rejectionReasonConverted = GeneralUtils::ASCIIToUTF16(rejectionReason); + stream.Write(uint32_t(rejectionReasonConverted.size())); + for (uint32_t i = 0; i < rejectionReasonConverted.size(); ++i) { + stream.Write(uint16_t(rejectionReasonConverted[i])); + } + + // stream.Write(0); stream.Write(0); diff --git a/dGame/dGameMessages/PropertyDataMessage.h b/dGame/dGameMessages/PropertyDataMessage.h index a85702c4..5b5d7d0f 100644 --- a/dGame/dGameMessages/PropertyDataMessage.h +++ b/dGame/dGameMessages/PropertyDataMessage.h @@ -40,5 +40,11 @@ namespace GameMessages char PrivacyOption = 0; float MaxBuildHeight = 128.0f; std::vector Paths = {}; + private: + enum RejectionStatus : uint32_t { + REJECTION_STATUS_APPROVED = 0, + REJECTION_STATUS_PENDING = 1, + REJECTION_STATUS_REJECTED = 2 + }; }; } \ No newline at end of file