feat(CS): run the siege on ONE designated server (CastleSiegeServerId)
Some checks failed
.NET Core / build (push) Has been cancelled

With multiple game servers each has its own map instances, so the siege ran
independently on all of them - a guild could win uncontested on an empty server's
Valley of Loren. Now the siege (tick/spawn/battle/registration) runs only on the
server whose Id == config.CastleSiegeServerId (AdminPanel-editable). Other servers
skip the siege and just mirror the shared castle owner from config so the hunting-map
gate + castle flag rewards still work everywhere. The Guardsman on non-siege servers
tells players which server to switch to.
This commit is contained in:
Acentech Dev
2026-07-15 19:10:48 +03:00
parent 3e465c016e
commit fbe75d55be
4 changed files with 53 additions and 0 deletions

View File

@@ -158,6 +158,16 @@ public class CastleSiegeContext
this._dirty = true;
}
/// <summary>
/// Mirrors the shared castle owner from the configuration. Used on game servers that do NOT host the
/// siege, so their hunting-map gate and castle flag still reflect the current owner. Does not mark the
/// state dirty (these servers never persist).
/// </summary>
public void SyncOwnerFromConfig()
{
this.OwnerGuildName = this.Configuration.PersistedOwnerGuildName;
}
/// <summary>
/// Sets the weekly auto-schedule (days of week + UTC time) into the configuration and marks the state
/// dirty for persistence. Empty days disables auto-start (manual only). The configuration is the single