From 71f1a6076fb0653071067e2dddeaea85e327396d Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 29 Sep 2026 23:19:55 -0500 Subject: [PATCH] feat(gm): /reloadcdclient with the cdclient_reload permission (GM 9) Co-Authored-By: Claude Opus 5.5 --- dCommon/Permissions.cpp | 1 + dGame/dUtilities/SlashCommandHandler.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/dCommon/Permissions.cpp b/dCommon/Permissions.cpp index e306ee019..a4c5571b9 100644 --- a/dCommon/Permissions.cpp +++ b/dCommon/Permissions.cpp @@ -110,6 +110,7 @@ namespace { { "live_events_manage", "Server", "Live events", "Start and end live events in game: treasure hunts, bonus coins/U-score/loot, invasions and celebrations; also as part of scheduled events", 8 }, { "challenges_manage", "Server", "Community challenges", "Create, change, cancel and delete server-wide challenges and their rewards (rewards are mailed to everyone who took part)", 8 }, { "events_manage", "Server", "Scheduled events: features", "Scheduled events that switch game features (event_1..event_8) on and off", 8 }, + { "cdclient_reload", "Server", "Reload CDClient", "Make every server read the client's cdclient.fdb again after it changed (master also does this by itself)", 9 }, { "server_live_update", "Server", "Live updates", "Move every server and world instance onto a new build without a restart (players see a short loading screen), and cancel one", 9 }, { "instances_manage", "Server", "Instance limits", "Change players per instance and spare instances per zone (the master server applies them)", 9 }, { "backups", "Server", "Database backups", "Make, download and delete database backups (downloads also need your password)", 9 }, diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index 6520998de..2ec5fee20 100644 --- a/dGame/dUtilities/SlashCommandHandler.cpp +++ b/dGame/dUtilities/SlashCommandHandler.cpp @@ -8,6 +8,8 @@ #include "SlashCommandHandler.h" #include "ChatServerLink.h" #include "ChatPackets.h" +#include "MasterPackets.h" +#include "master/CDClientReload.h" #include "WorldMigration.h" #include @@ -1814,6 +1816,20 @@ void SlashCommandHandler::Startup() { .dashboardPermission = "server_live_update" }); + RegisterCommand({ + .help = "Reloads the client's cdclient.fdb on every server", + .info = "Master copies the client's cdclient.fdb (if it changed), makes a new CDServer.sqlite from it with the cdserver migrations, and every server switches to them between frames. What is already spawned keeps what it loaded; what is made from now on reads the new data. Master also does this by itself a few seconds after the file changes. Usage: /reloadcdclient", + .aliases = {"reloadcdclient"}, + .handle = [](Entity* entity, const SystemAddress& sysAddr, const std::string) { + CDClientReload request; + request.requesterId = entity->GetObjectID(); + MasterPackets::SendToMaster(request); + ChatPackets::SendSystemMessage(sysAddr, u"Asked master to check the client's cdclient.fdb; the server logs say what changed."); + }, + .requiredLevel = eGameMasterLevel::OPERATOR, + .dashboardPermission = "cdclient_reload" + }); + RegisterCommand({ .help = "[claim] Community challenges and live events", .info = "Shows the server-wide community challenges running now, how far along they are and what you added, and the live events in this world. Also gives you the coins waiting from challenges you helped complete",