Make logger automatically put a newline (#675)

at the end of the line
remove all the newlines in log calls
This commit is contained in:
Aaron Kimbrell
2022-07-24 21:26:51 -05:00
committed by GitHub
parent a7fb6eb3f3
commit e97ae92624
86 changed files with 1249 additions and 1252 deletions

View File

@@ -22,7 +22,7 @@
void BossSpiderQueenEnemyServer::OnStartup(Entity* self) {
// Make immune to stuns
//self:SetStunImmunity{ StateChangeType = "PUSH", bImmuneToStunAttack = true, bImmuneToStunMove = true, bImmuneToStunTurn = true, bImmuneToStunUseItem = true, bImmuneToStunEquip = true, bImmuneToStunInteract = true, bImmuneToStunJump = true }
// Make immune to knockbacks and pulls
//self:SetStatusImmunity{ StateChangeType = "PUSH", bImmuneToPullToPoint = true, bImmuneToKnockback = true, bImmuneToInterrupt = true }
@@ -60,7 +60,7 @@ void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
missionComponent->CompleteMission(instanceMissionID);
}
Game::logger->Log("BossSpiderQueenEnemyServer", "Starting timer...\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Starting timer...");
// There is suppose to be a 0.1 second delay here but that may be admitted?
auto* controller = EntityManager::Instance()->GetZoneControlEntity();
@@ -88,15 +88,15 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
//First rotate for anim
NiQuaternion rot = NiQuaternion::IDENTITY;
controllable->SetStatic(false);
controllable->SetRotation(rot);
controllable->SetStatic(true);
controllable->SetDirtyPosition(true);
rot = controllable->GetRotation();
EntityManager::Instance()->SerializeEntity(self);
@@ -122,10 +122,10 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
}
else {
controllable->SetStatic(false);
//Cancel all remaining timers for say idle anims:
self->CancelAllTimers();
auto* baseCombatAi = self->GetComponent<BaseCombatAIComponent>();
baseCombatAi->SetDisabled(false);
@@ -133,7 +133,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
// Move the Spider to its ground location
// preparing its stage attacks, and removing invulnerability
//destroyable->SetIsImmune(false);
// Run the advance animation and prepare a timer for resuming AI
float animTime = PlayAnimAndReturnTime(self, spiderAdvanceAnim);
animTime += 1.f;
@@ -142,19 +142,19 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
destroyable->SetFaction(4);
destroyable->SetIsImmune(false);
//Advance stage
m_CurrentBossStage++;
//Reset the current wave death counter
m_DeathCounter = 0;
EntityManager::Instance()->SerializeEntity(self);
// Prepare a timer for post leap attack
self->AddTimer("AdvanceAttack", attackPause);
// Prepare a timer for post leap
// Prepare a timer for post leap
self->AddTimer("AdvanceComplete", animTime);
}
@@ -162,7 +162,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
}
void BossSpiderQueenEnemyServer::SpawnSpiderWave(Entity* self, int spiderCount) {
// The Spider Queen Boss is withdrawing and requesting the spawn
// The Spider Queen Boss is withdrawing and requesting the spawn
// of a hatchling wave
/*auto SpiderEggNetworkID = self->GetI64(u"SpiderEggNetworkID");
@@ -176,7 +176,7 @@ void BossSpiderQueenEnemyServer::SpawnSpiderWave(Entity* self, int spiderCount)
hatchCounter = spiderCount;
hatchList = {};
Game::logger->Log("SpiderQueen", "Trying to spawn %i spiders\n", hatchCounter);
Game::logger->Log("SpiderQueen", "Trying to spawn %i spiders", hatchCounter);
// Run the wave manager
@@ -189,19 +189,19 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
// Reset the spider egg spawner network to ensure a maximum number of eggs
//SpiderEggNetworkID:SpawnerReset()
// Obtain a list of all the eggs on the egg spawner network
//auto spiderEggList = SpiderEggNetworkID:SpawnerGetAllObjectIDsSpawned().objects;
//if (table.maxn(spiderEggList) <= 0) {
//if (table.maxn(spiderEggList) <= 0) {
// self->AddTimer("PollSpiderWaveManager", 1.0f);
// return;
//}
//
//// A check for (wave mangement across multiple spawn iterations
//if(hatchCounter < spiderWaveCnt) {
// // We have already prepped some objects for (hatching,
// // We have already prepped some objects for (hatching,
// // remove them from our list for (random egg pulls
// for (i, sVal in ipairs(spiderEggList) {
// if(hatchList[sVal:GetID()]) {
@@ -220,8 +220,8 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
for (auto spodder : spooders) {
spiderEggs.push_back(spodder->GetObjectID());
}
// Select a number of random spider eggs from the list equal to the
// Select a number of random spider eggs from the list equal to the
// current number needed to complete the current wave
for (int i = 0; i < hatchCounter; i++) {
// Select a random spider egg
@@ -235,7 +235,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
randomEgg = spiderEggs[randomEggLoc];
}
}
if (randomEgg) {
auto* eggEntity = EntityManager::Instance()->GetEntity(randomEgg);
@@ -246,24 +246,24 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
// Prep the selected spider egg
//randomEgg:FireEvent{s}erID=self, args="prepEgg"}
eggEntity->OnFireEventServerSide(self, "prepEgg");
Game::logger->Log("SpiderQueen", "Prepping egg %llu\n", eggEntity->GetObjectID());
Game::logger->Log("SpiderQueen", "Prepping egg %llu", eggEntity->GetObjectID());
// Add the prepped egg to our hatchList
hatchList.push_back(eggEntity->GetObjectID());
// Decrement the hatchCounter
hatchCounter = hatchCounter - 1;
}
// Remove it from our spider egg list
//table.remove(spiderEggList, randomEggLoc);
spiderEggs[randomEggLoc] = LWOOBJID_EMPTY;
if (spiderEggs.size() <= 0 || (hatchCounter <= 0)) {
if (spiderEggs.size() <= 0 || (hatchCounter <= 0)) {
break;
}
}
if (hatchCounter > 0) {
// We still have more eggs to hatch, poll the SpiderWaveManager again
self->AddTimer("PollSpiderWaveManager", 1.0f);
@@ -280,20 +280,20 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
}
eggEntity->OnFireEventServerSide(self, "hatchEgg");
Game::logger->Log("SpiderQueen", "hatching egg %llu\n", eggEntity->GetObjectID());
Game::logger->Log("SpiderQueen", "hatching egg %llu", eggEntity->GetObjectID());
auto time = PlayAnimAndReturnTime(self, spiderWithdrawIdle);
combat->SetStunImmune(false);
combat->Stun(time += 6.0f);
combat->SetStunImmune(true);
//self->AddTimer("disableWaitForIdle", defaultAnimPause);
self->AddTimer("checkForSpiders", 6.0f);
}
hatchList.clear();
}
}
@@ -322,7 +322,7 @@ void BossSpiderQueenEnemyServer::RunRainOfFire(Entity* self)
for (const auto& rofGroup : ROFTargetGroupIDTable)
{
const auto spawners = dZoneManager::Instance()->GetSpawnersInGroup(rofGroup);
std::vector<LWOOBJID> spawned;
for (auto* spawner : spawners)
@@ -352,7 +352,7 @@ void BossSpiderQueenEnemyServer::RunRainOfFire(Entity* self)
self->AddTimer("StartROF", animTime);
}
void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self)
void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self)
{
if (!impactList.empty())
{
@@ -362,7 +362,7 @@ void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self)
if (entity == nullptr)
{
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact!\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact!");
return;
}
@@ -371,8 +371,8 @@ void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self)
if (skillComponent == nullptr)
{
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact skill component!\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact skill component!");
return;
}
@@ -384,7 +384,7 @@ void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self)
}
ToggleForSpecial(self, false);
self->AddTimer("ROF", GeneralUtils::GenerateRandomNumber<float>(20, 40));
}
@@ -402,7 +402,7 @@ void BossSpiderQueenEnemyServer::RapidFireShooterManager(Entity* self)
}
const auto target = attackTargetTable[0];
auto* skillComponent = self->GetComponent<SkillComponent>();
skillComponent->CalculateBehavior(1394, 32612, target, true);
@@ -412,7 +412,7 @@ void BossSpiderQueenEnemyServer::RapidFireShooterManager(Entity* self)
self->AddTimer("PollRFSManager", 0.3f);
}
void BossSpiderQueenEnemyServer::RunRapidFireShooter(Entity* self)
void BossSpiderQueenEnemyServer::RunRapidFireShooter(Entity* self)
{
/*
const auto targets = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_CHARACTER);
@@ -429,7 +429,7 @@ void BossSpiderQueenEnemyServer::RunRapidFireShooter(Entity* self)
if (targets.empty())
{
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find RFS targets\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find RFS targets");
self->AddTimer("RFS", GeneralUtils::GenerateRandomNumber<float>(5, 10));
@@ -452,7 +452,7 @@ void BossSpiderQueenEnemyServer::RunRapidFireShooter(Entity* self)
PlayAnimAndReturnTime(self, spiderSingleShot);
Game::logger->Log("BossSpiderQueenEnemyServer", "Ran RFS\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Ran RFS");
self->AddTimer("RFS", GeneralUtils::GenerateRandomNumber<float>(10, 15));
}
@@ -487,7 +487,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
//If there are still baby spiders, don't do anyhting either
const auto spiders = EntityManager::Instance()->GetEntitiesInGroup("BabySpider");
if (spiders.size() > 0)
if (spiders.size() > 0)
self->AddTimer("checkForSpiders", time);
else
WithdrawSpider(self, false);
@@ -496,30 +496,30 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
//Call the manager again to attempt to initiate an impact on another random location
//Run the ROF Manager
RainOfFireManager(self);
} else if ( timerName == "PollRFSManager") {
//Call the manager again to attempt to initiate a rapid fire shot at the next sequential target
//Run the ROF Manager
RapidFireShooterManager(self);
} else if ( timerName == "StartROF") {
//Re-enable Spider Boss
//ToggleForSpecial(self, false);
RainOfFireManager(self);
} else if ( timerName == "PollSpiderSkillManager") {
//Call the skill manager again to attempt to run the current Spider Boss
//stage's special attack again
//SpiderSkillManager(self, true);
PlayAnimAndReturnTime(self, spiderJeerAnim);
} else if ( timerName == "RFS") {
RunRapidFireShooter(self);
} else if ( timerName == "ROF") {
RunRainOfFire(self);
} else if ( timerName == "RFSTauntComplete") {
//Determine an appropriate random time to check our manager again
} else if ( timerName == "RFSTauntComplete") {
//Determine an appropriate random time to check our manager again
// local spiderCooldownDelay = math.random(s1DelayMin, s1DelayMax)
//Set a timer based on our random cooldown determination
@@ -529,7 +529,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
//Re-enable Spider Boss
//ToggleForSpecial(self, false);
} else if ( timerName == "WithdrawComplete") {
//Play the Spider Boss' mountain idle anim
PlayAnimAndReturnTime(self, spiderWithdrawIdle);
@@ -545,19 +545,19 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
if (currentStage > 1) hatchCounter++;
SpawnSpiderWave(self, spiderWaveCntTable[currentStage - 1]);
} else if ( timerName == "AdvanceAttack") {
} else if ( timerName == "AdvanceAttack") {
//TODO: Can we even do knockbacks yet? @Wincent01
// Yes ^
//Fire the melee smash skill to throw players back
/*local landingTarget = self:GetVar("LandingTarget") or false
if((landingTarget) and (landingTarget:Exists())) {
local advSmashFlag = landingTarget:CastSkill{skillID = bossLandingSkill}
landingTarget:PlayEmbeddedEffectOnAllClientsNearObject{radius = 100, fromObjectID = landingTarget, effectName = "camshake-bridge"}
}*/
auto landingTarget = self->GetI64(u"LandingTarget");
auto landingEntity = EntityManager::Instance()->GetEntity(landingTarget);
@@ -567,7 +567,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
{
skillComponent->CalculateBehavior(bossLandingSkill, 37739, LWOOBJID_EMPTY);
}
if (landingEntity) {
auto* landingSkill = landingEntity->GetComponent<SkillComponent>();
@@ -578,12 +578,12 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
}
GameMessages::SendPlayEmbeddedEffectOnAllClientsNearObject(self, u"camshake-bridge", self->GetObjectID(), 100.0f);
} else if ( timerName == "AdvanceComplete") {
} else if ( timerName == "AdvanceComplete") {
//Reset faction and collision
/*local SBFactionList = self:GetVar("SBFactionList")
local SBCollisionGroup = self:GetVar("SBCollisionGroup")
for i, fVal in ipairs(SBFactionList) {
if(i == 1) {
//Our first faction - flush and add
@@ -596,18 +596,18 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
/*
auto SBCollisionGroup = self->GetI32(u"SBCollisionGroup");
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", SBCollisionGroup, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
*/
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", 11, 0, 0, "", UNASSIGNED_SYSTEM_ADDRESS);
//Wind up, telegraphing next round
float animTime = PlayAnimAndReturnTime(self, spiderJeerAnim);
self->AddTimer("AdvanceTauntComplete", animTime);
} else if ( timerName == "AdvanceTauntComplete") {
//Declare a default special Spider Boss skill cooldown
int spiderCooldownDelay = 10;
@@ -620,11 +620,11 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
//Set a timer based on our random cooldown determination
//to pulse the SpiderSkillManager
self->AddTimer("PollSpiderSkillManager", spiderCooldownDelay);
//Remove current status immunity
/*self:SetStatusImmunity{ StateChangeType = "POP", bImmuneToSpeed = true, bImmuneToBasicAttack = true, bImmuneToDOT = true}
self:SetStunned{StateChangeType = "POP",
self:SetStunned{StateChangeType = "POP",
bCantMove = true,
bCantJump = true,
bCantTurn = true,
@@ -638,14 +638,14 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
destroyable->SetFaction(4);
EntityManager::Instance()->SerializeEntity(self);
} else if ( timerName == "Clear") {
EntityManager::Instance()->FireEventServerSide(self, "ClearProperty");
self->CancelAllTimers();
} else if ( timerName == "UnlockSpecials") {
//We no longer need to lock specials
self->SetBoolean(u"bSpecialLock", false);
//Did we queue a spcial attack?
if(self->GetBoolean(u"bSpecialQueued")) {
self->SetBoolean(u"bSpecialQueued", false);
@@ -723,17 +723,17 @@ float BossSpiderQueenEnemyServer::PlayAnimAndReturnTime(Entity* self, const std:
//TODO: Get the actual animation time
// Get the anim time
float animTimer = defaultAnimPause; //self:GetAnimationTime{animationID = animID}.time
float animTimer = defaultAnimPause; //self:GetAnimationTime{animationID = animID}.time
// If we have an animation play it
if (animTimer > 0) {
GameMessages::SendPlayAnimation(self, animID);
}
// If the anim time is less than the the default time use default
if (animTimer < defaultAnimPause) {
animTimer = defaultAnimPause;
}
return animTimer;
}