mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[CLI] Add mercs:enable and mercs:disable commands (#3416)
* [CLI] Add `mercs:enable` and `mercs:disable` commands * Update descriptions
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "../worlddb.h"
|
||||
#include "../../common/database_schema.h"
|
||||
|
||||
void WorldserverCLI::MercsEnable(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
{
|
||||
description = "Enables mercenaries";
|
||||
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
// bootstrap merc tables if they don't exist
|
||||
if (!database.DoesTableExist("merc_types")) {
|
||||
LogInfo("Bootstrapping merc tables");
|
||||
database.SourceSqlFromUrl(
|
||||
"https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/merc_tables_bootstrap.sql"
|
||||
);
|
||||
}
|
||||
else {
|
||||
LogInfo("Merc tables already exist, skipping bootstrap");
|
||||
}
|
||||
|
||||
LogInfo("Enabling mercs");
|
||||
LogInfo("Setting rule Mercs:AllowMercs to true");
|
||||
RuleManager::Instance()->SetRule("Mercs:AllowMercs", "true", &database, true, true);
|
||||
LogInfo("Mercs enabled");
|
||||
}
|
||||
Reference in New Issue
Block a user