mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 18:46:37 +00:00
[Expansion] Content Filtering Adjustments (#1910)
* Change default expansion values for ALL to -1 from 0 * Adjust content_filter_criteria * Refactor content filtering logic * Allow flag strings to also just be empty instead of null * Formatting * Editor oops
This commit is contained in:
@@ -503,6 +503,11 @@ int main(int argc, char **argv)
|
||||
LogInfo("Initializing [EventScheduler]");
|
||||
event_scheduler.SetDatabase(&database)->LoadScheduledEvents();
|
||||
|
||||
LogInfo("Initializing [WorldContentService]");
|
||||
content_service.SetDatabase(&database)
|
||||
->SetExpansionContext()
|
||||
->ReloadContentFlags();
|
||||
|
||||
LogInfo("Initializing [SharedTaskManager]");
|
||||
shared_task_manager.SetDatabase(&database)
|
||||
->SetContentDatabase(&content_db)
|
||||
|
||||
@@ -165,37 +165,37 @@ namespace WorldserverCommandHandler {
|
||||
|
||||
Json::Value player_tables_json;
|
||||
std::vector<std::string> player_tables = DatabaseSchema::GetPlayerTables();
|
||||
for (const auto &table : player_tables) {
|
||||
for (const auto &table: player_tables) {
|
||||
player_tables_json.append(table);
|
||||
}
|
||||
|
||||
Json::Value content_tables_json;
|
||||
std::vector<std::string> content_tables = DatabaseSchema::GetContentTables();
|
||||
for (const auto &table : content_tables) {
|
||||
for (const auto &table: content_tables) {
|
||||
content_tables_json.append(table);
|
||||
}
|
||||
|
||||
Json::Value server_tables_json;
|
||||
std::vector<std::string> server_tables = DatabaseSchema::GetServerTables();
|
||||
for (const auto &table : server_tables) {
|
||||
for (const auto &table: server_tables) {
|
||||
server_tables_json.append(table);
|
||||
}
|
||||
|
||||
Json::Value login_tables_json;
|
||||
std::vector<std::string> login_tables = DatabaseSchema::GetLoginTables();
|
||||
for (const auto &table : login_tables) {
|
||||
for (const auto &table: login_tables) {
|
||||
login_tables_json.append(table);
|
||||
}
|
||||
|
||||
Json::Value state_tables_json;
|
||||
std::vector<std::string> state_tables = DatabaseSchema::GetStateTables();
|
||||
for (const auto &table : state_tables) {
|
||||
for (const auto &table: state_tables) {
|
||||
state_tables_json.append(table);
|
||||
}
|
||||
|
||||
Json::Value version_tables_json;
|
||||
std::vector<std::string> version_tables = DatabaseSchema::GetVersionTables();
|
||||
for (const auto &table : version_tables) {
|
||||
for (const auto &table: version_tables) {
|
||||
version_tables_json.append(table);
|
||||
}
|
||||
|
||||
@@ -313,11 +313,20 @@ namespace WorldserverCommandHandler {
|
||||
|
||||
content_service.SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
|
||||
|
||||
std::vector<std::string> flags = {
|
||||
std::vector<ContentFlagsRepository::ContentFlags> flags = {};
|
||||
auto f = ContentFlagsRepository::NewEntity();
|
||||
f.enabled = 1;
|
||||
|
||||
std::vector<std::string> flag_names = {
|
||||
"hateplane_enabled",
|
||||
"patch_nerf_7077",
|
||||
};
|
||||
|
||||
for (auto &name: flag_names) {
|
||||
f.flag_name = name;
|
||||
flags.push_back(f);
|
||||
}
|
||||
|
||||
content_service.SetContentFlags(flags);
|
||||
|
||||
LogInfo(
|
||||
|
||||
@@ -41,6 +41,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "shared_task_world_messaging.h"
|
||||
#include "../common/shared_tasks.h"
|
||||
#include "shared_task_manager.h"
|
||||
#include "../common/content/world_content_service.h"
|
||||
|
||||
extern ClientList client_list;
|
||||
extern GroupLFPList LFPGroupList;
|
||||
@@ -868,6 +869,11 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
RuleManager::Instance()->LoadRules(&database, "default", true);
|
||||
break;
|
||||
}
|
||||
case ServerOP_ReloadContentFlags: {
|
||||
zoneserver_list.SendPacket(pack);
|
||||
content_service.SetExpansionContext()->ReloadContentFlags();
|
||||
break;
|
||||
}
|
||||
case ServerOP_ReloadRulesWorld:
|
||||
{
|
||||
RuleManager::Instance()->LoadRules(&database, "default", true);
|
||||
|
||||
Reference in New Issue
Block a user