updated more logs

This commit is contained in:
jadebenn 2024-03-12 21:10:01 -05:00
parent 3164bad9af
commit cfb0826d22
38 changed files with 139 additions and 139 deletions

View File

@ -54,7 +54,7 @@ uint32_t BrickByBrickFix::TruncateBrokenBrickByBrickXml() {
completeUncompressedModel.append(reinterpret_cast<char*>(uncompressedChunk.get())); completeUncompressedModel.append(reinterpret_cast<char*>(uncompressedChunk.get()));
completeUncompressedModel.resize(previousSize + actualUncompressedSize); completeUncompressedModel.resize(previousSize + actualUncompressedSize);
} else { } else {
Log::Warn("Failed to inflate chunk {:d} for model %llu. Error: {:d}", chunkCount, model.id, err); Log::Warn("Failed to inflate chunk {} for model %llu. Error: {}", chunkCount, model.id, err);
break; break;
} }
chunkCount++; chunkCount++;
@ -70,13 +70,13 @@ uint32_t BrickByBrickFix::TruncateBrokenBrickByBrickXml() {
"</LXFML>", "</LXFML>",
completeUncompressedModel.length() >= 15 ? completeUncompressedModel.length() - 15 : 0) == std::string::npos completeUncompressedModel.length() >= 15 ? completeUncompressedModel.length() - 15 : 0) == std::string::npos
) { ) {
LOG("Brick-by-brick model %llu will be deleted!", model.id); Log::Info("Brick-by-brick model {} will be deleted!", model.id);
Database::Get()->DeleteUgcModelData(model.id); Database::Get()->DeleteUgcModelData(model.id);
modelsTruncated++; modelsTruncated++;
} }
} }
} else { } else {
LOG("Brick-by-brick model %llu will be deleted!", model.id); Log::Info("Brick-by-brick model {} will be deleted!", model.id);
Database::Get()->DeleteUgcModelData(model.id); Database::Get()->DeleteUgcModelData(model.id);
modelsTruncated++; modelsTruncated++;
} }
@ -121,11 +121,11 @@ uint32_t BrickByBrickFix::UpdateBrickByBrickModelsToSd0() {
try { try {
Database::Get()->UpdateUgcModelData(model.id, outputStringStream); Database::Get()->UpdateUgcModelData(model.id, outputStringStream);
Log::Info("Updated model {:d} to sd0", model.id); Log::Info("Updated model {} to sd0", model.id);
updatedModels++; updatedModels++;
} catch (sql::SQLException exception) { } catch (sql::SQLException exception) {
Log::Warn("Failed to update model {:d}. This model should be inspected manually to see why." Log::Warn("Failed to update model {}. This model should be inspected manually to see why."
"The database error is {:s}", model.id, exception.what()); "The database error is {}", model.id, exception.what());
} }
} }
} }

View File

