feat(master): the world file watch follows the override folder, and can hold a zone

For a file under maps/ master watches the file a world would read now: the override
when one is there, else the client's. An override that appears, changes or goes away
makes the instances that read another version stale, also for files from the packs.
The dashboard can hold a zone's automatic reloads (WORLD_RELOAD_HOLD, a new message
after the existing ones) until a reload of the zone is asked for. The status sent to
the dashboard counts what reloads did per zone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 18:25:53 -06:00
parent d124372973
commit e714ff2f0a
8 changed files with 217 additions and 17 deletions

View File

@@ -14,7 +14,8 @@ struct WorldReloadRequest;
/**
* Master's side of world hot reload (docs/WorldHotReload.md). Worlds report the zone files they loaded (WORLD_FILES);
* master watches them (size and mtime every world_watch_seconds, then a hash on a worker thread) and, when one changes
* master watches them (size and mtime every world_watch_seconds, then a hash on a worker thread; for a file under
* maps/ that is the file in the override folder, zone_override_dir, when one is there) and, when one changes
* or a GM or the dashboard asks (WORLD_RELOAD), replaces the affected instances with new ones on the files on disk,
* moving their players with the instance migration (MigrationCoordinator). Main thread only.
*/
@@ -28,6 +29,9 @@ namespace WorldReloader {
// A GM's /reloadworld or the dashboard; who is for the log
void HandleRequest(const WorldReloadRequest& request, const std::string& who);
// The dashboard holds (or stops holding) a zone's automatic reloads; a request for the zone ends a hold
void SetHold(uint32_t zoneId, bool hold);
// Every migration's progress (MigrationCoordinator's observer)
void OnMigrationStatus(const MigrationStatus& status);