From 68c600facc1230d7c790ff4c2a6a196017c868b7 Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Sun, 20 Mar 2022 20:28:26 -0700 Subject: [PATCH] Added better bug reports --- dGame/dGameMessages/GameMessages.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index 53699f4e..221a4737 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -5900,6 +5900,13 @@ void GameMessages::HandleReportBug(RakNet::BitStream* inStream, Entity* entity) body.push_back(character); } + auto character = entity->GetCharacter(); + if (character) { + body.append(GeneralUtils::ASCIIToUTF16(" charID: ")); + body.append(GeneralUtils::ASCIIToUTF16(std::to_string(character->GetID()))); + body.push_back(' '); + } + uint32_t clientVersionLength; inStream->Read(clientVersionLength); for (unsigned int k = 0; k < clientVersionLength; k++) { @@ -5915,7 +5922,19 @@ void GameMessages::HandleReportBug(RakNet::BitStream* inStream, Entity* entity) inStream->Read(character); nOtherPlayerID.push_back(character); } - + // Convert other player id from LWOOBJID to the database id. + std::istringstream iss(nOtherPlayerID); + LWOOBJID nOtherPlayerLWOOBJID; + iss >> nOtherPlayerLWOOBJID; + if (nOtherPlayerLWOOBJID != LWOOBJID_EMPTY) { + auto otherPlayer = EntityManager::Instance()->GetEntity(nOtherPlayerLWOOBJID); + if (otherPlayer) { + auto character = otherPlayer->GetCharacter(); + if (character) { + nOtherPlayerID = std::to_string(character->GetID()); + } + } + } uint32_t selectionLength; inStream->Read(selectionLength); for (unsigned int k = 0; k < selectionLength; k++) {