mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-25 06:02:49 +00:00
feat: live updates move every server onto a new build without a restart
With new binaries in place, master moves everything onto them while the server keeps running (the dashboard's Live update, /liveupdate or SIGUSR2 to master): - database migrations of the new build first; a failure stops there - UGC finishes the jobs it is running (queued rows stay pending), auth restarts, chat hands its teams to master for the next chat server; master starts the new processes and retries ones that don't come back - once the new chat server is up (CHAT_SERVER_READY) every world connects at once and sends its players again (LoginSessionNotify resync, no login logged) - every world instance is replaced with an instance migration: public worlds and private ones (same password) at once, properties after the old instance saved and froze the property (MIGRATE_PREPARE: no building, claiming or saving there any more), activity zones and character select once their players left or after a wait; empty instances just stop, zones in prestart_worlds get a new one first - the dashboard restarts last and picks the status up again Players land where they stood (position carried in CarriedPlayerState, also on properties and Moon Base). Draining instances get no new players (InstanceMigration::AcceptsNewPlayers) and show as "Moving players" in the world list. The order lives in LiveUpdateMachine.h without master state and is unit tested; master's glue is LiveUpdateCoordinator. Master itself is not replaced. Message IDs are appended only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "master/DashboardMessages.h"
|
||||
#include "master/DataChanged.h"
|
||||
#include "master/InstanceMigration.h"
|
||||
#include "master/LiveUpdate.h"
|
||||
#include "master/MessageCapture.h"
|
||||
#include "master/PlayerAction.h"
|
||||
#include "master/UgcModelsMade.h"
|
||||
@@ -24,7 +25,7 @@ class dServer;
|
||||
*
|
||||
* The dashboard's messages and instance migration are MASTER packets too; they live in per-topic headers under
|
||||
* dNet/master/ (PlayerAction.h, DataChanged.h, DashboardMessages.h, MessageCapture.h, InstanceMigration.h,
|
||||
* UgcModelsMade.h), which
|
||||
* LiveUpdate.h, UgcModelsMade.h), which
|
||||
* this header includes, so including MasterPackets.h gives every MASTER struct.
|
||||
*/
|
||||
namespace MasterPackets {
|
||||
@@ -251,8 +252,9 @@ namespace MasterPackets {
|
||||
// More than this many worlds is a broken packet
|
||||
static constexpr uint32_t MAX_INSTANCES = 10000;
|
||||
|
||||
// Where a world is: connected, launched but not connected yet, or shutting down
|
||||
enum class eState : uint8_t { READY = 0, STARTING = 1, STOPPING = 2 };
|
||||
// Where a world is: connected, launched but not connected yet, shutting down, or connected but having its
|
||||
// players moved to a new instance (a live update or instance migration; nobody new is sent there)
|
||||
enum class eState : uint8_t { READY = 0, STARTING = 1, STOPPING = 2, DRAINING = 3 };
|
||||
|
||||
struct Instance {
|
||||
LWOMAPID mapID{};
|
||||
|
||||
Reference in New Issue
Block a user