feat: debugger additions (#2013)

* feat: debugger additions

Add type field for links in flash
Add warning level for dangerous buttons
fix uninitialzied memory with jetpack variable
remove a bunch of duplicated position push code

tested that the ui is still functional and components with multiple physics components have all their details visible.
tested that jetpack is initialized now

* remove amf3 header

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fixes

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
David Markowitz
2026-06-24 15:18:16 -07:00
committed by GitHub
parent 5d523a1e7b
commit 35337291fa
17 changed files with 83 additions and 107 deletions

View File

@@ -4,7 +4,6 @@
#include "dCommonVars.h" #include "dCommonVars.h"
#include "Logger.h" #include "Logger.h"
#include "Game.h" #include "Game.h"
#include <type_traits> #include <type_traits>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
@@ -368,7 +367,7 @@ public:
} }
template<typename AmfType = AMFArrayValue> template<typename AmfType = AMFArrayValue>
AmfType& PushDebug(const std::string_view name) { AmfType& PushDebug(const std::string_view name, const std::string& objectType = "", const uint32_t warningLevel = 0) {
size_t i = 0; size_t i = 0;
for (; i < m_Dense.size(); i++) { for (; i < m_Dense.size(); i++) {
const auto& cast = dynamic_cast<AMFArrayValue*>(m_Dense[i].get()); const auto& cast = dynamic_cast<AMFArrayValue*>(m_Dense[i].get());
@@ -377,6 +376,14 @@ public:
const auto& nameValue = cast->Get<std::string>("name"); const auto& nameValue = cast->Get<std::string>("name");
if (!nameValue || nameValue->GetValue() != name) continue; if (!nameValue || nameValue->GetValue() != name) continue;
if (!objectType.empty()) {
cast->Insert<std::string>("type", objectType);
}
if (warningLevel != 0) {
cast->Insert<double>("warningLevel", warningLevel);
}
// found a duplicate, return this instead // found a duplicate, return this instead
auto valueCast = dynamic_cast<AmfType*>(cast->Get("value")); auto valueCast = dynamic_cast<AmfType*>(cast->Get("value"));
if (valueCast) return *valueCast; if (valueCast) return *valueCast;
@@ -384,6 +391,13 @@ public:
auto* value = PushArray(); auto* value = PushArray();
value->Insert<std::string>("name", name.data()); value->Insert<std::string>("name", name.data());
if (!objectType.empty()) {
value->Insert<std::string>("type", objectType);
}
if (warningLevel != 0) {
value->Insert<double>("warningLevel", warningLevel);
}
return value->Insert<AmfType>("value", std::make_unique<AmfType>()); return value->Insert<AmfType>("value", std::make_unique<AmfType>());
} }

View File

@@ -1019,6 +1019,7 @@ void Entity::WriteBaseReplicaData(RakNet::BitStream& outBitStream, eReplicaPacke
const bool hasParent = m_ParentEntity != nullptr || m_SpawnerID != 0; const bool hasParent = m_ParentEntity != nullptr || m_SpawnerID != 0;
outBitStream.Write(hasParent); outBitStream.Write(hasParent);
if (hasParent) { if (hasParent) {
// 触るな!
if (m_ParentEntity != nullptr) outBitStream.Write(GeneralUtils::SetBit(m_ParentEntity->GetObjectID(), static_cast<uint32_t>(eObjectBits::CLIENT))); if (m_ParentEntity != nullptr) outBitStream.Write(GeneralUtils::SetBit(m_ParentEntity->GetObjectID(), static_cast<uint32_t>(eObjectBits::CLIENT)));
else if (m_Spawner != nullptr && m_Spawner->m_Info.isNetwork) outBitStream.Write(m_SpawnerID); else if (m_Spawner != nullptr && m_Spawner->m_Info.isNetwork) outBitStream.Write(m_SpawnerID);
else outBitStream.Write(GeneralUtils::SetBit(m_SpawnerID, static_cast<uint32_t>(eObjectBits::CLIENT))); else outBitStream.Write(GeneralUtils::SetBit(m_SpawnerID, static_cast<uint32_t>(eObjectBits::CLIENT)));
@@ -2235,11 +2236,16 @@ bool Entity::MsgRequestServerObjectInfo(GameMessages::RequestServerObjectInfo& r
const auto& objTableInfo = table->GetByID(GetLOT()); const auto& objTableInfo = table->GetByID(GetLOT());
objectInfo.PushDebug<AMFStringValue>("Name") = objTableInfo.name; objectInfo.PushDebug<AMFStringValue>("Name", "name") = objTableInfo.name;
objectInfo.PushDebug<AMFIntValue>("Template ID(LOT)") = GetLOT(); objectInfo.PushDebug<AMFIntValue>("Template ID(LOT)", "LOT") = GetLOT();
objectInfo.PushDebug<AMFStringValue>("Object ID") = std::to_string(GetObjectID()); objectInfo.PushDebug<AMFStringValue>("Object ID", "LWOOBJID") = std::to_string(GetObjectID());
objectInfo.PushDebug<AMFStringValue>("Spawner's Object ID") = std::to_string(GetSpawnerID()); objectInfo.PushDebug<AMFStringValue>("Spawner's Object ID", "LWOOBJID") = std::to_string(GetSpawnerID());
objectInfo.PushDebug<AMFStringValue>("Owner override") = std::to_string(m_OwnerOverride); objectInfo.PushDebug<AMFStringValue>("Owner override", "LWOOBJID") = std::to_string(m_OwnerOverride);
auto& children = objectInfo.PushDebug("Child Objects");
int i = 1;
for (const auto* child : m_ChildEntities) {
if (child) children.PushDebug<AMFStringValue>("Child " + std::to_string(i++), "LWOOBJID") = std::to_string(child->GetObjectID());
}
auto& componentDetails = objectInfo.PushDebug("Component Information"); auto& componentDetails = objectInfo.PushDebug("Component Information");
for (const auto [id, component] : m_Components) { for (const auto [id, component] : m_Components) {

View File

@@ -864,7 +864,7 @@ bool BaseCombatAIComponent::MsgGetObjectReportInfo(GameMessages::GetObjectReport
auto& cmptType = reportInfo.info->PushDebug("Base Combat AI"); auto& cmptType = reportInfo.info->PushDebug("Base Combat AI");
cmptType.PushDebug<AMFIntValue>("Component ID") = GetComponentID(); cmptType.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
auto& targetInfo = cmptType.PushDebug("Current Target Info"); auto& targetInfo = cmptType.PushDebug("Current Target Info");
targetInfo.PushDebug<AMFStringValue>("Current Target ID") = std::to_string(m_Target); targetInfo.PushDebug<AMFStringValue>("Current Target ID", "LWOOBJID") = std::to_string(m_Target);
// if (m_Target != LWOOBJID_EMPTY) { // if (m_Target != LWOOBJID_EMPTY) {
// LWOGameMessages::ObjGetName nameMsg(m_CurrentTarget); // LWOGameMessages::ObjGetName nameMsg(m_CurrentTarget);
// SEND_GAMEOBJ_MSG(nameMsg); // SEND_GAMEOBJ_MSG(nameMsg);
@@ -905,10 +905,7 @@ bool BaseCombatAIComponent::MsgGetObjectReportInfo(GameMessages::GetObjectReport
//} //}
//cmptType.PushDebug("Current Combat Role") = curState; //cmptType.PushDebug("Current Combat Role") = curState;
auto& tetherPoint = cmptType.PushDebug("Tether Point"); cmptType.PushDebug("Tether Point").PushDebug(m_StartPosition);
tetherPoint.PushDebug<AMFDoubleValue>("X") = m_StartPosition.x;
tetherPoint.PushDebug<AMFDoubleValue>("Y") = m_StartPosition.y;
tetherPoint.PushDebug<AMFDoubleValue>("Z") = m_StartPosition.z;
cmptType.PushDebug<AMFDoubleValue>("Hard Tether Radius") = m_HardTetherRadius; cmptType.PushDebug<AMFDoubleValue>("Hard Tether Radius") = m_HardTetherRadius;
cmptType.PushDebug<AMFDoubleValue>("Soft Tether Radius") = m_SoftTetherRadius; cmptType.PushDebug<AMFDoubleValue>("Soft Tether Radius") = m_SoftTetherRadius;
cmptType.PushDebug<AMFDoubleValue>("Aggro Radius") = m_AggroRadius; cmptType.PushDebug<AMFDoubleValue>("Aggro Radius") = m_AggroRadius;

View File

@@ -361,17 +361,11 @@ void ControllablePhysicsComponent::SetStunImmunity(
bool ControllablePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) { bool ControllablePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
PhysicsComponent::OnGetObjectReportInfo(reportInfo); PhysicsComponent::OnGetObjectReportInfo(reportInfo);
auto& info = reportInfo.subCategory->PushDebug("Controllable Info"); auto& info = reportInfo.subCategory->PushDebug("Controllable Physics");
auto& vel = info.PushDebug("Velocity"); info.PushDebug("Velocity").PushDebug(m_Velocity);
vel.PushDebug<AMFDoubleValue>("x") = m_Velocity.x;
vel.PushDebug<AMFDoubleValue>("y") = m_Velocity.y;
vel.PushDebug<AMFDoubleValue>("z") = m_Velocity.z;
auto& angularVelocity = info.PushDebug("Angular Velocity"); info.PushDebug("Angular Velocity").PushDebug(m_AngularVelocity);
angularVelocity.PushDebug<AMFDoubleValue>("x") = m_AngularVelocity.x;
angularVelocity.PushDebug<AMFDoubleValue>("y") = m_AngularVelocity.y;
angularVelocity.PushDebug<AMFDoubleValue>("z") = m_AngularVelocity.z;
info.PushDebug<AMFBoolValue>("Is On Ground") = m_IsOnGround; info.PushDebug<AMFBoolValue>("Is On Ground") = m_IsOnGround;
info.PushDebug<AMFBoolValue>("Is On Rail") = m_IsOnRail; info.PushDebug<AMFBoolValue>("Is On Rail") = m_IsOnRail;
@@ -403,12 +397,13 @@ bool ControllablePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObject
info.PushDebug<AMFBoolValue>("Is In Bubble") = m_IsInBubble; info.PushDebug<AMFBoolValue>("Is In Bubble") = m_IsInBubble;
info.PushDebug<AMFStringValue>("Bubble Type") = StringifiedEnum::ToString(m_BubbleType).data(); info.PushDebug<AMFStringValue>("Bubble Type") = StringifiedEnum::ToString(m_BubbleType).data();
info.PushDebug<AMFBoolValue>("Special Anims") = m_SpecialAnims; info.PushDebug<AMFBoolValue>("Special Anims") = m_SpecialAnims;
info.PushDebug<AMFIntValue>("Immune To Stun Attack Count") = m_ImmuneToStunAttackCount; auto& immunity = info.PushDebug("Immunity Effects");
info.PushDebug<AMFIntValue>("Immune To Stun Equip Count") = m_ImmuneToStunEquipCount; immunity.PushDebug<AMFBoolValue>("Immune to Stun Move") = m_ImmuneToStunMoveCount != 0;
info.PushDebug<AMFIntValue>("Immune To Stun Interact Count") = m_ImmuneToStunInteractCount; immunity.PushDebug<AMFBoolValue>("Immune to Stun Turn") = m_ImmuneToStunTurnCount != 0;
info.PushDebug<AMFIntValue>("Immune To Stun Jump Count") = m_ImmuneToStunJumpCount; immunity.PushDebug<AMFBoolValue>("Immune to Stun Attack") = m_ImmuneToStunAttackCount != 0;
info.PushDebug<AMFIntValue>("Immune To Stun Move Count") = m_ImmuneToStunMoveCount; immunity.PushDebug<AMFBoolValue>("Immune to Stun Use Item") = m_ImmuneToStunUseItemCount != 0;
info.PushDebug<AMFIntValue>("Immune To Stun Turn Count") = m_ImmuneToStunTurnCount; immunity.PushDebug<AMFBoolValue>("Immune to Stun Equip") = m_ImmuneToStunEquipCount != 0;
info.PushDebug<AMFIntValue>("Immune To Stun UseItem Count") = m_ImmuneToStunUseItemCount; immunity.PushDebug<AMFBoolValue>("Immune to Stun Interact") = m_ImmuneToStunInteractCount != 0;
immunity.PushDebug<AMFBoolValue>("Immune to Stun Jump") = m_ImmuneToStunJumpCount != 0;
return true; return true;
} }

View File

@@ -328,7 +328,7 @@ private:
/** /**
* The effect that plays while using the jetpack * The effect that plays while using the jetpack
*/ */
int32_t m_JetpackEffectID; int32_t m_JetpackEffectID{};
/** /**
* The current speed multiplier, allowing an entity to run faster * The current speed multiplier, allowing an entity to run faster

View File

@@ -1146,7 +1146,7 @@ bool DestroyableComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportIn
destroyableInfo.PushDebug<AMFDoubleValue>("Explode Factor") = m_ExplodeFactor; destroyableInfo.PushDebug<AMFDoubleValue>("Explode Factor") = m_ExplodeFactor;
destroyableInfo.PushDebug<AMFBoolValue>("Has Threats") = m_HasThreats; destroyableInfo.PushDebug<AMFBoolValue>("Has Threats") = m_HasThreats;
destroyableInfo.PushDebug<AMFStringValue>("Killer ID") = std::to_string(m_KillerID); destroyableInfo.PushDebug<AMFStringValue>("Killer ID", "LWOOBJID") = std::to_string(m_KillerID);
// "Scripts"; idk what to do about scripts yet // "Scripts"; idk what to do about scripts yet
auto& immuneCounts = destroyableInfo.PushDebug("Immune Counts"); auto& immuneCounts = destroyableInfo.PushDebug("Immune Counts");

View File

@@ -108,7 +108,7 @@ bool GhostComponent::OnGetGMInvis(GameMessages::GetGMInvis& gmInvisMsg) {
bool GhostComponent::MsgGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportMsg) { bool GhostComponent::MsgGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportMsg) {
auto& cmptType = reportMsg.info->PushDebug("Ghost"); auto& cmptType = reportMsg.info->PushDebug("Ghost");
cmptType.PushDebug<AMFIntValue>("Component ID") = GetComponentID(); cmptType.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
cmptType.PushDebug<AMFBoolValue>("Is GM Invis") = false; cmptType.PushDebug<AMFBoolValue>("Is GM Invis") = m_IsGMInvisible;
return true; return true;
} }

View File

@@ -110,15 +110,9 @@ bool HavokVehiclePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObject
auto& info = reportInfo.subCategory->PushDebug("Havok Vehicle Physics Info"); auto& info = reportInfo.subCategory->PushDebug("Havok Vehicle Physics Info");
auto& velocity = info.PushDebug("Velocity"); auto& velocity = info.PushDebug("Velocity").PushDebug(m_Velocity);
velocity.PushDebug<AMFDoubleValue>("x") = m_Velocity.x;
velocity.PushDebug<AMFDoubleValue>("y") = m_Velocity.y;
velocity.PushDebug<AMFDoubleValue>("z") = m_Velocity.z;
auto& angularVelocity = info.PushDebug("Angular Velocity"); auto& angularVelocity = info.PushDebug("Angular Velocity").PushDebug(m_AngularVelocity);
angularVelocity.PushDebug<AMFDoubleValue>("x") = m_AngularVelocity.x;
angularVelocity.PushDebug<AMFDoubleValue>("y") = m_AngularVelocity.y;
angularVelocity.PushDebug<AMFDoubleValue>("z") = m_AngularVelocity.z;
info.PushDebug<AMFBoolValue>("Is On Ground") = m_IsOnGround; info.PushDebug<AMFBoolValue>("Is On Ground") = m_IsOnGround;
info.PushDebug<AMFBoolValue>("Is On Rail") = m_IsOnRail; info.PushDebug<AMFBoolValue>("Is On Rail") = m_IsOnRail;

View File

@@ -1860,9 +1860,9 @@ bool InventoryComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo
std::stringstream ss; std::stringstream ss;
ss << "%[Objects_" << item->GetLot() << "_name] Slot " << item->GetSlot(); ss << "%[Objects_" << item->GetLot() << "_name] Slot " << item->GetSlot();
auto& slot = curInv.PushDebug(ss.str()); auto& slot = curInv.PushDebug(ss.str());
slot.PushDebug<AMFStringValue>("Object ID") = std::to_string(item->GetId()); slot.PushDebug<AMFStringValue>("Object ID", "LWOOBJID") = std::to_string(item->GetId());
slot.PushDebug<AMFIntValue>("LOT") = item->GetLot(); slot.PushDebug<AMFIntValue>("LOT", "LOT") = item->GetLot();
if (item->GetSubKey() != LWOOBJID_EMPTY) slot.PushDebug<AMFStringValue>("Subkey") = std::to_string(item->GetSubKey()); if (item->GetSubKey() != LWOOBJID_EMPTY) slot.PushDebug<AMFStringValue>("Subkey", "LWOOBJID") = std::to_string(item->GetSubKey());
slot.PushDebug<AMFIntValue>("Count") = item->GetCount(); slot.PushDebug<AMFIntValue>("Count") = item->GetCount();
slot.PushDebug<AMFIntValue>("Slot") = item->GetSlot(); slot.PushDebug<AMFIntValue>("Slot") = item->GetSlot();
slot.PushDebug<AMFBoolValue>("Bind on pickup") = item->GetInfo().isBOP; slot.PushDebug<AMFBoolValue>("Bind on pickup") = item->GetInfo().isBOP;
@@ -1881,7 +1881,8 @@ bool InventoryComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo
ss << "%[Objects_" << info.lot << "_name]"; ss << "%[Objects_" << info.lot << "_name]";
auto& equipSlot = equipped.PushDebug(ss.str()); auto& equipSlot = equipped.PushDebug(ss.str());
equipSlot.PushDebug<AMFStringValue>("Location") = location; equipSlot.PushDebug<AMFStringValue>("Location") = location;
equipSlot.PushDebug<AMFStringValue>("Object ID") = std::to_string(info.id); equipSlot.PushDebug<AMFStringValue>("Object ID", "LWOOBJID") = std::to_string(info.id);
equipSlot.PushDebug<AMFIntValue>("LOT", "LOT") = info.lot;
equipSlot.PushDebug<AMFIntValue>("Slot") = info.slot; equipSlot.PushDebug<AMFIntValue>("Slot") = info.slot;
equipSlot.PushDebug<AMFIntValue>("Count") = info.count; equipSlot.PushDebug<AMFIntValue>("Count") = info.count;
auto& extra = equipSlot.PushDebug("Extra Info"); auto& extra = equipSlot.PushDebug("Extra Info");

View File

@@ -652,7 +652,7 @@ void PushMissions(const std::map<uint32_t, Mission*>& missions, AMFArrayValue& V
} }
bool MissionComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) { bool MissionComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
auto& missionInfo = reportInfo.info->PushDebug("Mission (Laggy)"); auto& missionInfo = reportInfo.info->PushDebug("Mission (Laggy)", "", 1);
missionInfo.PushDebug<AMFIntValue>("Component ID") = GetComponentID(); missionInfo.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
// Sort the missions so they are easier to parse and present to the end user // Sort the missions so they are easier to parse and present to the end user
std::map<uint32_t, Mission*> achievements; std::map<uint32_t, Mission*> achievements;

View File

@@ -355,8 +355,8 @@ bool ModelComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& re
cmptInfo.PushDebug<AMFStringValue>("Name") = "Objects_" + std::to_string(m_Parent->GetLOT()) + "_name"; cmptInfo.PushDebug<AMFStringValue>("Name") = "Objects_" + std::to_string(m_Parent->GetLOT()) + "_name";
cmptInfo.PushDebug<AMFBoolValue>("Has Unique Name") = false; cmptInfo.PushDebug<AMFBoolValue>("Has Unique Name") = false;
cmptInfo.PushDebug<AMFStringValue>("UGID (from item)") = std::to_string(m_userModelID); cmptInfo.PushDebug<AMFStringValue>("UGID (from item)", "LWOOBJID") = std::to_string(m_userModelID);
cmptInfo.PushDebug<AMFStringValue>("UGID") = std::to_string(m_userModelID); cmptInfo.PushDebug<AMFStringValue>("UGID", "LWOOBJID") = std::to_string(m_userModelID);
cmptInfo.PushDebug<AMFStringValue>("Description") = ""; cmptInfo.PushDebug<AMFStringValue>("Description") = "";
cmptInfo.PushDebug<AMFIntValue>("Behavior Count") = m_Behaviors.size(); cmptInfo.PushDebug<AMFIntValue>("Behavior Count") = m_Behaviors.size();

View File

@@ -535,20 +535,14 @@ bool MovementAIComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInf
movementInfo.PushDebug<AMFDoubleValue>("Pulling To Point") = m_PullingToPoint; movementInfo.PushDebug<AMFDoubleValue>("Pulling To Point") = m_PullingToPoint;
movementInfo.PushDebug<AMFBoolValue>("At Final Waypoint") = m_AtFinalWaypoint; movementInfo.PushDebug<AMFBoolValue>("At Final Waypoint") = m_AtFinalWaypoint;
auto& pullPointInfo = movementInfo.PushDebug("Pull Point"); auto& pullPointInfo = movementInfo.PushDebug("Pull Point").PushDebug(m_PullPoint);
pullPointInfo.PushDebug<AMFDoubleValue>("X") = m_PullPoint.x;
pullPointInfo.PushDebug<AMFDoubleValue>("Y") = m_PullPoint.y;
pullPointInfo.PushDebug<AMFDoubleValue>("Z") = m_PullPoint.z;
// movementInfo.PushDebug<AMFDoubleValue>("Delay") = m_Delay; // movementInfo.PushDebug<AMFDoubleValue>("Delay") = m_Delay;
auto& waypoints = movementInfo.PushDebug("Interpolated Waypoints"); auto& waypoints = movementInfo.PushDebug("Interpolated Waypoints");
int i = 0; int i = 0;
for (const auto& point : m_InterpolatedWaypoints) { for (const auto& point : m_InterpolatedWaypoints) {
auto& waypoint = waypoints.PushDebug("Waypoint " + std::to_string(++i)); waypoints.PushDebug("Waypoint " + std::to_string(++i)).PushDebug(point);
waypoint.PushDebug<AMFDoubleValue>("X") = point.x;
waypoint.PushDebug<AMFDoubleValue>("Y") = point.y;
waypoint.PushDebug<AMFDoubleValue>("Z") = point.z;
} }
i = 0; i = 0;
@@ -556,10 +550,7 @@ bool MovementAIComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInf
auto pathCopy = m_CurrentPath; // Copy to avoid modifying the original stack auto pathCopy = m_CurrentPath; // Copy to avoid modifying the original stack
while (!pathCopy.empty()) { while (!pathCopy.empty()) {
const auto& waypoint = pathCopy.top(); const auto& waypoint = pathCopy.top();
auto& pathWaypoint = currentPath.PushDebug("Waypoint " + std::to_string(++i)); currentPath.PushDebug("Waypoint " + std::to_string(++i)).PushDebug(waypoint.position);
pathWaypoint.PushDebug<AMFDoubleValue>("X") = waypoint.position.x;
pathWaypoint.PushDebug<AMFDoubleValue>("Y") = waypoint.position.y;
pathWaypoint.PushDebug<AMFDoubleValue>("Z") = waypoint.position.z;
pathCopy.pop(); pathCopy.pop();
} }

View File

@@ -238,10 +238,7 @@ bool PhantomPhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectRepor
info.PushDebug<AMFIntValue>("Effect Type") = static_cast<int>(m_EffectType); info.PushDebug<AMFIntValue>("Effect Type") = static_cast<int>(m_EffectType);
info.PushDebug<AMFDoubleValue>("Directional Multiplier") = m_DirectionalMultiplier; info.PushDebug<AMFDoubleValue>("Directional Multiplier") = m_DirectionalMultiplier;
info.PushDebug<AMFBoolValue>("Is Directional") = m_IsDirectional; info.PushDebug<AMFBoolValue>("Is Directional") = m_IsDirectional;
auto& direction = info.PushDebug("Direction"); auto& direction = info.PushDebug("Direction").PushDebug(m_Direction);
direction.PushDebug<AMFDoubleValue>("x") = m_Direction.x;
direction.PushDebug<AMFDoubleValue>("y") = m_Direction.y;
direction.PushDebug<AMFDoubleValue>("z") = m_Direction.z;
if (m_MinMax) { if (m_MinMax) {
auto& minMaxInfo = info.PushDebug("Min Max Info"); auto& minMaxInfo = info.PushDebug("Min Max Info");
@@ -252,15 +249,8 @@ bool PhantomPhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectRepor
if (m_IsRespawnVolume) { if (m_IsRespawnVolume) {
auto& respawnInfo = info.PushDebug("Respawn Info"); auto& respawnInfo = info.PushDebug("Respawn Info");
respawnInfo.PushDebug<AMFBoolValue>("Is Respawn Volume") = m_IsRespawnVolume; respawnInfo.PushDebug<AMFBoolValue>("Is Respawn Volume") = m_IsRespawnVolume;
auto& respawnPos = respawnInfo.PushDebug("Respawn Position"); respawnInfo.PushDebug("Respawn Position").PushDebug(m_RespawnPos);
respawnPos.PushDebug<AMFDoubleValue>("x") = m_RespawnPos.x; respawnInfo.PushDebug("Respawn Rotation").PushDebug(m_RespawnRot);
respawnPos.PushDebug<AMFDoubleValue>("y") = m_RespawnPos.y;
respawnPos.PushDebug<AMFDoubleValue>("z") = m_RespawnPos.z;
auto& respawnRot = respawnInfo.PushDebug("Respawn Rotation");
respawnRot.PushDebug<AMFDoubleValue>("w") = m_RespawnRot.w;
respawnRot.PushDebug<AMFDoubleValue>("x") = m_RespawnRot.x;
respawnRot.PushDebug<AMFDoubleValue>("y") = m_RespawnRot.y;
respawnRot.PushDebug<AMFDoubleValue>("z") = m_RespawnRot.z;
} }
return true; return true;

View File

@@ -249,18 +249,11 @@ bool PhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo&
auto& info = reportInfo.info->PushDebug("Physics"); auto& info = reportInfo.info->PushDebug("Physics");
reportInfo.subCategory = &info; reportInfo.subCategory = &info;
auto& pos = info.PushDebug("Position"); auto& pos = info.PushDebug("Position").PushDebug(m_Position);
pos.PushDebug<AMFDoubleValue>("x") = m_Position.x;
pos.PushDebug<AMFDoubleValue>("y") = m_Position.y;
pos.PushDebug<AMFDoubleValue>("z") = m_Position.z;
auto& rot = info.PushDebug("Rotation"); auto& rot = info.PushDebug("Rotation").PushDebug(m_Rotation);
rot.PushDebug<AMFDoubleValue>("w") = m_Rotation.w;
rot.PushDebug<AMFDoubleValue>("x") = m_Rotation.x;
rot.PushDebug<AMFDoubleValue>("y") = m_Rotation.y;
rot.PushDebug<AMFDoubleValue>("z") = m_Rotation.z;
info.PushDebug<AMFIntValue>("CollisionGroup") = m_CollisionGroup; info.PushDebug<AMFIntValue>("Collision Group") = m_CollisionGroup;
return true; return true;
} }

View File

@@ -80,8 +80,9 @@ bool ProximityMonitorComponent::OnGetObjectReportInfo(GameMessages::GetObjectRep
proxAmf.PushDebug("Position").PushDebug(entity->GetPosition()); proxAmf.PushDebug("Position").PushDebug(entity->GetPosition());
proxAmf.PushDebug("Rotation").PushDebug(entity->GetRotation()); proxAmf.PushDebug("Rotation").PushDebug(entity->GetRotation());
auto& collidingAmf = proxAmf.PushDebug("Colliding Objects"); auto& collidingAmf = proxAmf.PushDebug("Colliding Objects");
int i = 1;
for (const auto& colliding : entity->GetCurrentlyCollidingObjects()) { for (const auto& colliding : entity->GetCurrentlyCollidingObjects()) {
collidingAmf.PushDebug(std::to_string(colliding)); collidingAmf.PushDebug<AMFStringValue>(std::to_string(i++), "LWOOBJID") = std::to_string(colliding);
} }
} }

View File

@@ -576,25 +576,25 @@ bool QuickBuildComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInf
auto& quickbuild = reportInfo.info->PushDebug("Quick Build"); auto& quickbuild = reportInfo.info->PushDebug("Quick Build");
quickbuild.PushDebug<AMFStringValue>("State") = StringifiedEnum::ToString(m_State).data(); quickbuild.PushDebug<AMFStringValue>("State") = StringifiedEnum::ToString(m_State).data();
quickbuild.PushDebug<AMFDoubleValue>("Timer") = m_Timer; quickbuild.PushDebug<AMFDoubleValue>("Timer") = m_Timer;
quickbuild.PushDebug<AMFDoubleValue>("TimerIncomplete") = m_TimerIncomplete; quickbuild.PushDebug<AMFDoubleValue>("Timer Incomplete") = m_TimerIncomplete;
quickbuild.PushDebug("ActivatorPosition").PushDebug(m_ActivatorPosition); quickbuild.PushDebug("Activator Position").PushDebug(m_ActivatorPosition);
quickbuild.PushDebug<AMFStringValue>("ActivatorId") = std::to_string(m_ActivatorId); quickbuild.PushDebug<AMFStringValue>("Activator ID", "LWOOBJID") = std::to_string(m_ActivatorId);
quickbuild.PushDebug<AMFBoolValue>("ShowResetEffect") = m_ShowResetEffect; quickbuild.PushDebug<AMFBoolValue>("Show Reset Effect") = m_ShowResetEffect;
quickbuild.PushDebug<AMFDoubleValue>("Taken") = m_Taken; quickbuild.PushDebug<AMFDoubleValue>("Taken") = m_Taken;
quickbuild.PushDebug<AMFDoubleValue>("ResetTime") = m_ResetTime; quickbuild.PushDebug<AMFDoubleValue>("Reset Time") = m_ResetTime;
quickbuild.PushDebug<AMFDoubleValue>("CompleteTime") = m_CompleteTime; quickbuild.PushDebug<AMFDoubleValue>("Complete Time") = m_CompleteTime;
quickbuild.PushDebug<AMFIntValue>("TakeImagination") = m_TakeImagination; quickbuild.PushDebug<AMFIntValue>("Take Imagination") = m_TakeImagination;
quickbuild.PushDebug<AMFBoolValue>("Interruptible") = m_Interruptible; quickbuild.PushDebug<AMFBoolValue>("Interruptible") = m_Interruptible;
quickbuild.PushDebug<AMFBoolValue>("SelfActivator") = m_SelfActivator; quickbuild.PushDebug<AMFBoolValue>("Self Activator") = m_SelfActivator;
auto& modules = quickbuild.PushDebug("CustomModules"); auto& modules = quickbuild.PushDebug("Custom Modules");
for (const auto cmodule : m_CustomModules) modules.PushDebug<AMFIntValue>("Module") = cmodule; for (const auto cmodule : m_CustomModules) modules.PushDebug<AMFIntValue>("Module") = cmodule;
quickbuild.PushDebug<AMFIntValue>("ActivityId") = m_ActivityId; quickbuild.PushDebug<AMFIntValue>("Activity Id") = m_ActivityId;
quickbuild.PushDebug<AMFIntValue>("PostImaginationCost") = m_PostImaginationCost; quickbuild.PushDebug<AMFIntValue>("Post Imagination Cost") = m_PostImaginationCost;
quickbuild.PushDebug<AMFDoubleValue>("TimeBeforeSmash") = m_TimeBeforeSmash; quickbuild.PushDebug<AMFDoubleValue>("Time Before Smash") = m_TimeBeforeSmash;
quickbuild.PushDebug<AMFDoubleValue>("TimeBeforeDrain") = m_TimeBeforeDrain; quickbuild.PushDebug<AMFDoubleValue>("Time Before Drain") = m_TimeBeforeDrain;
quickbuild.PushDebug<AMFIntValue>("DrainedImagination") = m_DrainedImagination; quickbuild.PushDebug<AMFIntValue>("Drained Imagination") = m_DrainedImagination;
quickbuild.PushDebug<AMFBoolValue>("RepositionPlayer") = m_RepositionPlayer; quickbuild.PushDebug<AMFBoolValue>("Reposition Player") = m_RepositionPlayer;
quickbuild.PushDebug<AMFDoubleValue>("SoftTimer") = m_SoftTimer; quickbuild.PushDebug<AMFDoubleValue>("Soft Timer") = m_SoftTimer;
quickbuild.PushDebug<AMFStringValue>("Builder") = std::to_string(m_Builder); quickbuild.PushDebug<AMFStringValue>("Builder", "LWOOBJID") = std::to_string(m_Builder);
return true; return true;
} }

View File

@@ -79,14 +79,8 @@ void SimplePhysicsComponent::SetPhysicsMotionState(uint32_t value) {
bool SimplePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) { bool SimplePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
PhysicsComponent::OnGetObjectReportInfo(reportInfo); PhysicsComponent::OnGetObjectReportInfo(reportInfo);
auto& info = reportInfo.subCategory->PushDebug("Simple Physics Info"); auto& info = reportInfo.subCategory->PushDebug("Simple Physics Info");
auto& velocity = info.PushDebug("Velocity"); info.PushDebug("Velocity").PushDebug(m_Velocity);
velocity.PushDebug<AMFDoubleValue>("x") = m_Velocity.x; info.PushDebug("Angular Velocity").PushDebug(m_AngularVelocity);
velocity.PushDebug<AMFDoubleValue>("y") = m_Velocity.y;
velocity.PushDebug<AMFDoubleValue>("z") = m_Velocity.z;
auto& angularVelocity = info.PushDebug("Angular Velocity");
angularVelocity.PushDebug<AMFDoubleValue>("x") = m_AngularVelocity.x;
angularVelocity.PushDebug<AMFDoubleValue>("y") = m_AngularVelocity.y;
angularVelocity.PushDebug<AMFDoubleValue>("z") = m_AngularVelocity.z;
info.PushDebug<AMFIntValue>("Physics Motion State") = m_PhysicsMotionState; info.PushDebug<AMFIntValue>("Physics Motion State") = m_PhysicsMotionState;
info.PushDebug<AMFStringValue>("Climbable Type") = StringifiedEnum::ToString(m_ClimbableType).data(); info.PushDebug<AMFStringValue>("Climbable Type") = StringifiedEnum::ToString(m_ClimbableType).data();
return true; return true;