feat: Abstract Logger and simplify code (#1207)

* Logger: Rename logger to Logger from dLogger

* Logger: Add compile time filename

Fix include issues
Add writers
Add macros
Add macro to force compilation

* Logger: Replace calls with macros

Allows for filename and line number to be logged

* Logger: Add comments

and remove extra define

Logger: Replace with unique_ptr

also flush console at exit. regular file writer should be flushed on file close.

Logger: Remove constexpr on variable

* Logger: Simplify code

* Update Logger.cpp
This commit is contained in:
David Markowitz
2023-10-21 16:31:55 -07:00
committed by GitHub
parent 131239538b
commit 5942182486
160 changed files with 1013 additions and 985 deletions

View File

@@ -540,7 +540,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
auto* entity = Game::entityManager->GetEntity(target);
if (entity == nullptr) {
Game::logger->Log("BaseCombatAIComponent", "Invalid entity for checking validity (%llu)!", target);
LOG("Invalid entity for checking validity (%llu)!", target);
return false;
}
@@ -554,7 +554,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
auto* referenceDestroyable = m_Parent->GetComponent<DestroyableComponent>();
if (referenceDestroyable == nullptr) {
Game::logger->Log("BaseCombatAIComponent", "Invalid reference destroyable component on (%llu)!", m_Parent->GetObjectID());
LOG("Invalid reference destroyable component on (%llu)!", m_Parent->GetObjectID());
return false;
}

View File

@@ -4,7 +4,7 @@
#include "dZoneManager.h"
#include "SwitchComponent.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "GameMessages.h"
#include <BitStream.h>
#include "eTriggerEventType.h"
@@ -81,13 +81,13 @@ void BouncerComponent::LookupPetSwitch() {
Game::entityManager->SerializeEntity(m_Parent);
Game::logger->Log("BouncerComponent", "Loaded pet bouncer");
LOG("Loaded pet bouncer");
}
}
}
if (!m_PetSwitchLoaded) {
Game::logger->Log("BouncerComponent", "Failed to load pet bouncer");
LOG("Failed to load pet bouncer");
m_Parent->AddCallbackTimer(0.5f, [this]() {
LookupPetSwitch();

View File

@@ -4,7 +4,7 @@
#include <stdexcept>
#include "DestroyableComponent.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "GameMessages.h"
#include "SkillComponent.h"
#include "ControllablePhysicsComponent.h"
@@ -334,7 +334,7 @@ const std::vector<BuffParameter>& BuffComponent::GetBuffParameters(int32_t buffI
param.values.push_back(value);
} catch (std::invalid_argument& exception) {
Game::logger->Log("BuffComponent", "Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
}
}
}

View File

@@ -4,7 +4,7 @@
#include "GameMessages.h"
#include "Entity.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "InventoryComponent.h"
#include "Item.h"
#include "PropertyManagementComponent.h"
@@ -24,7 +24,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
if (!entities.empty()) {
buildArea = entities[0]->GetObjectID();
Game::logger->Log("BuildBorderComponent", "Using PropertyPlaque");
LOG("Using PropertyPlaque");
}
auto* inventoryComponent = originator->GetComponent<InventoryComponent>();
@@ -41,7 +41,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
inventoryComponent->PushEquippedItems();
Game::logger->Log("BuildBorderComponent", "Starting with %llu", buildArea);
LOG("Starting with %llu", buildArea);
if (PropertyManagementComponent::Instance() != nullptr) {
GameMessages::SendStartArrangingWithItem(

View File

@@ -2,7 +2,7 @@
#include <BitStream.h>
#include "tinyxml2.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "GeneralUtils.h"
#include "dServer.h"
#include "dZoneManager.h"
@@ -16,6 +16,7 @@
#include "Amf3.h"
#include "eGameMasterLevel.h"
#include "eGameActivity.h"
#include <ctime>
CharacterComponent::CharacterComponent(Entity* parent, Character* character) : Component(parent) {
m_Character = character;
@@ -178,7 +179,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("CharacterComponent", "Failed to find char tag while loading XML!");
LOG("Failed to find char tag while loading XML!");
return;
}
if (character->QueryAttribute("rpt", &m_Reputation) == tinyxml2::XML_NO_ATTRIBUTE) {
@@ -283,7 +284,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* minifig = doc->FirstChildElement("obj")->FirstChildElement("mf");
if (!minifig) {
Game::logger->Log("CharacterComponent", "Failed to find mf tag while updating XML!");
LOG("Failed to find mf tag while updating XML!");
return;
}
@@ -303,7 +304,7 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("CharacterComponent", "Failed to find char tag while updating XML!");
LOG("Failed to find char tag while updating XML!");
return;
}
@@ -351,7 +352,7 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
//
auto newUpdateTimestamp = std::time(nullptr);
Game::logger->Log("TotalTimePlayed", "Time since last save: %d", newUpdateTimestamp - m_LastUpdateTimestamp);
LOG("Time since last save: %d", newUpdateTimestamp - m_LastUpdateTimestamp);
m_TotalTimePlayed += newUpdateTimestamp - m_LastUpdateTimestamp;
character->SetAttribute("time", m_TotalTimePlayed);
@@ -381,7 +382,7 @@ Item* CharacterComponent::GetRocket(Entity* player) {
}
if (!rocket) {
Game::logger->Log("CharacterComponent", "Unable to find rocket to equip!");
LOG("Unable to find rocket to equip!");
return rocket;
}
return rocket;

View File

@@ -1,7 +1,7 @@
#include "ControllablePhysicsComponent.h"
#include "Entity.h"
#include "BitStream.h"
#include "dLogger.h"
#include "Logger.h"
#include "Game.h"
#include "dpWorld.h"
@@ -52,7 +52,7 @@ ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity) : Phy
return;
if (entity->GetLOT() == 1) {
Game::logger->Log("ControllablePhysicsComponent", "Using patch to load minifig physics");
LOG("Using patch to load minifig physics");
float radius = 1.5f;
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), radius, false);
@@ -161,7 +161,7 @@ void ControllablePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bo
void ControllablePhysicsComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("ControllablePhysicsComponent", "Failed to find char tag!");
LOG("Failed to find char tag!");
return;
}
@@ -181,7 +181,7 @@ void ControllablePhysicsComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("ControllablePhysicsComponent", "Failed to find char tag while updating XML!");
LOG("Failed to find char tag while updating XML!");
return;
}
@@ -268,7 +268,7 @@ void ControllablePhysicsComponent::RemovePickupRadiusScale(float value) {
if (pos != m_ActivePickupRadiusScales.end()) {
m_ActivePickupRadiusScales.erase(pos);
} else {
Game::logger->LogDebug("ControllablePhysicsComponent", "Warning: Could not find pickup radius %f in list of active radii. List has %i active radii.", value, m_ActivePickupRadiusScales.size());
LOG_DEBUG("Warning: Could not find pickup radius %f in list of active radii. List has %i active radii.", value, m_ActivePickupRadiusScales.size());
return;
}
@@ -293,7 +293,7 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) {
if (pos != m_ActiveSpeedBoosts.end()) {
m_ActiveSpeedBoosts.erase(pos);
} else {
Game::logger->LogDebug("ControllablePhysicsComponent", "Warning: Could not find speedboost %f in list of active speedboosts. List has %i active speedboosts.", value, m_ActiveSpeedBoosts.size());
LOG_DEBUG("Warning: Could not find speedboost %f in list of active speedboosts. List has %i active speedboosts.", value, m_ActiveSpeedBoosts.size());
return;
}
@@ -311,7 +311,7 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) {
void ControllablePhysicsComponent::ActivateBubbleBuff(eBubbleType bubbleType, bool specialAnims){
if (m_IsInBubble) {
Game::logger->Log("ControllablePhysicsComponent", "Already in bubble");
LOG("Already in bubble");
return;
}
m_BubbleType = bubbleType;

View File

@@ -1,6 +1,6 @@
#include "DestroyableComponent.h"
#include <BitStream.h>
#include "dLogger.h"
#include "Logger.h"
#include "Game.h"
#include "dConfig.h"
@@ -182,7 +182,7 @@ void DestroyableComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsIn
void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest");
if (!dest) {
Game::logger->Log("DestroyableComponent", "Failed to find dest tag!");
LOG("Failed to find dest tag!");
return;
}
@@ -204,7 +204,7 @@ void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest");
if (!dest) {
Game::logger->Log("DestroyableComponent", "Failed to find dest tag!");
LOG("Failed to find dest tag!");
return;
}
@@ -643,19 +643,19 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
void DestroyableComponent::Subscribe(LWOOBJID scriptObjId, CppScripts::Script* scriptToAdd) {
m_SubscribedScripts.insert(std::make_pair(scriptObjId, scriptToAdd));
Game::logger->LogDebug("DestroyableComponent", "Added script %llu to entity %llu", scriptObjId, m_Parent->GetObjectID());
Game::logger->LogDebug("DestroyableComponent", "Number of subscribed scripts %i", m_SubscribedScripts.size());
LOG_DEBUG("Added script %llu to entity %llu", scriptObjId, m_Parent->GetObjectID());
LOG_DEBUG("Number of subscribed scripts %i", m_SubscribedScripts.size());
}
void DestroyableComponent::Unsubscribe(LWOOBJID scriptObjId) {
auto foundScript = m_SubscribedScripts.find(scriptObjId);
if (foundScript != m_SubscribedScripts.end()) {
m_SubscribedScripts.erase(foundScript);
Game::logger->LogDebug("DestroyableComponent", "Removed script %llu from entity %llu", scriptObjId, m_Parent->GetObjectID());
LOG_DEBUG("Removed script %llu from entity %llu", scriptObjId, m_Parent->GetObjectID());
} else {
Game::logger->LogDebug("DestroyableComponent", "Tried to remove a script for Entity %llu but script %llu didnt exist", m_Parent->GetObjectID(), scriptObjId);
LOG_DEBUG("Tried to remove a script for Entity %llu but script %llu didnt exist", m_Parent->GetObjectID(), scriptObjId);
}
Game::logger->LogDebug("DestroyableComponent", "Number of subscribed scripts %i", m_SubscribedScripts.size());
LOG_DEBUG("Number of subscribed scripts %i", m_SubscribedScripts.size());
}
void DestroyableComponent::NotifySubscribers(Entity* attacker, uint32_t damage) {

View File

@@ -5,7 +5,7 @@
#include "Entity.h"
#include "Item.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "CDClientManager.h"
#include "../dWorldServer/ObjectIDManager.h"
#include "MissionComponent.h"
@@ -175,14 +175,14 @@ void InventoryComponent::AddItem(
const bool bound,
int32_t preferredSlot) {
if (count == 0) {
Game::logger->Log("InventoryComponent", "Attempted to add 0 of item (%i) to the inventory!", lot);
LOG("Attempted to add 0 of item (%i) to the inventory!", lot);
return;
}
if (!Inventory::IsValidItem(lot)) {
if (lot > 0) {
Game::logger->Log("InventoryComponent", "Attempted to add invalid item (%i) to the inventory!", lot);
LOG("Attempted to add invalid item (%i) to the inventory!", lot);
}
return;
@@ -200,7 +200,7 @@ void InventoryComponent::AddItem(
const auto slot = preferredSlot != -1 && inventory->IsSlotEmpty(preferredSlot) ? preferredSlot : inventory->FindEmptySlot();
if (slot == -1) {
Game::logger->Log("InventoryComponent", "Failed to find empty slot for inventory (%i)!", inventoryType);
LOG("Failed to find empty slot for inventory (%i)!", inventoryType);
return;
}
@@ -302,7 +302,7 @@ void InventoryComponent::AddItem(
void InventoryComponent::RemoveItem(const LOT lot, const uint32_t count, eInventoryType inventoryType, const bool ignoreBound) {
if (count == 0) {
Game::logger->Log("InventoryComponent", "Attempted to remove 0 of item (%i) from the inventory!", lot);
LOG("Attempted to remove 0 of item (%i) from the inventory!", lot);
return;
}
@@ -496,7 +496,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
auto* inventoryElement = document->FirstChildElement("obj")->FirstChildElement("inv");
if (inventoryElement == nullptr) {
Game::logger->Log("InventoryComponent", "Failed to find 'inv' xml element!");
LOG("Failed to find 'inv' xml element!");
return;
}
@@ -504,7 +504,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
auto* bags = inventoryElement->FirstChildElement("bag");
if (bags == nullptr) {
Game::logger->Log("InventoryComponent", "Failed to find 'bags' xml element!");
LOG("Failed to find 'bags' xml element!");
return;
}
@@ -530,7 +530,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
auto* items = inventoryElement->FirstChildElement("items");
if (items == nullptr) {
Game::logger->Log("InventoryComponent", "Failed to find 'items' xml element!");
LOG("Failed to find 'items' xml element!");
return;
}
@@ -545,7 +545,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
auto* inventory = GetInventory(static_cast<eInventoryType>(type));
if (inventory == nullptr) {
Game::logger->Log("InventoryComponent", "Failed to find inventory (%i)!", type);
LOG("Failed to find inventory (%i)!", type);
return;
}
@@ -618,7 +618,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
auto* inventoryElement = document->FirstChildElement("obj")->FirstChildElement("inv");
if (inventoryElement == nullptr) {
Game::logger->Log("InventoryComponent", "Failed to find 'inv' xml element!");
LOG("Failed to find 'inv' xml element!");
return;
}
@@ -641,7 +641,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
auto* bags = inventoryElement->FirstChildElement("bag");
if (bags == nullptr) {
Game::logger->Log("InventoryComponent", "Failed to find 'bags' xml element!");
LOG("Failed to find 'bags' xml element!");
return;
}
@@ -660,7 +660,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
auto* items = inventoryElement->FirstChildElement("items");
if (items == nullptr) {
Game::logger->Log("InventoryComponent", "Failed to find 'items' xml element!");
LOG("Failed to find 'items' xml element!");
return;
}
@@ -935,7 +935,7 @@ void InventoryComponent::EquipScripts(Item* equippedItem) {
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
if (!itemScript) {
Game::logger->Log("InventoryComponent", "null script?");
LOG("null script?");
}
itemScript->OnFactionTriggerItemEquipped(m_Parent, equippedItem->GetId());
}
@@ -950,7 +950,7 @@ void InventoryComponent::UnequipScripts(Item* unequippedItem) {
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
if (!itemScript) {
Game::logger->Log("InventoryComponent", "null script?");
LOG("null script?");
}
itemScript->OnFactionTriggerItemUnequipped(m_Parent, unequippedItem->GetId());
}
@@ -1330,7 +1330,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
const auto entry = behaviors->GetSkillByID(result.skillID);
if (entry.skillID == 0) {
Game::logger->Log("InventoryComponent", "Failed to find buff behavior for skill (%i)!", result.skillID);
LOG("Failed to find buff behavior for skill (%i)!", result.skillID);
continue;
}
@@ -1397,7 +1397,7 @@ std::vector<Item*> InventoryComponent::GenerateProxies(Item* parent) {
try {
lots.push_back(std::stoi(segment));
} catch (std::invalid_argument& exception) {
Game::logger->Log("InventoryComponent", "Failed to parse proxy (%s): (%s)!", segment.c_str(), exception.what());
LOG("Failed to parse proxy (%s): (%s)!", segment.c_str(), exception.what());
}
}

View File

@@ -16,7 +16,7 @@ LevelProgressionComponent::LevelProgressionComponent(Entity* parent) : Component
void LevelProgressionComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* level = doc->FirstChildElement("obj")->FirstChildElement("lvl");
if (!level) {
Game::logger->Log("LevelProgressionComponent", "Failed to find lvl tag while updating XML!");
LOG("Failed to find lvl tag while updating XML!");
return;
}
level->SetAttribute("l", m_Level);
@@ -27,7 +27,7 @@ void LevelProgressionComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
void LevelProgressionComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* level = doc->FirstChildElement("obj")->FirstChildElement("lvl");
if (!level) {
Game::logger->Log("LevelProgressionComponent", "Failed to find lvl tag while loading XML!");
LOG("Failed to find lvl tag while loading XML!");
return;
}
level->QueryAttribute("l", &m_Level);

View File

@@ -7,7 +7,7 @@
#include <string>
#include "MissionComponent.h"
#include "dLogger.h"
#include "Logger.h"
#include "CDClientManager.h"
#include "CDMissionTasksTable.h"
#include "InventoryComponent.h"
@@ -363,7 +363,7 @@ bool MissionComponent::LookForAchievements(eMissionTaskType type, int32_t value,
break;
}
} catch (std::invalid_argument& exception) {
Game::logger->Log("MissionComponent", "Failed to parse target (%s): (%s)!", token.c_str(), exception.what());
LOG("Failed to parse target (%s): (%s)!", token.c_str(), exception.what());
}
}

View File

@@ -11,7 +11,7 @@
#include "GameMessages.h"
#include "Entity.h"
#include "MissionComponent.h"
#include "dLogger.h"
#include "Logger.h"
#include "Game.h"
#include "MissionPrerequisites.h"
#include "eMissionState.h"
@@ -82,7 +82,7 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
auto* missionComponent = static_cast<MissionComponent*>(entity->GetComponent(eReplicaComponentType::MISSION));
if (!missionComponent) {
Game::logger->Log("MissionOfferComponent", "Unable to get mission component for Entity %llu", entity->GetObjectID());
LOG("Unable to get mission component for Entity %llu", entity->GetObjectID());
return;
}
@@ -154,7 +154,7 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
randomMissionPool.push_back(value);
} catch (std::invalid_argument& exception) {
Game::logger->Log("MissionOfferComponent", "Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
}
}

View File

@@ -11,7 +11,7 @@
#include "GameMessages.h"
#include "EntityManager.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "Component.h"
#include "eReplicaComponentType.h"
#include <vector>

View File

@@ -8,7 +8,7 @@
#include "GeneralUtils.h"
#include "dZoneManager.h"
#include "EntityManager.h"
#include "dLogger.h"
#include "Logger.h"
#include "GameMessages.h"
#include "CppScripts.h"
#include "SimplePhysicsComponent.h"
@@ -63,7 +63,7 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const std::stri
m_NoAutoStart = false;
if (m_Path == nullptr) {
Game::logger->Log("MovingPlatformComponent", "Path not found: %s", pathName.c_str());
LOG("Path not found: %s", pathName.c_str());
}
}

View File

@@ -240,7 +240,7 @@ void PetComponent::OnUse(Entity* originator) {
if (bricks.empty()) {
ChatPackets::SendSystemMessage(originator->GetSystemAddress(), u"Failed to load the puzzle minigame for this pet.");
Game::logger->Log("PetComponent", "Couldn't find %s for minigame!", buildFile.c_str());
LOG("Couldn't find %s for minigame!", buildFile.c_str());
return;
}
@@ -647,7 +647,7 @@ void PetComponent::RequestSetPetName(std::u16string name) {
return;
}
Game::logger->Log("PetComponent", "Got set pet name (%s)", GeneralUtils::UTF16ToWTF8(name).c_str());
LOG("Got set pet name (%s)", GeneralUtils::UTF16ToWTF8(name).c_str());
auto* inventoryComponent = tamer->GetComponent<InventoryComponent>();
@@ -923,7 +923,7 @@ void PetComponent::AddDrainImaginationTimer(Item* item, bool fromTaming) {
// Set this to a variable so when this is called back from the player the timer doesn't fire off.
m_Parent->AddCallbackTimer(imaginationDrainRate, [playerDestroyableComponent, this, item]() {
if (!playerDestroyableComponent) {
Game::logger->Log("PetComponent", "No petComponent and/or no playerDestroyableComponent");
LOG("No petComponent and/or no playerDestroyableComponent");
return;
}

View File

@@ -9,7 +9,7 @@
#include "PhantomPhysicsComponent.h"
#include "Game.h"
#include "LDFFormat.h"
#include "dLogger.h"
#include "Logger.h"
#include "Entity.h"
#include "EntityManager.h"
#include "ControllablePhysicsComponent.h"
@@ -223,7 +223,7 @@ PhantomPhysicsComponent::PhantomPhysicsComponent(Entity* parent) : PhysicsCompon
m_dpEntity->SetPosition(m_Position);
dpWorld::Instance().AddEntity(m_dpEntity);
} else {
//Game::logger->Log("PhantomPhysicsComponent", "This one is supposed to have %s", info->physicsAsset.c_str());
//LOG("This one is supposed to have %s", info->physicsAsset.c_str());
//add fallback cube:
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), 2.0f, 2.0f, 2.0f);

View File

@@ -10,7 +10,7 @@
#include "RocketLaunchpadControlComponent.h"
#include "CharacterComponent.h"
#include "UserManager.h"
#include "dLogger.h"
#include "Logger.h"
#include "Amf3.h"
#include "eObjectBits.h"
#include "eGameMasterLevel.h"
@@ -219,7 +219,7 @@ void PropertyEntranceComponent::OnPropertyEntranceSync(Entity* entity, bool incl
delete nameLookup;
nameLookup = nullptr;
Game::logger->Log("PropertyEntranceComponent", "Failed to find property owner name for %llu!", cloneId);
LOG("Failed to find property owner name for %llu!", cloneId);
continue;
} else {

View File

@@ -123,7 +123,7 @@ std::vector<NiPoint3> PropertyManagementComponent::GetPaths() const {
points.push_back(value);
} catch (std::invalid_argument& exception) {
Game::logger->Log("PropertyManagementComponent", "Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
}
}
@@ -234,7 +234,7 @@ bool PropertyManagementComponent::Claim(const LWOOBJID playerId) {
try {
insertion->execute();
} catch (sql::SQLException& exception) {
Game::logger->Log("PropertyManagementComponent", "Failed to execute query: (%s)!", exception.what());
LOG("Failed to execute query: (%s)!", exception.what());
throw exception;
return false;
@@ -294,7 +294,7 @@ void PropertyManagementComponent::OnFinishBuilding() {
}
void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const NiPoint3 position, NiQuaternion rotation) {
Game::logger->Log("PropertyManagementComponent", "Placing model <%f, %f, %f>", position.x, position.y, position.z);
LOG("Placing model <%f, %f, %f>", position.x, position.y, position.z);
auto* entity = GetOwner();
@@ -311,7 +311,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
auto* item = inventoryComponent->FindItemById(id);
if (item == nullptr) {
Game::logger->Log("PropertyManagementComponent", "Failed to find item with id %d", id);
LOG("Failed to find item with id %d", id);
return;
}
@@ -409,7 +409,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
}
void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason) {
Game::logger->Log("PropertyManagementComponent", "Delete model: (%llu) (%i)", id, deleteReason);
LOG("Delete model: (%llu) (%i)", id, deleteReason);
auto* entity = GetOwner();
@@ -426,7 +426,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
const auto index = models.find(id);
if (index == models.end()) {
Game::logger->Log("PropertyManagementComponent", "Failed to find model");
LOG("Failed to find model");
return;
}
@@ -438,20 +438,20 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
models.erase(id);
if (spawner == nullptr) {
Game::logger->Log("PropertyManagementComponent", "Failed to find spawner");
LOG("Failed to find spawner");
}
auto* model = Game::entityManager->GetEntity(id);
if (model == nullptr) {
Game::logger->Log("PropertyManagementComponent", "Failed to find model entity");
LOG("Failed to find model entity");
return;
}
Game::entityManager->DestructEntity(model);
Game::logger->Log("PropertyManagementComponent", "Deleting model LOT %i", model->GetLOT());
LOG("Deleting model LOT %i", model->GetLOT());
if (model->GetLOT() == 14) {
//add it to the inv
@@ -534,13 +534,13 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
{
item->SetCount(item->GetCount() - 1);
Game::logger->Log("BODGE TIME", "YES IT GOES HERE");
LOG("YES IT GOES HERE");
break;
}
default:
{
Game::logger->Log("PropertyManagementComponent", "Invalid delete reason");
LOG("Invalid delete reason");
}
}
@@ -679,7 +679,7 @@ void PropertyManagementComponent::Save() {
try {
lookupResult = lookup->executeQuery();
} catch (sql::SQLException& ex) {
Game::logger->Log("PropertyManagementComponent", "lookup error %s", ex.what());
LOG("lookup error %s", ex.what());
}
std::vector<LWOOBJID> present;
@@ -729,7 +729,7 @@ void PropertyManagementComponent::Save() {
try {
insertion->execute();
} catch (sql::SQLException& ex) {
Game::logger->Log("PropertyManagementComponent", "Error inserting into properties_contents. Error %s", ex.what());
LOG("Error inserting into properties_contents. Error %s", ex.what());
}
} else {
update->setDouble(1, position.x);
@@ -744,7 +744,7 @@ void PropertyManagementComponent::Save() {
try {
update->executeUpdate();
} catch (sql::SQLException& ex) {
Game::logger->Log("PropertyManagementComponent", "Error updating properties_contents. Error: %s", ex.what());
LOG("Error updating properties_contents. Error: %s", ex.what());
}
}
}
@@ -758,7 +758,7 @@ void PropertyManagementComponent::Save() {
try {
remove->execute();
} catch (sql::SQLException& ex) {
Game::logger->Log("PropertyManagementComponent", "Error removing from properties_contents. Error %s", ex.what());
LOG("Error removing from properties_contents. Error %s", ex.what());
}
}
@@ -789,7 +789,7 @@ void PropertyManagementComponent::OnQueryPropertyData(Entity* originator, const
const auto& worldId = Game::zoneManager->GetZone()->GetZoneID();
const auto zoneId = worldId.GetMapID();
Game::logger->Log("Properties", "Getting property info for %d", zoneId);
LOG("Getting property info for %d", zoneId);
GameMessages::PropertyDataMessage message = GameMessages::PropertyDataMessage(zoneId);
const auto isClaimed = GetOwnerId() != LWOOBJID_EMPTY;

View File

@@ -6,7 +6,7 @@
#include "EntityManager.h"
#include "dZoneManager.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "PropertyManagementComponent.h"
#include "UserManager.h"
@@ -19,7 +19,7 @@ void PropertyVendorComponent::OnUse(Entity* originator) {
OnQueryPropertyData(originator, originator->GetSystemAddress());
if (PropertyManagementComponent::Instance()->GetOwnerId() == LWOOBJID_EMPTY) {
Game::logger->Log("PropertyVendorComponent", "Property vendor opening!");
LOG("Property vendor opening!");
GameMessages::SendOpenPropertyVendor(m_Parent->GetObjectID(), originator->GetSystemAddress());
@@ -37,7 +37,7 @@ void PropertyVendorComponent::OnBuyFromVendor(Entity* originator, const bool con
if (PropertyManagementComponent::Instance() == nullptr) return;
if (PropertyManagementComponent::Instance()->Claim(originator->GetObjectID()) == false) {
Game::logger->Log("PropertyVendorComponent", "FAILED TO CLAIM PROPERTY. PLAYER ID IS %llu", originator->GetObjectID());
LOG("FAILED TO CLAIM PROPERTY. PLAYER ID IS %llu", originator->GetObjectID());
return;
}
@@ -51,6 +51,6 @@ void PropertyVendorComponent::OnBuyFromVendor(Entity* originator, const bool con
PropertyManagementComponent::Instance()->OnQueryPropertyData(originator, originator->GetSystemAddress());
Game::logger->Log("PropertyVendorComponent", "Fired event; (%d) (%i) (%i)", confirmed, lot, count);
LOG("Fired event; (%d) (%i) (%i)", confirmed, lot, count);
}

View File

@@ -26,6 +26,7 @@
#include "LeaderboardManager.h"
#include "dZoneManager.h"
#include "CDActivitiesTable.h"
#include <ctime>
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
@@ -79,7 +80,7 @@ void RacingControlComponent::OnPlayerLoaded(Entity* player) {
m_LoadedPlayers++;
Game::logger->Log("RacingControlComponent", "Loading player %i",
LOG("Loading player %i",
m_LoadedPlayers);
m_LobbyPlayers.push_back(player->GetObjectID());
}
@@ -103,7 +104,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
auto* item = inventoryComponent->FindItemByLot(8092);
if (item == nullptr) {
Game::logger->Log("RacingControlComponent", "Failed to find item");
LOG("Failed to find item");
auto* playerInstance = dynamic_cast<Player*>(player);
if(playerInstance){
m_LoadedPlayers--;
@@ -552,12 +553,10 @@ void RacingControlComponent::Update(float deltaTime) {
// From the first 2 players loading in the rest have a max of 15 seconds
// to load in, can raise this if it's too low
if (m_LoadTimer >= 15) {
Game::logger->Log("RacingControlComponent",
"Loading all players...");
LOG("Loading all players...");
for (size_t positionNumber = 0; positionNumber < m_LobbyPlayers.size(); positionNumber++) {
Game::logger->Log("RacingControlComponent",
"Loading player now!");
LOG("Loading player now!");
auto* player =
Game::entityManager->GetEntity(m_LobbyPlayers[positionNumber]);
@@ -566,8 +565,7 @@ void RacingControlComponent::Update(float deltaTime) {
return;
}
Game::logger->Log("RacingControlComponent",
"Loading player now NOW!");
LOG("Loading player now NOW!");
LoadPlayerVehicle(player, positionNumber + 1, true);
@@ -717,7 +715,7 @@ void RacingControlComponent::Update(float deltaTime) {
m_Started = true;
Game::logger->Log("RacingControlComponent", "Starting race");
LOG("Starting race");
Game::entityManager->SerializeEntity(m_Parent);
@@ -820,8 +818,7 @@ void RacingControlComponent::Update(float deltaTime) {
if (player.bestLapTime == 0 || player.bestLapTime > lapTime) {
player.bestLapTime = lapTime;
Game::logger->Log("RacingControlComponent",
"Best lap time (%llu)", lapTime);
LOG("Best lap time (%llu)", lapTime);
}
auto* missionComponent =
@@ -841,8 +838,7 @@ void RacingControlComponent::Update(float deltaTime) {
player.raceTime = raceTime;
Game::logger->Log("RacingControlComponent",
"Completed time %llu, %llu",
LOG("Completed time %llu, %llu",
raceTime, raceTime * 1000);
LeaderboardManager::SaveScore(playerEntity->GetObjectID(), m_ActivityID, static_cast<float>(player.raceTime), static_cast<float>(player.bestLapTime), static_cast<float>(player.finished == 1));
@@ -858,13 +854,11 @@ void RacingControlComponent::Update(float deltaTime) {
}
}
Game::logger->Log("RacingControlComponent",
"Lapped (%i) in (%llu)", player.lap,
LOG("Lapped (%i) in (%llu)", player.lap,
lapTime);
}
Game::logger->Log("RacingControlComponent",
"Reached point (%i)/(%i)", player.respawnIndex,
LOG("Reached point (%i)/(%i)", player.respawnIndex,
path->pathWaypoints.size());
break;

View File

@@ -6,7 +6,7 @@
#include "GameMessages.h"
#include "RebuildComponent.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "RenderComponent.h"
#include "EntityManager.h"
#include "eStateChangeType.h"

View File

@@ -4,7 +4,7 @@
#include "GameMessages.h"
#include "EntityManager.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "CharacterComponent.h"
#include "MissionComponent.h"
#include "eMissionTaskType.h"
@@ -39,7 +39,7 @@ RebuildComponent::RebuildComponent(Entity* entity) : Component(entity) {
GeneralUtils::TryParse(positionAsVector[1], m_ActivatorPosition.y) &&
GeneralUtils::TryParse(positionAsVector[2], m_ActivatorPosition.z)) {
} else {
Game::logger->Log("RebuildComponent", "Failed to find activator position for lot %i. Defaulting to parents position.", m_Parent->GetLOT());
LOG("Failed to find activator position for lot %i. Defaulting to parents position.", m_Parent->GetLOT());
m_ActivatorPosition = m_Parent->GetPosition();
}
@@ -439,7 +439,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
characterComponent->SetCurrentActivity(eGameActivity::NONE);
characterComponent->TrackRebuildComplete();
} else {
Game::logger->Log("RebuildComponent", "Some user tried to finish the rebuild but they didn't have a character somehow.");
LOG("Some user tried to finish the rebuild but they didn't have a character somehow.");
return;
}

View File

@@ -10,7 +10,7 @@
#include "CDClientManager.h"
#include "GameMessages.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "CDAnimationsTable.h"
std::unordered_map<int32_t, float> RenderComponent::m_DurationCache{};
@@ -32,7 +32,7 @@ RenderComponent::RenderComponent(Entity* parent, int32_t componentId): Component
for (auto& groupId : groupIdsSplit) {
int32_t groupIdInt;
if (!GeneralUtils::TryParse(groupId, groupIdInt)) {
Game::logger->Log("RenderComponent", "bad animation group Id %s", groupId.c_str());
LOG("bad animation group Id %s", groupId.c_str());
continue;
}
m_animationGroupIds.push_back(groupIdInt);
@@ -229,6 +229,6 @@ float RenderComponent::DoAnimation(Entity* self, const std::string& animation, b
}
}
if (sendAnimation) GameMessages::SendPlayAnimation(self, GeneralUtils::ASCIIToUTF16(animation), priority, scale);
if (returnlength == 0.0f) Game::logger->Log("RenderComponent", "WARNING: Unable to find animation %s for lot %i in any group.", animation.c_str(), self->GetLOT());
if (returnlength == 0.0f) LOG("WARNING: Unable to find animation %s for lot %i in any group.", animation.c_str(), self->GetLOT());
return returnlength;
}

View File

@@ -8,7 +8,7 @@
#include "EntityManager.h"
#include "Item.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "CDClientDatabase.h"
#include "ChatPackets.h"
#include "MissionComponent.h"
@@ -57,7 +57,7 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId,
auto* rocket = characterComponent->GetRocket(originator);
if (!rocket) {
Game::logger->Log("RocketLaunchpadControlComponent", "Unable to find rocket!");
LOG("Unable to find rocket!");
return;
}

View File

@@ -6,7 +6,7 @@
#include "dZoneManager.h"
#include "ZoneInstanceManager.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include <WorldPackets.h>
#include "EntityManager.h"
#include "ChatPackets.h"
@@ -273,7 +273,7 @@ void ScriptedActivityComponent::Update(float deltaTime) {
// The timer has elapsed, start the instance
if (lobby->timer <= 0.0f) {
Game::logger->Log("ScriptedActivityComponent", "Setting up instance.");
LOG("Setting up instance.");
ActivityInstance* instance = NewInstance();
LoadPlayersIntoInstance(instance, lobby->players);
instance->StartZone();
@@ -539,7 +539,7 @@ void ActivityInstance::StartZone() {
if (player == nullptr)
return;
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", player->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
LOG("Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", player->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (player->GetCharacter()) {
player->GetCharacter()->SetZoneID(zoneID);
player->GetCharacter()->SetZoneInstance(zoneInstance);

View File

@@ -6,7 +6,7 @@
#include "SimplePhysicsComponent.h"
#include "BitStream.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "dpWorld.h"
#include "CDClientManager.h"
#include "CDPhysicsComponentTable.h"

View File

@@ -55,7 +55,7 @@ void SkillComponent::SyncPlayerSkill(const uint32_t skillUid, const uint32_t syn
const auto index = this->m_managedBehaviors.find(skillUid);
if (index == this->m_managedBehaviors.end()) {
Game::logger->Log("SkillComponent", "Failed to find skill with uid (%i)!", skillUid, syncId);
LOG("Failed to find skill with uid (%i)!", skillUid, syncId);
return;
}
@@ -80,7 +80,7 @@ void SkillComponent::SyncPlayerProjectile(const LWOOBJID projectileId, RakNet::B
}
if (index == -1) {
Game::logger->Log("SkillComponent", "Failed to find projectile id (%llu)!", projectileId);
LOG("Failed to find projectile id (%llu)!", projectileId);
return;
}
@@ -94,7 +94,7 @@ void SkillComponent::SyncPlayerProjectile(const LWOOBJID projectileId, RakNet::B
auto result = query.execQuery();
if (result.eof()) {
Game::logger->Log("SkillComponent", "Failed to find skill id for (%i)!", sync_entry.lot);
LOG("Failed to find skill id for (%i)!", sync_entry.lot);
return;
}
@@ -243,7 +243,7 @@ bool SkillComponent::CastSkill(const uint32_t skillId, LWOOBJID target, const LW
// check to see if we got back a valid behavior
if (behaviorId == -1) {
Game::logger->LogDebug("SkillComponent", "Tried to cast skill %i but found no behavior", skillId);
LOG_DEBUG("Tried to cast skill %i but found no behavior", skillId);
return false;
}
@@ -401,7 +401,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry)
if (other == nullptr) {
if (entry.branchContext.target != LWOOBJID_EMPTY) {
Game::logger->Log("SkillComponent", "Invalid projectile target (%llu)!", entry.branchContext.target);
LOG("Invalid projectile target (%llu)!", entry.branchContext.target);
}
return;
@@ -413,7 +413,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry)
auto result = query.execQuery();
if (result.eof()) {
Game::logger->Log("SkillComponent", "Failed to find skill id for (%i)!", entry.lot);
LOG("Failed to find skill id for (%i)!", entry.lot);
return;
}

View File

@@ -12,7 +12,7 @@
#include "BitStream.h"
#include "Component.h"
#include "Entity.h"
#include "dLogger.h"
#include "Logger.h"
#include "eReplicaComponentType.h"
struct ProjectileSyncEntry {

View File

@@ -1,6 +1,6 @@
#include "SoundTriggerComponent.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
void MusicCue::Serialize(RakNet::BitStream* outBitStream){
outBitStream->Write<uint8_t>(name.size());

View File

@@ -155,7 +155,7 @@ void TriggerComponent::HandleTriggerCommand(LUTriggers::Command* command, Entity
case eTriggerCommandType::DEACTIVATE_MIXER_PROGRAM: break;
// DEPRECATED BLOCK END
default:
Game::logger->LogDebug("TriggerComponent", "Event %i was not handled!", command->id);
LOG_DEBUG("Event %i was not handled!", command->id);
break;
}
}
@@ -198,7 +198,7 @@ void TriggerComponent::HandleDestroyObject(Entity* targetEntity, std::string arg
void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string args){
auto* triggerComponent = targetEntity->GetComponent<TriggerComponent>();
if (!triggerComponent) {
Game::logger->LogDebug("TriggerComponent::HandleToggleTrigger", "Trigger component not found!");
LOG_DEBUG("Trigger component not found!");
return;
}
triggerComponent->SetTriggerEnabled(args == "1");
@@ -207,7 +207,7 @@ void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string arg
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
auto* rebuildComponent = targetEntity->GetComponent<RebuildComponent>();
if (!rebuildComponent) {
Game::logger->LogDebug("TriggerComponent::HandleResetRebuild", "Rebuild component not found!");
LOG_DEBUG("Rebuild component not found!");
return;
}
rebuildComponent->ResetRebuild(args == "1");
@@ -239,7 +239,7 @@ void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::s
auto* phantomPhysicsComponent = m_Parent->GetComponent<PhantomPhysicsComponent>();
if (!phantomPhysicsComponent) {
Game::logger->LogDebug("TriggerComponent::HandlePushObject", "Phantom Physics component not found!");
LOG_DEBUG("Phantom Physics component not found!");
return;
}
phantomPhysicsComponent->SetPhysicsEffectActive(true);
@@ -256,7 +256,7 @@ void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::s
void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args){
auto* phantomPhysicsComponent = m_Parent->GetComponent<PhantomPhysicsComponent>();
if (!phantomPhysicsComponent) {
Game::logger->LogDebug("TriggerComponent::HandleRepelObject", "Phantom Physics component not found!");
LOG_DEBUG("Phantom Physics component not found!");
return;
}
float forceMultiplier;
@@ -279,7 +279,7 @@ void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args)
void TriggerComponent::HandleSetTimer(Entity* targetEntity, std::vector<std::string> argArray){
if (argArray.size() != 2) {
Game::logger->LogDebug("TriggerComponent::HandleSetTimer", "Not ehought variables!");
LOG_DEBUG("Not ehought variables!");
return;
}
float time = 0.0;
@@ -320,7 +320,7 @@ void TriggerComponent::HandlePlayCinematic(Entity* targetEntity, std::vector<std
void TriggerComponent::HandleToggleBBB(Entity* targetEntity, std::string args) {
auto* character = targetEntity->GetCharacter();
if (!character) {
Game::logger->LogDebug("TriggerComponent::HandleToggleBBB", "Character was not found!");
LOG_DEBUG("Character was not found!");
return;
}
bool buildMode = !(character->GetBuildMode());
@@ -336,7 +336,7 @@ void TriggerComponent::HandleUpdateMission(Entity* targetEntity, std::vector<std
if (argArray.at(0) != "exploretask") return;
MissionComponent* missionComponent = targetEntity->GetComponent<MissionComponent>();
if (!missionComponent){
Game::logger->LogDebug("TriggerComponent::HandleUpdateMission", "Mission component not found!");
LOG_DEBUG("Mission component not found!");
return;
}
missionComponent->Progress(eMissionTaskType::EXPLORE, 0, 0, argArray.at(4));
@@ -355,7 +355,7 @@ void TriggerComponent::HandlePlayEffect(Entity* targetEntity, std::vector<std::s
void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
auto* skillComponent = targetEntity->GetComponent<SkillComponent>();
if (!skillComponent) {
Game::logger->LogDebug("TriggerComponent::HandleCastSkill", "Skill component not found!");
LOG_DEBUG("Skill component not found!");
return;
}
uint32_t skillId;
@@ -366,7 +366,7 @@ void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::vector<std::string> argArray) {
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
if (!phantomPhysicsComponent) {
Game::logger->LogDebug("TriggerComponent::HandleSetPhysicsVolumeEffect", "Phantom Physics component not found!");
LOG_DEBUG("Phantom Physics component not found!");
return;
}
phantomPhysicsComponent->SetPhysicsEffectActive(true);
@@ -401,7 +401,7 @@ void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::v
void TriggerComponent::HandleSetPhysicsVolumeStatus(Entity* targetEntity, std::string args) {
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
if (!phantomPhysicsComponent) {
Game::logger->LogDebug("TriggerComponent::HandleSetPhysicsVolumeEffect", "Phantom Physics component not found!");
LOG_DEBUG("Phantom Physics component not found!");
return;
}
phantomPhysicsComponent->SetPhysicsEffectActive(args == "On");
@@ -438,6 +438,6 @@ void TriggerComponent::HandleActivatePhysics(Entity* targetEntity, std::string a
} else if (args == "false"){
// TODO remove Phsyics entity if there is one
} else {
Game::logger->LogDebug("TriggerComponent", "Invalid argument for ActivatePhysics Trigger: %s", args.c_str());
LOG_DEBUG("Invalid argument for ActivatePhysics Trigger: %s", args.c_str());
}
}

View File

@@ -57,7 +57,7 @@ void VendorComponent::RefreshInventory(bool isCreation) {
if (!m_HasStandardCostItems || !m_HasMultiCostItems) {
auto itemComponentID = compRegistryTable->GetByIDAndType(item.itemid, eReplicaComponentType::ITEM, -1);
if (itemComponentID == -1) {
Game::logger->Log("VendorComponent", "Attempted to add item %i with ItemComponent ID -1 to vendor %i inventory. Not adding item!", itemComponentID, m_Parent->GetLOT());
LOG("Attempted to add item %i with ItemComponent ID -1 to vendor %i inventory. Not adding item!", itemComponentID, m_Parent->GetLOT());
continue;
}
auto itemComponent = itemComponentTable->GetItemComponentByID(itemComponentID);
@@ -77,7 +77,7 @@ void VendorComponent::RefreshInventory(bool isCreation) {
if (!m_HasStandardCostItems || !m_HasMultiCostItems) {
auto itemComponentID = compRegistryTable->GetByIDAndType(randomItem.itemid, eReplicaComponentType::ITEM, -1);
if (itemComponentID == -1) {
Game::logger->Log("VendorComponent", "Attempted to add item %i with ItemComponent ID -1 to vendor %i inventory. Not adding item!", itemComponentID, m_Parent->GetLOT());
LOG("Attempted to add item %i with ItemComponent ID -1 to vendor %i inventory. Not adding item!", itemComponentID, m_Parent->GetLOT());
continue;
}
auto itemComponent = itemComponentTable->GetItemComponentByID(itemComponentID);