@ -13,7 +13,7 @@ namespace {
void Database::Connect() { void Database::Connect() {
if (database) { if (database) {
LOG("Tried to connect to database when it's already connected!"); Log::Warn("Tried to connect to database when it's already connected!");
return; return;
} }
@ -23,7 +23,7 @@ void Database::Connect() {
GameDatabase* Database::Get() { GameDatabase* Database::Get() {
if (!database) { if (!database) {
LOG("Tried to get database when it's not connected!"); Log::Warn("Tried to get database when it's not connected!");
Connect(); Connect();
} }
return database; return database;
@ -35,6 +35,6 @@ void Database::Destroy(std::string source) {
delete database; delete database;
database = nullptr; database = nullptr;
} else { } else {
LOG("Trying to destroy database when it's not connected!"); Log::Warn("Trying to destroy database when it's not connected!");
} }
} }

View File

@ -147,91 +147,91 @@ private:
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::string_view param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::string_view param) {
// Log::Info("{:s}", param); // Log::Info("{}", param);
stmt->setString(index, param.data()); stmt->setString(index, param.data());
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const char* param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const char* param) {
// Log::Info("{:s}", param); // Log::Info("{}", param);
stmt->setString(index, param); stmt->setString(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::string param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::string param) {
// Log::Info("{:s}", param); // Log::Info("{}", param);
stmt->setString(index, param); stmt->setString(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int8_t param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int8_t param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setByte(index, param); stmt->setByte(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint8_t param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint8_t param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setByte(index, param); stmt->setByte(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int16_t param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int16_t param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setShort(index, param); stmt->setShort(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint16_t param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint16_t param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setShort(index, param); stmt->setShort(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint32_t param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint32_t param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setUInt(index, param); stmt->setUInt(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int32_t param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int32_t param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setInt(index, param); stmt->setInt(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int64_t param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int64_t param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setInt64(index, param); stmt->setInt64(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint64_t param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint64_t param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setUInt64(index, param); stmt->setUInt64(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const float param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const float param) {
// Log::Info({:f}", param); // Log::Info({}", param);
stmt->setFloat(index, param); stmt->setFloat(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const double param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const double param) {
// Log::Info("{:f}", param); // Log::Info("{}", param);
stmt->setDouble(index, param); stmt->setDouble(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const bool param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const bool param) {
// Log::Info("{:d}", param); // Log::Info("{}", param);
stmt->setBoolean(index, param); stmt->setBoolean(index, param);
} }
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::istream* param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::istream* param) {
// LOG("Blob"); // Log::Info("Blob");
// This is the one time you will ever see me use const_cast. // This is the one time you will ever see me use const_cast.
stmt->setBlob(index, const_cast<std::istream*>(param)); stmt->setBlob(index, const_cast<std::istream*>(param));
} }
@ -239,7 +239,7 @@ inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::istr
template<> template<>
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::optional<uint32_t> param) { inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::optional<uint32_t> param) {
if (param) { if (param) {
// Log::Info("{:f}", param.value()); // Log::Info("{}", param.value());
stmt->setInt(index, param.value()); stmt->setInt(index, param.value());
} else { } else {
// Log::Info("Null"); // Log::Info("Null");

View File

@ -138,11 +138,11 @@ Entity::Entity(const LWOOBJID& objectID, EntityInfo info, User* parentUser, Enti
Entity::~Entity() { Entity::~Entity() {
if (IsPlayer()) { if (IsPlayer()) {
LOG("Deleted player"); Log::Info("Deleted player");
// Make sure the player exists first. Remove afterwards to prevent the OnPlayerExist functions from not being able to find the player. // Make sure the player exists first. Remove afterwards to prevent the OnPlayerExist functions from not being able to find the player.
if (!PlayerManager::RemovePlayer(this)) { if (!PlayerManager::RemovePlayer(this)) {
LOG("Unable to find player to remove from manager."); Log::Warn("Unable to find player to remove from manager.");
return; return;
} }

View File

@ -201,7 +201,7 @@ void EntityManager::KillEntities() {
auto* entity = GetEntity(toKill); auto* entity = GetEntity(toKill);
if (!entity) { if (!entity) {
LOG("Attempting to kill null entity %llu", toKill); Log::Warn("Attempting to kill null entity {}", toKill);
continue; continue;
} }
@ -231,7 +231,7 @@ void EntityManager::DeleteEntities() {
if (ghostingToDelete != m_EntitiesToGhost.end()) m_EntitiesToGhost.erase(ghostingToDelete); if (ghostingToDelete != m_EntitiesToGhost.end()) m_EntitiesToGhost.erase(ghostingToDelete);
} else { } else {
LOG("Attempted to delete non-existent entity %llu", toDelete); Log::Warn("Attempted to delete non-existent entity {}", toDelete);
} }
m_Entities.erase(toDelete); m_Entities.erase(toDelete);
} }
@ -322,7 +322,7 @@ const std::unordered_map<std::string, LWOOBJID>& EntityManager::GetSpawnPointEnt
void EntityManager::ConstructEntity(Entity* entity, const SystemAddress& sysAddr, const bool skipChecks) { void EntityManager::ConstructEntity(Entity* entity, const SystemAddress& sysAddr, const bool skipChecks) {
if (!entity) { if (!entity) {
LOG("Attempted to construct null entity"); Log::Warn("Attempted to construct null entity");
return; return;
} }

View File

@ -67,7 +67,7 @@ void Trade::SetAccepted(LWOOBJID participant, bool value) {
if (participant == m_ParticipantA) { if (participant == m_ParticipantA) {
m_AcceptedA = !value; m_AcceptedA = !value;
LOG("Accepted from A (%d), B: (%d)", value, m_AcceptedB); Log::Info("Accepted from A ({}), B: ({})", value, m_AcceptedB);
auto* entityB = GetParticipantBEntity(); auto* entityB = GetParticipantBEntity();
@ -77,7 +77,7 @@ void Trade::SetAccepted(LWOOBJID participant, bool value) {
} else if (participant == m_ParticipantB) { } else if (participant == m_ParticipantB) {
m_AcceptedB = !value; m_AcceptedB = !value;
LOG("Accepted from B (%d), A: (%d)", value, m_AcceptedA); Log::Info("Accepted from B ({}), A: ({})", value, m_AcceptedA);
auto* entityA = GetParticipantAEntity(); auto* entityA = GetParticipantAEntity();
@ -194,7 +194,7 @@ void Trade::SendUpdateToOther(LWOOBJID participant) {
uint64_t coins; uint64_t coins;
std::vector<TradeItem> itemIds; std::vector<TradeItem> itemIds;
LOG("Attempting to send trade update"); Log::Info("Attempting to send trade update");
if (participant == m_ParticipantA) { if (participant == m_ParticipantA) {
other = GetParticipantBEntity(); other = GetParticipantBEntity();
@ -228,7 +228,7 @@ void Trade::SendUpdateToOther(LWOOBJID participant) {
items.push_back(tradeItem); items.push_back(tradeItem);
} }
LOG("Sending trade update"); Log::Info("Sending trade update");
GameMessages::SendServerTradeUpdate(other->GetObjectID(), coins, items, other->GetSystemAddress()); GameMessages::SendServerTradeUpdate(other->GetObjectID(), coins, items, other->GetSystemAddress());
} }
@ -281,7 +281,7 @@ Trade* TradingManager::NewTrade(LWOOBJID participantA, LWOOBJID participantB) {
trades[tradeId] = trade; trades[tradeId] = trade;
LOG("Created new trade between (%llu) <-> (%llu)", participantA, participantB); Log::Info("Created new trade between ({}) <-> ({})", participantA, participantB);
return trade; return trade;
} }

View File

@ -75,31 +75,31 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
} }
if (!bitStream.Read(isImmune)) { if (!bitStream.Read(isImmune)) {
LOG("Unable to read isImmune"); Log::Warn("Unable to read isImmune");
return; return;
} }
if (isImmune) { if (isImmune) {
LOG_DEBUG("Target targetEntity %llu is immune!", branch.target); Log::Debug("Target targetEntity {} is immune!", branch.target);
this->m_OnFailImmune->Handle(context, bitStream, branch); this->m_OnFailImmune->Handle(context, bitStream, branch);
return; return;
} }
if (!bitStream.Read(isSuccess)) { if (!bitStream.Read(isSuccess)) {
LOG("failed to read success from bitstream"); Log::Warn("failed to read success from bitstream");
return; return;
} }
if (isSuccess) { if (isSuccess) {
uint32_t armorDamageDealt{}; uint32_t armorDamageDealt{};
if (!bitStream.Read(armorDamageDealt)) { if (!bitStream.Read(armorDamageDealt)) {
LOG("Unable to read armorDamageDealt"); Log::Warn("Unable to read armorDamageDealt");
return; return;
} }
uint32_t healthDamageDealt{}; uint32_t healthDamageDealt{};
if (!bitStream.Read(healthDamageDealt)) { if (!bitStream.Read(healthDamageDealt)) {
LOG("Unable to read healthDamageDealt"); Log::Warn("Unable to read healthDamageDealt");
return; return;
} }
@ -112,7 +112,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
bool died{}; bool died{};
if (!bitStream.Read(died)) { if (!bitStream.Read(died)) {
LOG("Unable to read died"); Log::Warn("Unable to read died");
return; return;
} }
auto previousArmor = destroyableComponent->GetArmor(); auto previousArmor = destroyableComponent->GetArmor();
@ -123,7 +123,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
uint8_t successState{}; uint8_t successState{};
if (!bitStream.Read(successState)) { if (!bitStream.Read(successState)) {
LOG("Unable to read success state"); Log::Warn("Unable to read success state");
return; return;
} }
@ -136,7 +136,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
break; break;
default: default:
if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) { if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) {
Log::Warn("Unknown success state ({:d})!", successState); Log::Warn("Unknown success state ({})!", successState);
return; return;
} }
this->m_OnFailImmune->Handle(context, bitStream, branch); this->m_OnFailImmune->Handle(context, bitStream, branch);
@ -166,13 +166,13 @@ void BasicAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitStream&
void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) { void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
auto* targetEntity = Game::entityManager->GetEntity(branch.target); auto* targetEntity = Game::entityManager->GetEntity(branch.target);
if (!targetEntity) { if (!targetEntity) {
LOG("Target entity %llu is null!", branch.target); Log::Warn("Target entity {} is null!", branch.target);
return; return;
} }
auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>(); auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
if (!destroyableComponent || !destroyableComponent->GetParent()) { if (!destroyableComponent || !destroyableComponent->GetParent()) {
LOG("No destroyable component on %llu", branch.target); Log::Warn("No destroyable component on {}", branch.target);
return; return;
} }
@ -191,7 +191,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
bitStream.Write(isImmune); bitStream.Write(isImmune);
if (isImmune) { if (isImmune) {
LOG_DEBUG("Target targetEntity %llu is immune!", branch.target); Log::Debug("Target targetEntity {} is immune!", branch.target);
this->m_OnFailImmune->Calculate(context, bitStream, branch); this->m_OnFailImmune->Calculate(context, bitStream, branch);
return; return;
} }
@ -241,7 +241,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
break; break;
default: default:
if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) { if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) {
Log::Warn("Unknown success state ({:d})!", GeneralUtils::ToUnderlying(successState)); Log::Warn("Unknown success state ({})!", GeneralUtils::ToUnderlying(successState));
break; break;
} }
this->m_OnFailImmune->Calculate(context, bitStream, branch); this->m_OnFailImmune->Calculate(context, bitStream, branch);

View File

@ -31,7 +31,7 @@ uint32_t BehaviorContext::GetUniqueSkillId() const {
auto* entity = Game::entityManager->GetEntity(this->originator); auto* entity = Game::entityManager->GetEntity(this->originator);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Invalid entity for (%llu)!", this->originator); Log::Warn("Invalid entity for ({})!", this->originator);
return 0; return 0;
} }
@ -39,7 +39,7 @@ uint32_t BehaviorContext::GetUniqueSkillId() const {
auto* component = entity->GetComponent<SkillComponent>(); auto* component = entity->GetComponent<SkillComponent>();
if (component == nullptr) { if (component == nullptr) {
LOG("No skill component attached to (%llu)!", this->originator);; Log::Warn("No skill component attached to ({})!", this->originator);;
return 0; return 0;
} }
@ -126,7 +126,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream& bit
} }
if (!found) { if (!found) {
Log::Warn("Failed to find behavior sync entry with sync id ({:d})!", syncId); Log::Warn("Failed to find behavior sync entry with sync id ({})!", syncId);
return; return;
} }
@ -135,7 +135,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream& bit
const auto branch = entry.branchContext; const auto branch = entry.branchContext;
if (behavior == nullptr) { if (behavior == nullptr) {
Log::Warn("Invalid behavior for sync id ({:d})!", syncId); Log::Warn("Invalid behavior for sync id ({})!", syncId);
return; return;
} }
@ -317,7 +317,7 @@ void BehaviorContext::FilterTargets(std::vector<Entity*>& targets, std::forward_
// if the caster is not there, return empty targets list // if the caster is not there, return empty targets list
auto* caster = Game::entityManager->GetEntity(this->caster); auto* caster = Game::entityManager->GetEntity(this->caster);
if (!caster) { if (!caster) {
Log::Debug("Invalid caster for ({:d})!", this->originator); Log::Debug("Invalid caster for ({})!", this->originator);
targets.clear(); targets.clear();
return; return;
} }

View File

@ -13,7 +13,7 @@ void BlockBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
auto* entity = Game::entityManager->GetEntity(target); auto* entity = Game::entityManager->GetEntity(target);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }
@ -43,7 +43,7 @@ void BlockBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branc
auto* entity = Game::entityManager->GetEntity(target); auto* entity = Game::entityManager->GetEntity(target);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }

View File

@ -13,7 +13,7 @@ void BuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream
auto* entity = Game::entityManager->GetEntity(target); auto* entity = Game::entityManager->GetEntity(target);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Invalid target (%llu)!", target); Log::Warn("Invalid target ({})!", target);
return; return;
} }
@ -21,7 +21,7 @@ void BuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream
auto* component = entity->GetComponent<DestroyableComponent>(); auto* component = entity->GetComponent<DestroyableComponent>();
if (component == nullptr) { if (component == nullptr) {
LOG("Invalid target, no destroyable component (%llu)!", target); Log::Warn("Invalid target, no destroyable component ({})!", target);
return; return;
} }
@ -47,7 +47,7 @@ void BuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch
auto* entity = Game::entityManager->GetEntity(target); auto* entity = Game::entityManager->GetEntity(target);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Invalid target (%llu)!", target); Log::Warn("Invalid target ({})!", target);
return; return;
} }
@ -55,7 +55,7 @@ void BuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch
auto* component = entity->GetComponent<DestroyableComponent>(); auto* component = entity->GetComponent<DestroyableComponent>();
if (component == nullptr) { if (component == nullptr) {
LOG("Invalid target, no destroyable component (%llu)!", target); Log::Warn("Invalid target, no destroyable component ({})!", target);
return; return;
} }

View File

@ -17,7 +17,7 @@ void CarBoostBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
return; return;
} }
LOG("Activating car boost!"); Log::Info("Activating car boost!");
auto* possessableComponent = entity->GetComponent<PossessableComponent>(); auto* possessableComponent = entity->GetComponent<PossessableComponent>();
if (possessableComponent != nullptr) { if (possessableComponent != nullptr) {
@ -27,7 +27,7 @@ void CarBoostBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
auto* characterComponent = possessor->GetComponent<CharacterComponent>(); auto* characterComponent = possessor->GetComponent<CharacterComponent>();
if (characterComponent != nullptr) { if (characterComponent != nullptr) {
LOG("Tracking car boost!"); Log::Info("Tracking car boost!");
characterComponent->UpdatePlayerStatistic(RacingCarBoostsActivated); characterComponent->UpdatePlayerStatistic(RacingCarBoostsActivated);
} }
} }

View File

@ -8,7 +8,7 @@ void ChargeUpBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
uint32_t handle{}; uint32_t handle{};
if (!bitStream.Read(handle)) { if (!bitStream.Read(handle)) {
LOG("Unable to read handle from bitStream, aborting Handle! variable_type"); Log::Warn("Unable to read handle from bitStream, aborting Handle! variable_type");
return; return;
}; };

View File

@ -11,7 +11,7 @@ void DamageAbsorptionBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
auto* target = Game::entityManager->GetEntity(branch.target); auto* target = Game::entityManager->GetEntity(branch.target);
if (target == nullptr) { if (target == nullptr) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }
@ -37,7 +37,7 @@ void DamageAbsorptionBehavior::Timer(BehaviorContext* context, BehaviorBranchCon
auto* target = Game::entityManager->GetEntity(second); auto* target = Game::entityManager->GetEntity(second);
if (target == nullptr) { if (target == nullptr) {
LOG("Failed to find target (%llu)!", second); Log::Warn("Failed to find target ({})!", second);
return; return;
} }

View File

@ -11,7 +11,7 @@ void DamageReductionBehavior::Handle(BehaviorContext* context, RakNet::BitStream
auto* target = Game::entityManager->GetEntity(branch.target); auto* target = Game::entityManager->GetEntity(branch.target);
if (target == nullptr) { if (target == nullptr) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }
@ -35,7 +35,7 @@ void DamageReductionBehavior::Timer(BehaviorContext* context, BehaviorBranchCont
auto* target = Game::entityManager->GetEntity(second); auto* target = Game::entityManager->GetEntity(second);
if (target == nullptr) { if (target == nullptr) {
LOG("Failed to find target (%llu)!", second); Log::Warn("Failed to find target ({})!", second);
return; return;
} }

View File

@ -11,7 +11,7 @@ void HealBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bit_strea
auto* entity = Game::entityManager->GetEntity(branch.target); auto* entity = Game::entityManager->GetEntity(branch.target);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Failed to find entity for (%llu)!", branch.target); Log::Warn("Failed to find entity for ({})!", branch.target);
return; return;
} }
@ -19,7 +19,7 @@ void HealBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bit_strea
auto* destroyable = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE)); auto* destroyable = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE));
if (destroyable == nullptr) { if (destroyable == nullptr) {
LOG("Failed to find destroyable component for %(llu)!", branch.target); Log::Warn("Failed to find destroyable component for ({})!", branch.target);
return; return;
} }

View File

@ -13,7 +13,7 @@ void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
auto* target = Game::entityManager->GetEntity(branch.target); auto* target = Game::entityManager->GetEntity(branch.target);
if (!target) { if (!target) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }
@ -59,7 +59,7 @@ void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext bra
auto* target = Game::entityManager->GetEntity(second); auto* target = Game::entityManager->GetEntity(second);
if (!target) { if (!target) {
LOG("Failed to find target (%llu)!", second); Log::Warn("Failed to find target ({})!", second);
return; return;
} }

View File

@ -64,7 +64,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
auto* entity = Game::entityManager->GetEntity(context->originator); auto* entity = Game::entityManager->GetEntity(context->originator);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Failed to find originator (%llu)!", context->originator); Log::Warn("Failed to find originator ({})!", context->originator);
return; return;
} }
@ -72,7 +72,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
auto* skillComponent = entity->GetComponent<SkillComponent>(); auto* skillComponent = entity->GetComponent<SkillComponent>();
if (skillComponent == nullptr) { if (skillComponent == nullptr) {
LOG("Failed to find skill component for (%llu)!", context->originator); Log::Warn("Failed to find skill component for ({})!", context->originator);
return; return;
@ -81,7 +81,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
auto* other = Game::entityManager->GetEntity(branch.target); auto* other = Game::entityManager->GetEntity(branch.target);
if (other == nullptr) { if (other == nullptr) {
LOG("Invalid projectile target (%llu)!", branch.target); Log::Warn("Invalid projectile target ({})!", branch.target);
return; return;
} }

View File

@ -11,7 +11,7 @@ void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bit_str
auto* entity = Game::entityManager->GetEntity(branch.target); auto* entity = Game::entityManager->GetEntity(branch.target);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Failed to find entity for (%llu)!", branch.target); Log::Warn("Failed to find entity for ({})!", branch.target);
return; return;
} }
@ -19,7 +19,7 @@ void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bit_str
auto* destroyable = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE)); auto* destroyable = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE));
if (destroyable == nullptr) { if (destroyable == nullptr) {
LOG("Failed to find destroyable component for %(llu)!", branch.target); Log::Warn("Failed to find destroyable component for ({})!", branch.target);
return; return;
} }

