mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat(gm): /reloadcdclient with the cdclient_reload permission (GM 9)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "backups", "Server", "Database backups", "Make, download and delete database backups (downloads also need your password)", 9 },
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#include "SlashCommandHandler.h"
|
#include "SlashCommandHandler.h"
|
||||||
#include "ChatServerLink.h"
|
#include "ChatServerLink.h"
|
||||||
#include "ChatPackets.h"
|
#include "ChatPackets.h"
|
||||||
|
#include "MasterPackets.h"
|
||||||
|
#include "master/CDClientReload.h"
|
||||||
#include "WorldMigration.h"
|
#include "WorldMigration.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@@ -1814,6 +1816,20 @@ void SlashCommandHandler::Startup() {
|
|||||||
.dashboardPermission = "server_live_update"
|
.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({
|
RegisterCommand({
|
||||||
.help = "[claim] Community challenges and live events",
|
.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",
|
.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",
|
||||||
|
|||||||
Reference in New Issue
Block a user