feat: debug features and implement ObjectDebugger (#1846)

Move the -s and base features of inspect to the object debugger (this file is present in an unmodified, live client)
This commit is contained in:
David Markowitz
2025-07-19 03:11:32 -07:00
committed by GitHub
parent 71f708f1b5
commit 6b52cf67a0
10 changed files with 96 additions and 58 deletions

View File

@@ -1,5 +1,7 @@
#include "DEVGMCommands.h"
#include <ranges>
// Classes
#include "AssetManager.h"
#include "Character.h"
@@ -48,6 +50,7 @@
#include "MessageType/Master.h"
#include "eInventoryType.h"
#include "ePlayerFlag.h"
#include "StringifiedEnum.h"
namespace DEVGMCommands {
@@ -1514,7 +1517,12 @@ namespace DEVGMCommands {
}
if (!closest) return;
LOG("%llu", closest->GetObjectID());
GameMessages::RequestServerObjectInfo objectInfo;
objectInfo.bVerbose = true;
objectInfo.target = closest->GetObjectID();
objectInfo.targetForReport = entity->GetObjectID();
closest->HandleMsg(objectInfo);
Game::entityManager->SerializeEntity(closest);
@@ -1528,16 +1536,6 @@ namespace DEVGMCommands {
ChatPackets::SendSystemMessage(sysAddr, GeneralUtils::ASCIIToUTF16(header.str()));
for (const auto& pair : closest->GetComponents()) {
auto id = pair.first;
std::stringstream stream;
stream << "Component [" << std::to_string(static_cast<uint32_t>(id)) << "]";
ChatPackets::SendSystemMessage(sysAddr, GeneralUtils::ASCIIToUTF16(stream.str()));
}
if (splitArgs.size() >= 2) {
if (splitArgs[1] == "-m" && splitArgs.size() >= 3) {
auto* const movingPlatformComponent = closest->GetComponent<MovingPlatformComponent>();
@@ -1557,13 +1555,6 @@ namespace DEVGMCommands {
Game::entityManager->SerializeEntity(closest);
} else if (splitArgs[1] == "-a" && splitArgs.size() >= 3) {
RenderComponent::PlayAnimation(closest, splitArgs.at(2));
} else if (splitArgs[1] == "-s") {
for (auto* entry : closest->GetSettings()) {
ChatPackets::SendSystemMessage(sysAddr, GeneralUtils::UTF8ToUTF16(entry->GetString()));
}
ChatPackets::SendSystemMessage(sysAddr, u"------");
ChatPackets::SendSystemMessage(sysAddr, u"Spawner ID: " + GeneralUtils::to_u16string(closest->GetSpawnerID()));
} else if (splitArgs[1] == "-p") {
const auto postion = closest->GetPosition();