Skip to content

Commit

Permalink
Modoptions: send current date
Browse files Browse the repository at this point in the history
Lets you have events (e.g. Easter) based on time.
  • Loading branch information
sprunk authored Apr 7, 2024
1 parent 2714e86 commit 13815d7
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 13815d7

Please sign in to comment.