Day and night: a realm-wide sky speed and a sky of your own

Forever.DayCycle.Speed (worldserver.conf, default 1) makes the sky run
1x (the realm's clock, as before) up to 24x for the whole realm. The time
of day shown is worked out from the realm's local time alone, so every
player sees the same sky, also after a restart. Only the sky changes:
events, resets, respawns and scripts keep the realm's own time.

.time day and .time night keep noon or midnight for one character,
wherever it goes, and .time auto brings the realm's sky back; .time says
which one is set. Every player may use it (permission 1000, Role:
Player). The choice is kept in character_day_cycle, loaded with the other
login queries and saved with prepared async statements, and goes when
the character is deleted.

The clock is sent at login and at every map change, as before, and right
away by .time. The pure part (DayCycle.h) has unit tests.
This commit is contained in:
Karrz1
2026-11-14 09:08:43 +00:00
parent 5b27c607b0
commit 82b30ef184
16 changed files with 285 additions and 9 deletions
+3 -1
View File
@@ -2479,6 +2479,7 @@ INSERT INTO `rbac_linked_permissions` VALUES
(195,24),
(195,49),
(195,199),
(195,1000),
(196,10),
(196,202),
(196,203),
@@ -3789,7 +3790,8 @@ INSERT INTO `rbac_permissions` VALUES
(882,'Command: reload spell_script_names'),
(883,'Command: quest objective complete'),
(884,'Command: bg start'),
(885,'Command: bg stop');
(885,'Command: bg stop'),
(1000,'Command: time');
/*!40000 ALTER TABLE `rbac_permissions` ENABLE KEYS */;
UNLOCK TABLES;