mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-05-06 14:24:15 +02:00
feat(shutdown): passive drain and rename DisableSoftCrash
Shutdown now proceeds in three phases: close listeners immediately on signal, broadcast the in-game countdown, wait up to ShutdownDrainSeconds (default 30) for sessions to disconnect naturally via DrainPassive, then force-close any stragglers. This prevents players from entering new quests after the countdown starts, and lets mid-quest sessions finish saving without being killed mid-write. A second SIGINT during passive drain cancels it so the force-close phase runs immediately. Renamed DisableSoftCrash -> DisableShutdownCountdown since the flag controls the countdown, not crash behaviour. Existing config.json files keep working via a Viper alias on the legacy key. Closes #179.
This commit is contained in:
@@ -142,26 +142,26 @@ func TestLoadConfigDefaultModeWhenInvalid(t *testing.T) {
|
||||
// TestConfigStruct tests Config structure creation with all fields
|
||||
func TestConfigStruct(t *testing.T) {
|
||||
cfg := &Config{
|
||||
Host: "localhost",
|
||||
BinPath: "/opt/erupe",
|
||||
Language: "en",
|
||||
DisableSoftCrash: false,
|
||||
HideLoginNotice: false,
|
||||
LoginNotices: []string{"Welcome"},
|
||||
PatchServerManifest: "http://patch.example.com/manifest",
|
||||
PatchServerFile: "http://patch.example.com/files",
|
||||
Host: "localhost",
|
||||
BinPath: "/opt/erupe",
|
||||
Language: "en",
|
||||
DisableShutdownCountdown: false,
|
||||
HideLoginNotice: false,
|
||||
LoginNotices: []string{"Welcome"},
|
||||
PatchServerManifest: "http://patch.example.com/manifest",
|
||||
PatchServerFile: "http://patch.example.com/files",
|
||||
DeleteOnSaveCorruption: false,
|
||||
DisableSaveIntegrityCheck: false,
|
||||
ClientMode: "ZZ",
|
||||
RealClientMode: ZZ,
|
||||
QuestCacheExpiry: 3600,
|
||||
CommandPrefix: "!",
|
||||
AutoCreateAccount: false,
|
||||
LoopDelay: 100,
|
||||
DefaultCourses: []uint16{1, 2, 3},
|
||||
EarthStatus: 0,
|
||||
EarthID: 0,
|
||||
EarthMonsters: []int32{100, 101, 102},
|
||||
ClientMode: "ZZ",
|
||||
RealClientMode: ZZ,
|
||||
QuestCacheExpiry: 3600,
|
||||
CommandPrefix: "!",
|
||||
AutoCreateAccount: false,
|
||||
LoopDelay: 100,
|
||||
DefaultCourses: []uint16{1, 2, 3},
|
||||
EarthStatus: 0,
|
||||
EarthID: 0,
|
||||
EarthMonsters: []int32{100, 101, 102},
|
||||
SaveDumps: SaveDumpOptions{
|
||||
Enabled: true,
|
||||
RawEnabled: false,
|
||||
|
||||
Reference in New Issue
Block a user