View File

@ -15,7 +15,7 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
auto* origin = Game::entityManager->GetEntity(context->originator); auto* origin = Game::entityManager->GetEntity(context->originator);
if (origin == nullptr) { if (origin == nullptr) {
LOG("Failed to find self entity (%llu)!", context->originator); Log::Warn("Failed to find self entity ({})!", context->originator);
return; return;
} }
@ -45,7 +45,7 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
); );
if (entity == nullptr) { if (entity == nullptr) {
Log::Warn("Failed to spawn entity ({:d})!", this->m_lot); Log::Warn("Failed to spawn entity ({})!", this->m_lot);
return; return;
} }
@ -82,7 +82,7 @@ void SpawnBehavior::Timer(BehaviorContext* context, const BehaviorBranchContext
auto* entity = Game::entityManager->GetEntity(second); auto* entity = Game::entityManager->GetEntity(second);
if (entity == nullptr) { if (entity == nullptr) {
LOG("Failed to find spawned entity (%llu)!", second); Log::Warn("Failed to find spawned entity ({})!", second);
return; return;
} }

View File

@ -17,14 +17,14 @@ void StunBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream
bool blocked{}; bool blocked{};
if (!bitStream.Read(blocked)) { if (!bitStream.Read(blocked)) {
LOG("Unable to read blocked from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits()); Log::Warn("Unable to read blocked from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
return; return;
}; };
auto* target = Game::entityManager->GetEntity(branch.target); auto* target = Game::entityManager->GetEntity(branch.target);
if (target == nullptr) { if (target == nullptr) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }
@ -47,7 +47,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStr
auto* self = Game::entityManager->GetEntity(context->originator); auto* self = Game::entityManager->GetEntity(context->originator);
if (self == nullptr) { if (self == nullptr) {
LOG("Invalid self entity (%llu)!", context->originator); Log::Warn("Invalid self entity ({})!", context->originator);
return; return;
} }
@ -82,7 +82,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStr
bitStream.Write(blocked); bitStream.Write(blocked);
if (target == nullptr) { if (target == nullptr) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }

View File

@ -11,7 +11,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
if (this->m_imagination > 0 || !this->m_isEnemyFaction) { if (this->m_imagination > 0 || !this->m_isEnemyFaction) {
if (!bitStream.Read(state)) { if (!bitStream.Read(state)) {
LOG("Unable to read state from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits()); Log::Warn("Unable to read state from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
return; return;
}; };
} }
@ -28,7 +28,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
return; return;
} }
LOG_DEBUG("[%i] State: (%d), imagination: (%i) / (%f)", entity->GetLOT(), state, destroyableComponent->GetImagination(), destroyableComponent->GetMaxImagination()); Log::Debug("[{}] State: ({}), imagination: ({}) / ({})", entity->GetLOT(), state, destroyableComponent->GetImagination(), destroyableComponent->GetMaxImagination());
if (state) { if (state) {
this->m_actionTrue->Handle(context, bitStream, branch); this->m_actionTrue->Handle(context, bitStream, branch);

View File

@ -13,7 +13,7 @@ void SwitchMultipleBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
float value{}; float value{};
if (!bitStream.Read(value)) { if (!bitStream.Read(value)) {
LOG("Unable to read value from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits()); Log::Warn("Unable to read value from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
return; return;
}; };

View File

@ -16,7 +16,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
if (this->m_usePickedTarget && branch.target != LWOOBJID_EMPTY) { if (this->m_usePickedTarget && branch.target != LWOOBJID_EMPTY) {
auto target = Game::entityManager->GetEntity(branch.target); auto target = Game::entityManager->GetEntity(branch.target);
if (!target) LOG("target %llu is null", branch.target); if (!target) Log::Warn("target {} is null", branch.target);
else { else {
targets.push_back(target); targets.push_back(target);
context->FilterTargets(targets, this->m_ignoreFactionList, this->m_includeFactionList, this->m_targetSelf, this->m_targetEnemy, this->m_targetFriend, this->m_targetTeam); context->FilterTargets(targets, this->m_ignoreFactionList, this->m_includeFactionList, this->m_targetSelf, this->m_targetEnemy, this->m_targetFriend, this->m_targetTeam);
@ -29,7 +29,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
bool hasTargets = false; bool hasTargets = false;
if (!bitStream.Read(hasTargets)) { if (!bitStream.Read(hasTargets)) {
LOG("Unable to read hasTargets from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits()); Log::Warn("Unable to read hasTargets from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
return; return;
}; };
@ -37,7 +37,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
bool blocked = false; bool blocked = false;
if (!bitStream.Read(blocked)) { if (!bitStream.Read(blocked)) {
LOG("Unable to read blocked from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits()); Log::Warn("Unable to read blocked from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
return; return;
}; };
@ -50,12 +50,12 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
if (hasTargets) { if (hasTargets) {
uint32_t count = 0; uint32_t count = 0;
if (!bitStream.Read(count)) { if (!bitStream.Read(count)) {
LOG("Unable to read count from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits()); Log::Warn("Unable to read count from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
return; return;
}; };
if (count > m_maxTargets) { if (count > m_maxTargets) {
LOG("Bitstream has too many targets Max:%i Recv:%i", this->m_maxTargets, count); Log::Warn("Bitstream has too many targets Max:{} Recv:{}", this->m_maxTargets, count);
return; return;
} }
@ -63,7 +63,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
LWOOBJID id{}; LWOOBJID id{};
if (!bitStream.Read(id)) { if (!bitStream.Read(id)) {
LOG("Unable to read id from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits()); Log::Warn("Unable to read id from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
return; return;
}; };
@ -71,7 +71,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
auto* canidate = Game::entityManager->GetEntity(id); auto* canidate = Game::entityManager->GetEntity(id);
if (canidate) targets.push_back(canidate); if (canidate) targets.push_back(canidate);
} else { } else {
LOG("Bitstream has LWOOBJID_EMPTY as a target!"); Log::Warn("Bitstream has LWOOBJID_EMPTY as a target!");
} }
} }
@ -85,7 +85,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
void TacArcBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) { void TacArcBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
auto* self = Game::entityManager->GetEntity(context->originator); auto* self = Game::entityManager->GetEntity(context->originator);
if (self == nullptr) { if (self == nullptr) {
LOG("Invalid self for (%llu)!", context->originator); Log::Warn("Invalid self for ({})!", context->originator);
return; return;
} }

View File

@ -10,7 +10,7 @@ void TauntBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
auto* target = Game::entityManager->GetEntity(branch.target); auto* target = Game::entityManager->GetEntity(branch.target);
if (target == nullptr) { if (target == nullptr) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }
@ -26,7 +26,7 @@ void TauntBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitSt
auto* target = Game::entityManager->GetEntity(branch.target); auto* target = Game::entityManager->GetEntity(branch.target);
if (target == nullptr) { if (target == nullptr) {
LOG("Failed to find target (%llu)!", branch.target); Log::Warn("Failed to find target ({})!", branch.target);
return; return;
} }

View File

@ -18,7 +18,7 @@ void VerifyBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitS
auto* self = Game::entityManager->GetEntity(context->originator); auto* self = Game::entityManager->GetEntity(context->originator);
if (self == nullptr) { if (self == nullptr) {
LOG("Invalid self for (%llu)", context->originator); Log::Warn("Invalid self for ({})", context->originator);
return; return;
} }

View File

@ -273,7 +273,7 @@ void ActivityComponent::Update(float deltaTime) {
// The timer has elapsed, start the instance // The timer has elapsed, start the instance
if (lobby->timer <= 0.0f) { if (lobby->timer <= 0.0f) {
LOG("Setting up instance."); Log::Info("Setting up instance.");
ActivityInstance* instance = NewInstance(); ActivityInstance* instance = NewInstance();
LoadPlayersIntoInstance(instance, lobby->players); LoadPlayersIntoInstance(instance, lobby->players);
instance->StartZone(); instance->StartZone();

View File

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

View File

@ -81,13 +81,13 @@ void BouncerComponent::LookupPetSwitch() {
Game::entityManager->SerializeEntity(m_Parent); Game::entityManager->SerializeEntity(m_Parent);
LOG("Loaded pet bouncer"); Log::Info("Loaded pet bouncer");
} }
} }
} }
if (!m_PetSwitchLoaded) { if (!m_PetSwitchLoaded) {
LOG("Failed to load pet bouncer"); Log::Warn("Failed to load pet bouncer");
m_Parent->AddCallbackTimer(0.5f, [this]() { m_Parent->AddCallbackTimer(0.5f, [this]() {
LookupPetSwitch(); LookupPetSwitch();

View File

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

View File

@ -50,7 +50,7 @@ ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity) : Phy
return; return;
if (entity->GetLOT() == 1) { if (entity->GetLOT() == 1) {
LOG("Using patch to load minifig physics"); Log::Info("Using patch to load minifig physics");
float radius = 1.5f; float radius = 1.5f;
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), radius, false); 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) { void ControllablePhysicsComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char"); tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) { if (!character) {
LOG("Failed to find char tag!"); Log::Warn("Failed to find char tag!");
return; return;
} }
@ -181,7 +181,7 @@ void ControllablePhysicsComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument* doc) { void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char"); tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) { if (!character) {
LOG("Failed to find char tag while updating XML!"); Log::Warn("Failed to find char tag while updating XML!");
return; return;
} }
@ -298,7 +298,7 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) {
void ControllablePhysicsComponent::ActivateBubbleBuff(eBubbleType bubbleType, bool specialAnims) { void ControllablePhysicsComponent::ActivateBubbleBuff(eBubbleType bubbleType, bool specialAnims) {
if (m_IsInBubble) { if (m_IsInBubble) {
LOG("Already in bubble"); Log::Warn("Already in bubble");
return; return;
} }
m_BubbleType = bubbleType; m_BubbleType = bubbleType;

View File

@ -188,7 +188,7 @@ void DestroyableComponent::Update(float deltaTime) {
void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) { void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest"); tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest");
if (!dest) { if (!dest) {
LOG("Failed to find dest tag!"); Log::Warn("Failed to find dest tag!");
return; return;
} }
@ -210,7 +210,7 @@ void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) { void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest"); tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest");
if (!dest) { if (!dest) {
LOG("Failed to find dest tag!"); Log::Warn("Failed to find dest tag!");
return; return;
} }

View File

@ -175,14 +175,14 @@ void InventoryComponent::AddItem(
const bool bound, const bool bound,
int32_t preferredSlot) { int32_t preferredSlot) {
if (count == 0) { if (count == 0) {
LOG("Attempted to add 0 of item (%i) to the inventory!", lot); Log::Warn("Attempted to add 0 of item ({}) to the inventory!", lot);
return; return;
} }
if (!Inventory::IsValidItem(lot)) { if (!Inventory::IsValidItem(lot)) {
if (lot > 0) { if (lot > 0) {
LOG("Attempted to add invalid item (%i) to the inventory!", lot); Log::Warn("Attempted to add invalid item ({} to the inventory!", lot);
} }
return; return;
@ -296,7 +296,7 @@ void InventoryComponent::AddItem(
bool InventoryComponent::RemoveItem(const LOT lot, const uint32_t count, eInventoryType inventoryType, const bool ignoreBound, const bool silent) { bool InventoryComponent::RemoveItem(const LOT lot, const uint32_t count, eInventoryType inventoryType, const bool ignoreBound, const bool silent) {
if (count == 0) { if (count == 0) {
LOG("Attempted to remove 0 of item (%i) from the inventory!", lot); Log::Warn("Attempted to remove 0 of item ({}) from the inventory!", lot);
return false; return false;
} }
if (inventoryType == INVALID) inventoryType = Inventory::FindInventoryTypeForLot(lot); if (inventoryType == INVALID) inventoryType = Inventory::FindInventoryTypeForLot(lot);
@ -478,7 +478,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
auto* inventoryElement = document->FirstChildElement("obj")->FirstChildElement("inv"); auto* inventoryElement = document->FirstChildElement("obj")->FirstChildElement("inv");
if (inventoryElement == nullptr) { if (inventoryElement == nullptr) {
LOG("Failed to find 'inv' xml element!"); Log::Warn("Failed to find 'inv' xml element!");
return; return;
} }
@ -486,7 +486,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
auto* bags = inventoryElement->FirstChildElement("bag"); auto* bags = inventoryElement->FirstChildElement("bag");
if (bags == nullptr) { if (bags == nullptr) {
LOG("Failed to find 'bags' xml element!"); Log::Warn("Failed to find 'bags' xml element!");
return; return;
} }
@ -512,7 +512,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
auto* items = inventoryElement->FirstChildElement("items"); auto* items = inventoryElement->FirstChildElement("items");
if (items == nullptr) { if (items == nullptr) {
LOG("Failed to find 'items' xml element!"); Log::Warn("Failed to find 'items' xml element!");
return; return;
} }
@ -527,7 +527,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
auto* inventory = GetInventory(static_cast<eInventoryType>(type)); auto* inventory = GetInventory(static_cast<eInventoryType>(type));
if (inventory == nullptr) { if (inventory == nullptr) {
LOG("Failed to find inventory (%i)!", type); Log::Warn("Failed to find inventory ({})!", type);
return; return;
} }
@ -600,7 +600,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
auto* inventoryElement = document->FirstChildElement("obj")->FirstChildElement("inv"); auto* inventoryElement = document->FirstChildElement("obj")->FirstChildElement("inv");
if (inventoryElement == nullptr) { if (inventoryElement == nullptr) {
LOG("Failed to find 'inv' xml element!"); Log::Warn("Failed to find 'inv' xml element!");
return; return;
} }
@ -623,7 +623,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
auto* bags = inventoryElement->FirstChildElement("bag"); auto* bags = inventoryElement->FirstChildElement("bag");
if (bags == nullptr) { if (bags == nullptr) {
LOG("Failed to find 'bags' xml element!"); Log::Warn("Failed to find 'bags' xml element!");
return; return;
} }
@ -642,7 +642,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
auto* items = inventoryElement->FirstChildElement("items"); auto* items = inventoryElement->FirstChildElement("items");
if (items == nullptr) { if (items == nullptr) {
LOG("Failed to find 'items' xml element!"); Log::Warn("Failed to find 'items' xml element!");
return; return;
} }
@ -917,7 +917,7 @@ void InventoryComponent::EquipScripts(Item* equippedItem) {
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID); CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name); auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
if (!itemScript) { if (!itemScript) {
LOG("null script?"); Log::Warn("null script?");
} }
itemScript->OnFactionTriggerItemEquipped(m_Parent, equippedItem->GetId()); itemScript->OnFactionTriggerItemEquipped(m_Parent, equippedItem->GetId());
} }
@ -932,7 +932,7 @@ void InventoryComponent::UnequipScripts(Item* unequippedItem) {
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID); CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name); auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
if (!itemScript) { if (!itemScript) {
LOG("null script?"); Log::Warn("null script?");
} }
itemScript->OnFactionTriggerItemUnequipped(m_Parent, unequippedItem->GetId()); itemScript->OnFactionTriggerItemUnequipped(m_Parent, unequippedItem->GetId());
} }
@ -1312,7 +1312,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
const auto entry = behaviors->GetSkillByID(result.skillID); const auto entry = behaviors->GetSkillByID(result.skillID);
if (entry.skillID == 0) { if (entry.skillID == 0) {
LOG("Failed to find buff behavior for skill (%i)!", result.skillID); Log::Warn("Failed to find buff behavior for skill ({})!", result.skillID);
continue; continue;
} }

View File

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

View File

@ -69,7 +69,7 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
auto* missionComponent = entity->GetComponent<MissionComponent>(); auto* missionComponent = entity->GetComponent<MissionComponent>();
if (!missionComponent) { if (!missionComponent) {
LOG("Unable to get mission component for Entity %llu", entity->GetObjectID()); Log::Warn("Unable to get mission component for Entity {}", entity->GetObjectID());
return; return;
} }

View File

@ -908,7 +908,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. // Set this to a variable so when this is called back from the player the timer doesn't fire off.
m_Parent->AddCallbackTimer(m_PetInfo.imaginationDrainRate, [playerDestroyableComponent, this, item]() { m_Parent->AddCallbackTimer(m_PetInfo.imaginationDrainRate, [playerDestroyableComponent, this, item]() {
if (!playerDestroyableComponent) { if (!playerDestroyableComponent) {
LOG("No petComponent and/or no playerDestroyableComponent"); Log::Warn("No petComponent and/or no playerDestroyableComponent");
return; return;
} }

View File

@ -361,10 +361,10 @@ void PhantomPhysicsComponent::SetDirection(const NiPoint3& pos) {
void PhantomPhysicsComponent::SpawnVertices() { void PhantomPhysicsComponent::SpawnVertices() {
if (!m_dpEntity) return; if (!m_dpEntity) return;
LOG("%llu", m_Parent->GetObjectID()); Log::Info("{}", m_Parent->GetObjectID());
auto box = static_cast<dpShapeBox*>(m_dpEntity->GetShape()); auto box = static_cast<dpShapeBox*>(m_dpEntity->GetShape());
for (auto vert : box->GetVertices()) { for (auto vert : box->GetVertices()) {
LOG("%f, %f, %f", vert.x, vert.y, vert.z); Log::Info("{}, {}, {}", vert.x, vert.y, vert.z);
EntityInfo info; EntityInfo info;
info.lot = 33; info.lot = 33;

View File

@ -219,7 +219,7 @@ void PropertyEntranceComponent::OnPropertyEntranceSync(Entity* entity, bool incl
delete nameLookup; delete nameLookup;
nameLookup = nullptr; nameLookup = nullptr;
LOG("Failed to find property owner name for %llu!", cloneId); Log::Warn("Failed to find property owner name for {}!", cloneId);
continue; continue;
} else { } else {

View File

@ -266,7 +266,7 @@ void PropertyManagementComponent::OnFinishBuilding() {
} }
void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const NiPoint3 position, NiQuaternion rotation) { void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const NiPoint3 position, NiQuaternion rotation) {
LOG("Placing model <%f, %f, %f>", position.x, position.y, position.z); Log::Info("Placing model <{}, {}, {}>", position.x, position.y, position.z);
auto* entity = GetOwner(); auto* entity = GetOwner();
@ -283,7 +283,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
auto* item = inventoryComponent->FindItemById(id); auto* item = inventoryComponent->FindItemById(id);
if (item == nullptr) { if (item == nullptr) {
LOG("Failed to find item with id %d", id); Log::Warn("Failed to find item with id {}", id);
return; return;
} }
@ -381,7 +381,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
} }
void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason) { void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason) {
LOG("Delete model: (%llu) (%i)", id, deleteReason); Log::Info("Delete model: ({}) ({})", id, deleteReason);
auto* entity = GetOwner(); auto* entity = GetOwner();
@ -398,13 +398,13 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
auto* model = Game::entityManager->GetEntity(id); auto* model = Game::entityManager->GetEntity(id);
if (model == nullptr) { if (model == nullptr) {
LOG("Failed to find model entity"); Log::Warn("Failed to find model entity");
return; return;
} }
if (model->GetLOT() == 14 && deleteReason == 0) { if (model->GetLOT() == 14 && deleteReason == 0) {
LOG("User is trying to pick up a BBB model, but this is not implemented, so we return to prevent the user from losing the model"); Log::Info("User is trying to pick up a BBB model, but this is not implemented, so we return to prevent the user from losing the model");
GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(entity->GetObjectID(), entity->GetSystemAddress(), LWOOBJID_EMPTY, 0); GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(entity->GetObjectID(), entity->GetSystemAddress(), LWOOBJID_EMPTY, 0);
@ -417,7 +417,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
const auto index = models.find(id); const auto index = models.find(id);
if (index == models.end()) { if (index == models.end()) {
LOG("Failed to find model"); Log::Warn("Failed to find model");
return; return;
} }
@ -429,12 +429,12 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
models.erase(id); models.erase(id);
if (spawner == nullptr) { if (spawner == nullptr) {
LOG("Failed to find spawner"); Log::Warn("Failed to find spawner");
} }
Game::entityManager->DestructEntity(model); Game::entityManager->DestructEntity(model);
LOG("Deleting model LOT %i", model->GetLOT()); Log::Info("Deleting model LOT {}", model->GetLOT());
if (model->GetLOT() == 14) { if (model->GetLOT() == 14) {
//add it to the inv //add it to the inv
@ -517,13 +517,13 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
{ {
item->SetCount(item->GetCount() - 1); item->SetCount(item->GetCount() - 1);
LOG("DLU currently does not support breaking apart brick by brick models."); Log::Info("DLU currently does not support breaking apart brick by brick models.");
break; break;
} }
default: default:
{ {
LOG("Invalid delete reason"); Log::Warn("Invalid delete reason");
} }
} }
@ -685,7 +685,7 @@ void PropertyManagementComponent::OnQueryPropertyData(Entity* originator, const
const auto zoneId = worldId.GetMapID(); const auto zoneId = worldId.GetMapID();
const auto cloneId = worldId.GetCloneID(); const auto cloneId = worldId.GetCloneID();
LOG("Getting property info for %d", zoneId); Log::Info("Getting property info for {}", zoneId);
GameMessages::PropertyDataMessage message = GameMessages::PropertyDataMessage(zoneId); GameMessages::PropertyDataMessage message = GameMessages::PropertyDataMessage(zoneId);
const auto isClaimed = GetOwnerId() != LWOOBJID_EMPTY; const auto isClaimed = GetOwnerId() != LWOOBJID_EMPTY;