From 32da0c07c9e6f5bae201300c89b2ec10c5d73a08 Mon Sep 17 00:00:00 2001 From: qcloud Date: Mon, 22 May 2023 23:14:17 +0800 Subject: [PATCH] feat: log action --- .gitignore | 1 + src/AiFactory.cpp | 4 ++-- src/strategy/Engine.cpp | 2 +- src/strategy/actions/LfgActions.cpp | 24 ++++++++++++------------ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index ef5db6e0..44201dff 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ local.properties .loadpath .project .cproject +.vscode \ No newline at end of file diff --git a/src/AiFactory.cpp b/src/AiFactory.cpp index 8b21ccf8..d5ee476d 100644 --- a/src/AiFactory.cpp +++ b/src/AiFactory.cpp @@ -577,7 +577,7 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const nonCombatEngine->addStrategy("pvp"); nonCombatEngine->addStrategy("collision"); nonCombatEngine->addStrategy("grind"); - nonCombatEngine->addStrategy("group"); + // nonCombatEngine->addStrategy("group"); nonCombatEngine->addStrategy("guild"); if (sPlayerbotAIConfig->autoDoQuests) @@ -606,7 +606,7 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const nonCombatEngine->addStrategy("pvp"); nonCombatEngine->addStrategy("collision"); nonCombatEngine->addStrategy("grind"); - nonCombatEngine->addStrategy("group"); + // nonCombatEngine->addStrategy("group"); nonCombatEngine->addStrategy("guild"); if (sPlayerbotAIConfig->autoDoQuests) diff --git a/src/strategy/Engine.cpp b/src/strategy/Engine.cpp index 7f64d91d..414a94b1 100644 --- a/src/strategy/Engine.cpp +++ b/src/strategy/Engine.cpp @@ -643,7 +643,7 @@ void Engine::LogAction(char const* format, ...) if (sPlayerbotAIConfig->logInGroupOnly && !bot->GetGroup()) return; - LOG_INFO("playerbots", "{} {}", bot->GetName().c_str(), buf); + LOG_INFO("playerbots", "{} {} {} {}", bot->GetName().c_str(), buf, sPlayerbotAIConfig->logInGroupOnly, bot->GetGroup()->GetGroupType()); } } diff --git a/src/strategy/actions/LfgActions.cpp b/src/strategy/actions/LfgActions.cpp index 5f198685..e476754f 100644 --- a/src/strategy/actions/LfgActions.cpp +++ b/src/strategy/actions/LfgActions.cpp @@ -100,17 +100,17 @@ bool LfgJoinAction::JoinLFG() for (std::vector::iterator i = dungeons.begin(); i != dungeons.end(); ++i) { LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(*i); - if (!dungeon || (dungeon->type != LFG_TYPE_RANDOM && dungeon->type != LFG_TYPE_DUNGEON && dungeon->type != LFG_TYPE_HEROIC && dungeon->type != LFG_TYPE_RAID)) + if (!dungeon || (dungeon->TypeID != LFG_TYPE_RANDOM && dungeon->TypeID != LFG_TYPE_DUNGEON && dungeon->TypeID != LFG_TYPE_HEROIC && dungeon->TypeID != LFG_TYPE_RAID)) continue; uint32 botLevel = bot->getLevel(); - if (dungeon->minlevel && botLevel < dungeon->minlevel) + if (dungeon->MinLevel && botLevel < dungeon->MinLevel) continue; - if (dungeon->minlevel && botLevel > dungeon->minlevel + 10) + if (dungeon->MinLevel && botLevel > dungeon->MinLevel + 10) continue; - if (dungeon->maxlevel && botLevel > dungeon->maxlevel) + if (dungeon->MaxLevel && botLevel > dungeon->MaxLevel) continue; selected.push_back(dungeon->ID); @@ -134,13 +134,13 @@ bool LfgJoinAction::JoinLFG() continue; uint32 botLevel = bot->getLevel(); - if (dungeon->minlevel && botLevel < dungeon->minlevel) + if (dungeon->MinLevel && botLevel < dungeon->MinLevel) continue; - if (dungeon->minlevel && botLevel > dungeon->minlevel + 10) + if (dungeon->MinLevel && botLevel > dungeon->MinLevel + 10) continue; - if (dungeon->maxlevel && botLevel > dungeon->maxlevel) + if (dungeon->MaxLevel && botLevel > dungeon->MaxLevel) continue; if (heroic && !dungeon->difficulty) @@ -173,7 +173,7 @@ bool LfgJoinAction::JoinLFG() LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Dungeon as {} ({})", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", - bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->name[0]); + bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]); /*if (lfgState->IsSingleRole()) { @@ -213,7 +213,7 @@ bool LfgJoinAction::JoinLFG() pState->SetType(LFG_TYPE_RANDOM_DUNGEON); LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Random Dungeon as {} ({})", - bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, dungeon->name[0]); + bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, dungeon->Name[0]); return true; } else if (heroic) @@ -221,19 +221,19 @@ bool LfgJoinAction::JoinLFG() pState->SetType(LFG_TYPE_HEROIC_DUNGEON); LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Heroic Dungeon as {} ({})", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", - bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->name[0]); + bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]); } else if (rbotAId) { pState->SetType(LFG_TYPE_RAID); LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, RbotAId as {} ({})", - bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->name[0]); + bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]); } else { pState->SetType(LFG_TYPE_DUNGEON); LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Dungeon as {} ({})", - bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->name[0]); + bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]); }*/ // Set RbotAId Browser comment