Activation of the new 'Bots' command system

This commit is contained in:
Uleat
2016-03-24 18:50:31 -04:00
parent 747895cbe5
commit b327da7092
48 changed files with 12821 additions and 5616 deletions
+29 -1
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -52,6 +52,10 @@
#include "zone.h"
#include "queryserv.h"
#include "command.h"
#ifdef BOTS
#include "bot_command.h"
#include "bot_database.h"
#endif
#include "zone_config.h"
#include "titles.h"
#include "guild_mgr.h"
@@ -203,6 +207,18 @@ int main(int argc, char** argv) {
return 1;
}
#ifdef BOTS
if (!botdb.Connect(
Config->DatabaseHost.c_str(),
Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(),
Config->DatabaseDB.c_str(),
Config->DatabasePort)) {
Log.Out(Logs::General, Logs::Error, "Cannot continue without a bots database connection.");
return 1;
}
#endif
/* Register Log System and Settings */
Log.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess);
database.LoadLogSettings(Log.log_settings);
@@ -325,6 +341,15 @@ int main(int argc, char** argv) {
}
}
#ifdef BOTS
Log.Out(Logs::General, Logs::Zone_Server, "Loading bot commands");
int botretval = bot_command_init();
if (botretval<0)
Log.Out(Logs::General, Logs::Error, "Bot command loading FAILED");
else
Log.Out(Logs::General, Logs::Zone_Server, "%d bot commands loaded", botretval);
#endif
if(RuleB(TaskSystem, EnableTaskSystem)) {
Log.Out(Logs::General, Logs::Tasks, "[INIT] Loading Tasks");
taskmanager = new TaskManager;
@@ -524,6 +549,9 @@ int main(int argc, char** argv) {
worldserver.Disconnect();
safe_delete(taskmanager);
command_deinit();
#ifdef BOTS
bot_command_deinit();
#endif
safe_delete(parse);
Log.Out(Logs::General, Logs::Zone_Server, "Proper zone shutdown complete.");
Log.CloseFileLogs();