mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-13 02:48:19 +00:00
feat: model debug (#1907)
This commit is contained in:
@@ -24,6 +24,7 @@ ModelComponent::ModelComponent(Entity* parent, const int32_t componentID) : Comp
|
||||
m_userModelID = m_Parent->GetVarAs<LWOOBJID>(u"userModelID");
|
||||
RegisterMsg<RequestUse>(this, &ModelComponent::OnRequestUse);
|
||||
RegisterMsg<ResetModelToDefaults>(this, &ModelComponent::OnResetModelToDefaults);
|
||||
RegisterMsg<GetObjectReportInfo>(this, &ModelComponent::OnGetObjectReportInfo);
|
||||
}
|
||||
|
||||
bool ModelComponent::OnResetModelToDefaults(GameMessages::GameMsg& msg) {
|
||||
@@ -338,3 +339,19 @@ void ModelComponent::RemoveAttack() {
|
||||
set.Send();
|
||||
}
|
||||
}
|
||||
|
||||
bool ModelComponent::OnGetObjectReportInfo(GameMessages::GameMsg& msg) {
|
||||
auto& reportMsg = static_cast<GameMessages::GetObjectReportInfo&>(msg);
|
||||
if (!reportMsg.info) return false;
|
||||
auto& cmptInfo = reportMsg.info->PushDebug("Model Behaviors (Mutable)");
|
||||
cmptInfo.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
|
||||
|
||||
cmptInfo.PushDebug<AMFStringValue>("Name") = "Objects_" + std::to_string(m_Parent->GetLOT()) + "_name";
|
||||
cmptInfo.PushDebug<AMFBoolValue>("Has Unique Name") = false;
|
||||
cmptInfo.PushDebug<AMFStringValue>("UGID (from item)") = std::to_string(m_userModelID);
|
||||
cmptInfo.PushDebug<AMFStringValue>("UGID") = std::to_string(m_userModelID);
|
||||
cmptInfo.PushDebug<AMFStringValue>("Description") = "";
|
||||
cmptInfo.PushDebug<AMFIntValue>("Behavior Count") = m_Behaviors.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@ public:
|
||||
|
||||
bool OnRequestUse(GameMessages::GameMsg& msg);
|
||||
bool OnResetModelToDefaults(GameMessages::GameMsg& msg);
|
||||
bool OnGetObjectReportInfo(GameMessages::GameMsg& msg);
|
||||
|
||||
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
||||
|
||||
|
Reference in New Issue
Block a user