mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
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:
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user