From 5ca7c719201bcd81c8dadf0196193e2ddfd3d4a6 Mon Sep 17 00:00:00 2001 From: Yunfan Date: Mon, 2 Dec 2024 11:48:51 +0800 Subject: [PATCH] Logs and rpg status for new rpg strats --- src/RandomPlayerbotMgr.cpp | 20 +++++++++++--------- src/strategy/generic/NewRpgStrategy.h | 11 +++++++++-- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index caf594bf..b24cf8d9 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -2661,15 +2661,17 @@ void RandomPlayerbotMgr::PrintStats() LOG_INFO("playerbots", " In BG: {}", inBg); LOG_INFO("playerbots", " In Rest: {}", rest); LOG_INFO("playerbots", " Dead: {}", dead); - - LOG_INFO("playerbots", "Bots rpg status:", dead); - LOG_INFO("playerbots", " IDLE: {}", rpgStatusCount[NewRpgStatus::IDLE]); - LOG_INFO("playerbots", " REST: {}", rpgStatusCount[NewRpgStatus::REST]); - LOG_INFO("playerbots", " GO_GRIND: {}", rpgStatusCount[NewRpgStatus::GO_GRIND]); - LOG_INFO("playerbots", " GO_INNKEEPER: {}", rpgStatusCount[NewRpgStatus::GO_INNKEEPER]); - LOG_INFO("playerbots", " NEAR_RANDOM: {}", rpgStatusCount[NewRpgStatus::NEAR_RANDOM]); - LOG_INFO("playerbots", " NEAR_NPC: {}", rpgStatusCount[NewRpgStatus::NEAR_NPC]); - + if (sPlayerbotAIConfig->enableNewRpgStrategy) + { + LOG_INFO("playerbots", "Bots rpg status:", dead); + LOG_INFO("playerbots", " IDLE: {}", rpgStatusCount[NewRpgStatus::IDLE]); + LOG_INFO("playerbots", " REST: {}", rpgStatusCount[NewRpgStatus::REST]); + LOG_INFO("playerbots", " GO_GRIND: {}", rpgStatusCount[NewRpgStatus::GO_GRIND]); + LOG_INFO("playerbots", " GO_INNKEEPER: {}", rpgStatusCount[NewRpgStatus::GO_INNKEEPER]); + LOG_INFO("playerbots", " NEAR_RANDOM: {}", rpgStatusCount[NewRpgStatus::NEAR_RANDOM]); + LOG_INFO("playerbots", " NEAR_NPC: {}", rpgStatusCount[NewRpgStatus::NEAR_NPC]); + } + LOG_INFO("playerbots", "Bots engine:", dead); LOG_INFO("playerbots", " Non-combat: {}", engine_noncombat); LOG_INFO("playerbots", " Combat: {}", engine_combat); diff --git a/src/strategy/generic/NewRpgStrategy.h b/src/strategy/generic/NewRpgStrategy.h index 52d990c8..93adff84 100644 --- a/src/strategy/generic/NewRpgStrategy.h +++ b/src/strategy/generic/NewRpgStrategy.h @@ -52,27 +52,34 @@ struct NewRpgInfo { case NewRpgStatus::GO_GRIND: out << "GO_GRIND"; + out << "\nGrindPos: " << grindPos.GetMapId() << " " << grindPos.GetPositionX() << " " << grindPos.GetPositionY() << " " << grindPos.GetPositionZ(); + out << "\nlastGoGrind: " << lastGoGrind; break; case NewRpgStatus::GO_INNKEEPER: out << "GO_INNKEEPER"; + out << "\nInnKeeperPos: " << innKeeperPos.GetMapId() << " " << innKeeperPos.GetPositionX() << " " << innKeeperPos.GetPositionY() << " " << innKeeperPos.GetPositionZ(); + out << "\nlastGoInnKeeper: " << lastGoInnKeeper; break; case NewRpgStatus::NEAR_NPC: out << "NEAR_NPC"; + out << "\nNpcPos: " << npcPos.GetMapId() << " " << npcPos.GetPositionX() << " " << npcPos.GetPositionY() << " " << npcPos.GetPositionZ(); + out << "\nlastNearNpc: " << lastNearNpc; + out << "\nlastReachNpc: " << lastReachNpc; break; case NewRpgStatus::NEAR_RANDOM: out << "NEAR_RANDOM"; + out << "\nlastNearNpc: " << lastNearRandom; break; case NewRpgStatus::IDLE: out << "IDLE"; break; case NewRpgStatus::REST: out << "REST"; + out << "\nlastNearNpc: " << lastRest; break; default: out << "UNKNOWN"; } - out << "\nGrindPos: " << grindPos.GetMapId() << " " << grindPos.GetPositionX() << " " << grindPos.GetPositionY() << " " << grindPos.GetPositionZ(); - out << "\nlastGoGrind: " << lastGoGrind; return out.str(); } };