mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-17 09:15:28 +00:00
feat(master): an edit mode flag on a private instance, down to its world server
CreatePrivateZone carries editMode as one more byte, written only when set, so a plain private zone is sent as before. Master keeps it on the instance, starts the world server with -editmode 1, and gives a private instance's replacement (a reload or a live update) the same flag. Nothing sets it yet. A capped string now skips the characters it cut, so what follows it is read from the right place. A request to join a private instance that is still starting is answered once its world server is ready, instead of at once with an address nothing listens on yet. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -171,11 +171,11 @@ void MigrationCoordinator::SetObserver(std::function<void(const MigrationStatus&
|
||||
|
||||
namespace {
|
||||
// The new instance (REPLACE): a fresh world server from the binary on disk now, so an update takes effect. A private
|
||||
// instance's replacement gets the same password; the source is draining already, so the password finds the new one.
|
||||
// instance's replacement gets the same password and edit mode; the source is draining already, so the password finds the new one.
|
||||
Instance* StartTarget(Instance& source) {
|
||||
if (source.GetIsPrivate()) {
|
||||
source.SetIsDraining(true);
|
||||
const auto& started = Game::im->CreatePrivateInstance(source.GetMapID(), source.GetCloneID(), source.GetPassword());
|
||||
const auto& started = Game::im->CreatePrivateInstance(source.GetMapID(), source.GetCloneID(), source.GetPassword(), source.GetIsEditMode());
|
||||
return started ? started.get() : nullptr;
|
||||
}
|
||||
const auto& started = Game::im->StartNewInstance(source.GetMapID(), source.GetCloneID());
|
||||
|
||||
Reference in New Issue
Block a user