Groundwork for world content service and content filtering

This commit is contained in:
Akkadius
2020-04-01 06:07:44 -05:00
parent 58534dea16
commit 72b1e58edb
8 changed files with 311 additions and 0 deletions
+2
View File
@@ -90,6 +90,7 @@ union semun {
#include "../common/net/servertalk_server.h"
#include "../zone/data_bucket.h"
#include "world_server_command_handler.h"
#include "../common/content/world_content_service.h"
ClientList client_list;
GroupLFPList LFPGroupList;
@@ -106,6 +107,7 @@ uint32 numzones = 0;
bool holdzones = false;
const WorldConfig *Config;
EQEmuLogSys LogSys;
WorldContentService content_service;
WebInterfaceList web_interface;
void CatchSignal(int sig_num);
+40
View File
@@ -25,6 +25,9 @@
#include "worlddb.h"
#include "../common/database_schema.h"
#include "../common/database/database_dump_service.h"
#include "../common/content/world_content_service.h"
#include "../common/repositories/criteria/content_filter_criteria.h"
#include "../common/rulesys.h"
namespace WorldserverCommandHandler {
@@ -53,6 +56,7 @@ namespace WorldserverCommandHandler {
function_map["database:set-account-status"] = &WorldserverCommandHandler::DatabaseSetAccountStatus;
function_map["database:schema"] = &WorldserverCommandHandler::DatabaseGetSchema;
function_map["database:dump"] = &WorldserverCommandHandler::DatabaseDump;
function_map["test:test"] = &WorldserverCommandHandler::TestCommand;
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
}
@@ -271,4 +275,40 @@ namespace WorldserverCommandHandler {
database_dump_service->Dump();
}
/**
* @param argc
* @param argv
* @param cmd
* @param description
*/
void TestCommand(int argc, char **argv, argh::parser &cmd, std::string &description)
{
description = "Test command";
if (cmd[{"-h", "--help"}]) {
return;
}
if (!RuleManager::Instance()->LoadRules(&database, "default", false)) {
LogInfo("No rule set configured, using default rules");
}
content_service.SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
std::vector<std::string> flags = {
"hateplane_enabled",
"patch_nerf_7077",
};
content_service.SetContentFlags(flags);
LogInfo(
"Current expansion is [{}] ({}) is Velious Enabled [{}] Criteria [{}]",
content_service.GetCurrentExpansion(),
Expansion::ExpansionName[content_service.GetCurrentExpansion()],
content_service.IsTheShardsOfVeliousEnabled() ? "true" : "false",
ContentFilterCriteria::apply()
);
}
}
+1
View File
@@ -31,6 +31,7 @@ namespace WorldserverCommandHandler {
void DatabaseSetAccountStatus(int argc, char **argv, argh::parser &cmd, std::string &description);
void DatabaseGetSchema(int argc, char **argv, argh::parser &cmd, std::string &description);
void DatabaseDump(int argc, char **argv, argh::parser &cmd, std::string &description);
void TestCommand(int argc, char **argv, argh::parser &cmd, std::string &description);
};