Skip to content

Commit 690f506

Browse files
authored
Merge pull request #2980 from ZeroK-RTS/modoptions-date
Modoptions: send current date
2 parents 2714e86 + 13815d7 commit 690f506

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

ZkLobbyServer/SpringieInterface/StartSetup.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,13 @@ public static LobbyHostingContext GetDedicatedServerStartSetup(LobbyHostingConte
292292
* See https://github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Shared/LobbyClient/DedicatedServer.cs#L317 */
293293
ret.ModOptions["sendSpringieData"] = "1";
294294

295+
/* Current date. Synced Lua code cannot access `os.date`
296+
* which is needed for gameside events (Easter etc) */
297+
var date = DateTime.UtcNow;
298+
ret.ModOptions["date_day"] = date.Day.ToString();
299+
ret.ModOptions["date_month"] = date.Month.ToString();
300+
ret.ModOptions["date_year"] = date.Year.ToString();
301+
295302
// set PW structures
296303
if (mode == AutohostMode.Planetwars)
297304
{

0 commit comments

Comments
 (0)