mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +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:
@@ -1763,7 +1763,7 @@ static_assert(static_cast<int64_t>(MessageType::Game::CAN_ITEMS_BE_REFORGED) ==
|
||||
static_assert(static_cast<int64_t>(MessageType::Game::NOTIFY_CLIENT_RAIL_START_FAILED) == 1771);
|
||||
static_assert(static_cast<int64_t>(MessageType::Game::GET_IS_ON_RAIL) == 1772);
|
||||
|
||||
// MessageType::Master: 19 enumerators
|
||||
// MessageType::Master: 43 enumerators
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::REQUEST_ZONE_TRANSFER) == 1);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::REQUEST_ZONE_TRANSFER_RESPONSE) == 2);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::SERVER_INFO) == 3);
|
||||
@@ -1783,6 +1783,30 @@ static_assert(static_cast<int64_t>(MessageType::Master::SHUTDOWN_UNIVERSE) == 16
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::AFFIRM_TRANSFER_REQUEST) == 17);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::AFFIRM_TRANSFER_RESPONSE) == 18);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::NEW_SESSION_ALERT) == 19);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::REQUEST_SERVER_LIST) == 20);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::SERVER_LIST_RESPONSE) == 21);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::PLAYER_ACTION) == 22);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::PLAYER_ACTION_RESULT) == 23);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::DATA_CHANGED) == 24);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::PLAYER_POSITIONS) == 25);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::ANNOUNCE) == 26);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::DASHBOARD_SHUTDOWN) == 27);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::CONFIG_RELOAD) == 28);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::INSTANCE_SHUTDOWN) == 29);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::MESSAGE_CAPTURE_CONTROL) == 30);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::MESSAGE_CAPTURE_DATA) == 31);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::INSTANCE_MIGRATE) == 32);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::MIGRATE_PLAYERS) == 33);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::MIGRATE_STATUS) == 34);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::MIGRATE_PLAYER_STATE) == 35);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::SERVER_TRAFFIC) == 36);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::UGC_MODELS_MADE) == 37);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::MIGRATE_PREPARE) == 38);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::LIVE_UPDATE_REQUEST) == 39);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::LIVE_UPDATE_STATUS) == 40);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::LIVE_UPDATE_RETIRE) == 41);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::CHAT_HANDOFF) == 42);
|
||||
static_assert(static_cast<int64_t>(MessageType::Master::CHAT_SERVER_READY) == 43);
|
||||
|
||||
// MessageType::Server: 3 enumerators
|
||||
static_assert(static_cast<int64_t>(MessageType::Server::VERSION_CONFIRM) == 0);
|
||||
|
||||
Reference in New Issue
Block a user