Improve login and init permission for rndbots and addclass bots (#930)

* Improve login and init permission for rndbots and addclass-bots

* Add AllowAcountBots config

* Update config description
This commit is contained in:
Yunfan Li
2025-02-03 19:46:49 +08:00
committed by GitHub
parent f5a8b3017e
commit fef67081ec
5 changed files with 95 additions and 103 deletions

View File

@@ -27,11 +27,12 @@ public:
PlayerbotHolder();
virtual ~PlayerbotHolder(){};
void AddPlayerBot(ObjectGuid guid, uint32 masterAccountId);
void AddPlayerBot(ObjectGuid guid, uint32 masterAccountId, bool byAddClass = false);
void HandlePlayerBotLoginCallback(PlayerbotLoginQueryHolder const& holder);
void LogoutPlayerBot(ObjectGuid guid);
void DisablePlayerBot(ObjectGuid guid);
void RemoveFromPlayerbotsMap(ObjectGuid guid);
Player* GetPlayerBot(ObjectGuid guid) const;
Player* GetPlayerBot(ObjectGuid::LowType lowGuid) const;
PlayerBotMap::const_iterator GetPlayerBotsBegin() const { return playerBots.begin(); }
@@ -42,7 +43,7 @@ public:
void HandleBotPackets(WorldSession* session);
void LogoutAllBots();
void OnBotLogin(Player* const bot);
void OnBotLogin(Player* const bot, bool byAddClass = false);
std::vector<std::string> HandlePlayerbotCommand(char const* args, Player* master = nullptr);
std::string const ProcessBotCommand(std::string const cmd, ObjectGuid guid, ObjectGuid masterguid, bool admin,
@@ -58,6 +59,7 @@ protected:
virtual void OnBotLoginInternal(Player* const bot) = 0;
PlayerBotMap playerBots;
std::unordered_set<ObjectGuid> addClassBots;
std::unordered_set<ObjectGuid> botLoading;
};