Skip to content

Add scheduled exit support#343

Open
MadMaxMangos wants to merge 4 commits into
mangoszero:masterfrom
MadMaxMangos:feature/scheduled-exit
Open

Add scheduled exit support#343
MadMaxMangos wants to merge 4 commits into
mangoszero:masterfrom
MadMaxMangos:feature/scheduled-exit

Conversation

@MadMaxMangos
Copy link
Copy Markdown
Member

@MadMaxMangos MadMaxMangos commented Jun 3, 2026

Add scheduled maintenance restart/shutdown support to mangosd

Adds disabled-by-default scheduled shutdown/restart support to mangosd, replacing the previous need for external Remote Admin scripts to drive weekly maintenance restarts.

Behavior:

  • Adds ScheduledExit config support to mangosd.conf.dist.
  • Checks local server wall-clock day and time.
  • Starts the existing shutdown/restart countdown path at the configured scheduled minute.
  • Supports configurable delay, warning milestones, and warning text.
  • Ships legacy-style weekly restart warning defaults at 15, 10, 5, and 1 minutes.
  • Sends configured warning text through SERVER_MSG_CUSTOM / SMSG_SERVER_MESSAGE, so it appears in the same yellow server-message channel as built-in shutdown/restart countdowns rather than as a GM-style announce.
  • Skips scheduled firing if another shutdown/restart is already in progress.
  • Adds startup-minute suppression to prevent restart loops if the daemon comes back up inside the same scheduled minute.

Validation:

  • scheduled_exit_tests.exe passed.
  • game and mangosd rebuilt successfully.
  • git diff --check passed.
  • Full 15-minute scheduled restart cadence tested twice with the 900/600/300/60 warning sequence.
  • SERVER_MSG_CUSTOM behavior verified against the 1.12.1 client handler and ServerMessages.dbc row 3 %s.

Notes:

  • This PR assumes the related realmd scheduled-exit PR handles service-only realm-list daemon restarts.
  • The feature is disabled by default.
  • No database changes.

This change is Reviewable

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jun 3, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 92 complexity · 5 duplication

Metric Results
Complexity 92
Duplication 5

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@billy1arm billy1arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two issues I see:

  1. Both will need to have the conf version numbers updated; these are in MangosParams.cmake

The format is normally in the format YYYYMMDD00

  1. Rather than those strings being in the conf file, they should be in the database mangos_strings as new entries and called from there; this allows for easy localisation.

@AppVeyorBot
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@billy1arm billy1arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change the starting id from 1717 to 1730 onwards to allow the same code to be used across the cores.
MangosThree has some additional messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants