Skip to content

Commit

Permalink
Merge pull request #2980 from ZeroK-RTS/modoptions-date
Browse files Browse the repository at this point in the history
Modoptions: send current date
  • Loading branch information
Licho1 authored Apr 8, 2024
2 parents 2714e86 + 13815d7 commit 690f506
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ZkLobbyServer/SpringieInterface/StartSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ public static LobbyHostingContext GetDedicatedServerStartSetup(LobbyHostingConte
* See https://github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/Shared/LobbyClient/DedicatedServer.cs#L317 */
ret.ModOptions["sendSpringieData"] = "1";

/* Current date. Synced Lua code cannot access `os.date`
* which is needed for gameside events (Easter etc) */
var date = DateTime.UtcNow;
ret.ModOptions["date_day"] = date.Day.ToString();
ret.ModOptions["date_month"] = date.Month.ToString();
ret.ModOptions["date_year"] = date.Year.ToString();

// set PW structures
if (mode == AutohostMode.Planetwars)
{
Expand Down

0 comments on commit 690f506

Please sign in to comment.