Added enum for rejection statuses

This commit is contained in:
EmosewaMC 2022-03-30 16:14:24 -07:00
parent 04852ac1d9
commit 0bf2f0e92a
2 changed files with 16 additions and 9 deletions

View File

@ -64,17 +64,18 @@ void GameMessages::PropertyDataMessage::Serialize(RakNet::BitStream& stream) con
stream.Write<uint64_t>(0);
if (rejectionReason != "") stream.Write<uint32_t>(2);
else if (moderatorRequested == true && rejectionReason == "") stream.Write<uint32_t>(0);
else stream.Write<uint32_t>(1);
if (rejectionReason != "") stream.Write<uint32_t>(REJECTION_STATUS_REJECTED);
else if (moderatorRequested == true && rejectionReason == "") stream.Write<uint32_t>(REJECTION_STATUS_PENDING);
else stream.Write<uint32_t>(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<uint32_t>(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<uint32_t>(0);
stream.Write<uint64_t>(0);

View File

@ -40,5 +40,11 @@ namespace GameMessages
char PrivacyOption = 0;
float MaxBuildHeight = 128.0f;
std::vector<NiPoint3> Paths = {};
private:
enum RejectionStatus : uint32_t {
REJECTION_STATUS_APPROVED = 0,
REJECTION_STATUS_PENDING = 1,
REJECTION_STATUS_REJECTED = 2
};
};
}