[Bots] Cleanup and remove preprocessors. (#2757)

* [Bots] Cleanup and remove preprocessors.

- Removes every `#ifdef BOTS` we have and locks bots behind `Bots:AllowBots` rule.
- Bot updates are now done by default similar to regular database updates.
- Modify `CMakeLists.txt`, `.drone.yml`, and `BUILD.md` to match the removal of `EQEMU_ENABLE_BOTS`.

* Cleanup

- Add SQL for enabling bots for servers with bots.
- Add message that tells players/operators bots are disabled.

* Suggested changes.

* Bot injection stuff

* Change SQL to bot SQL.

* Tweaks

* Remove `is_bot`

* Update version.h

* Update main.cpp

* Update database.cpp

* Fix name availability crash

* Remove bots from update script

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Alex King
2023-01-20 13:35:33 -05:00
committed by GitHub
parent 1f0b2a8991
commit 3335cacac1
91 changed files with 263 additions and 1150 deletions
-10
View File
@@ -45,9 +45,7 @@
#include <limits.h>
#include <list>
#ifdef BOTS
#include "bot.h"
#endif
extern QueryServ* QServ;
extern Zone* zone;
@@ -98,11 +96,9 @@ void QuestManager::Process() {
//this is inheriently unsafe if we ever make it so more than npc/client start timers
parse->EventPlayer(EVENT_TIMER, cur->mob->CastToClient(), cur->name, 0);
}
#ifdef BOTS
else if (cur->mob->IsBot()) {
parse->EventBot(EVENT_TIMER, cur->mob->CastToBot(), nullptr, cur->name, 0);
}
#endif
//we MUST reset our iterator since the quest could have removed/added any
//number of timers... worst case we have to check a bunch of timers twice
@@ -2237,8 +2233,6 @@ void QuestManager::popup(const char *title, const char *text, uint32 popupid, ui
initiator->SendPopupToClient(title, text, popupid, buttons, Duration);
}
#ifdef BOTS
int QuestManager::createbotcount(uint8 class_id) {
QuestManagerCurrentQuestVars();
if (initiator) {
@@ -2444,8 +2438,6 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
return false;
}
#endif //BOTS
void QuestManager::taskselector(const std::vector<int>& tasks, bool ignore_cooldown) {
QuestManagerCurrentQuestVars();
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && task_manager)
@@ -3466,7 +3458,6 @@ NPC *QuestManager::GetNPC() const {
return nullptr;
}
#ifdef BOTS
Bot *QuestManager::GetBot() const {
if (!quests_running_.empty()) {
running_quest e = quests_running_.top();
@@ -3475,7 +3466,6 @@ Bot *QuestManager::GetBot() const {
return nullptr;
}
#endif
Mob *QuestManager::GetOwner() const {
if(!quests_running_.empty()) {