[performance] bots scale idle fix (#678)

* [performance] bots scale idle fix

* [performance] featureset
This commit is contained in:
bash
2024-11-05 16:05:05 +01:00
committed by GitHub
parent e59b4d9e32
commit a7bcdad65c
7 changed files with 215 additions and 259 deletions

View File

@@ -26,6 +26,7 @@
#include "RandomPlayerbotMgr.h"
#include "ScriptMgr.h"
#include "cs_playerbots.h"
#include "cmath"
class PlayerbotsDatabaseScript : public DatabaseScript
{
@@ -96,6 +97,16 @@ public:
{
sPlayerbotsMgr->AddPlayerbotData(player, false);
sRandomPlayerbotMgr->OnPlayerLogin(player);
if (sPlayerbotAIConfig->enabled || sPlayerbotAIConfig->randomBotAutologin)
{
std::string roundedTime =
std::to_string(std::ceil((sPlayerbotAIConfig->maxRandomBots * 0.13 / 60) * 10) / 10.0);
roundedTime = roundedTime.substr(0, roundedTime.find('.') + 2);
ChatHandler(player->GetSession()).SendSysMessage(
"Playerbots: bot initialization at server startup will require '" + roundedTime + "' minutes.");
}
}
}