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

@@ -75,31 +75,31 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
}
if (!bitStream.Read(isImmune)) {
LOG("Unable to read isImmune");
Log::Warn("Unable to read isImmune");
return;
}
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);
return;
}
if (!bitStream.Read(isSuccess)) {
LOG("failed to read success from bitstream");
Log::Warn("failed to read success from bitstream");
return;
}
if (isSuccess) {
uint32_t armorDamageDealt{};
if (!bitStream.Read(armorDamageDealt)) {
LOG("Unable to read armorDamageDealt");
Log::Warn("Unable to read armorDamageDealt");
return;
}
uint32_t healthDamageDealt{};
if (!bitStream.Read(healthDamageDealt)) {
LOG("Unable to read healthDamageDealt");
Log::Warn("Unable to read healthDamageDealt");
return;
}
@@ -112,7 +112,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
bool died{};
if (!bitStream.Read(died)) {
LOG("Unable to read died");
Log::Warn("Unable to read died");
return;
}
auto previousArmor = destroyableComponent->GetArmor();
@@ -123,7 +123,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
uint8_t successState{};
if (!bitStream.Read(successState)) {
LOG("Unable to read success state");
Log::Warn("Unable to read success state");
return;
}
@@ -136,7 +136,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
break;
default:
if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) {
Log::Warn("Unknown success state ({:d})!", successState);
Log::Warn("Unknown success state ({})!", successState);
return;
}
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) {
auto* targetEntity = Game::entityManager->GetEntity(branch.target);
if (!targetEntity) {
LOG("Target entity %llu is null!", branch.target);
Log::Warn("Target entity {} is null!", branch.target);
return;
}
auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
if (!destroyableComponent || !destroyableComponent->GetParent()) {
LOG("No destroyable component on %llu", branch.target);
Log::Warn("No destroyable component on {}", branch.target);
return;
}
@@ -191,7 +191,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
bitStream.Write(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);
return;
}
@@ -241,7 +241,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
break;
default:
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;
}
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);
if (entity == nullptr) {
LOG("Invalid entity for (%llu)!", this->originator);
Log::Warn("Invalid entity for ({})!", this->originator);
return 0;
}
@@ -39,7 +39,7 @@ uint32_t BehaviorContext::GetUniqueSkillId() const {
auto* component = entity->GetComponent<SkillComponent>();
if (component == nullptr) {
LOG("No skill component attached to (%llu)!", this->originator);;
Log::Warn("No skill component attached to ({})!", this->originator);;
return 0;
}
@@ -126,7 +126,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream& bit
}
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;
}
@@ -135,7 +135,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream& bit
const auto branch = entry.branchContext;
if (behavior == nullptr) {
Log::Warn("Invalid behavior for sync id ({:d})!", syncId);
Log::Warn("Invalid behavior for sync id ({})!", syncId);
return;
}
@@ -317,7 +317,7 @@ void BehaviorContext::FilterTargets(std::vector<Entity*>& targets, std::forward_
// if the caster is not there, return empty targets list
auto* caster = Game::entityManager->GetEntity(this->caster);
if (!caster) {
Log::Debug("Invalid caster for ({:d})!", this->originator);
Log::Debug("Invalid caster for ({})!", this->originator);
targets.clear();
return;
}

View File

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

View File

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

View File

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

View File

@@ -8,7 +8,7 @@ void ChargeUpBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
uint32_t 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;
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -11,7 +11,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
if (this->m_imagination > 0 || !this->m_isEnemyFaction) {
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;
};
}
@@ -28,7 +28,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
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) {
this->m_actionTrue->Handle(context, bitStream, branch);

View File

@@ -13,7 +13,7 @@ void SwitchMultipleBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
float 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;
};

View File

@@ -16,7 +16,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
if (this->m_usePickedTarget && branch.target != LWOOBJID_EMPTY) {
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 {
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);
@@ -29,7 +29,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
bool hasTargets = false;
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;
};
@@ -37,7 +37,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
bool blocked = false;
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;
};
@@ -50,12 +50,12 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
if (hasTargets) {
uint32_t count = 0;
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;
};
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;
}
@@ -63,7 +63,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
LWOOBJID 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;
};
@@ -71,7 +71,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
auto* canidate = Game::entityManager->GetEntity(id);
if (canidate) targets.push_back(canidate);
} 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) {
auto* self = Game::entityManager->GetEntity(context->originator);
if (self == nullptr) {
LOG("Invalid self for (%llu)!", context->originator);
Log::Warn("Invalid self for ({})!", context->originator);
return;
}

View File

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

View File

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