From 2753d6d23198ed735b00f7651454e70d1f8323c4 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 24 Apr 2010 23:34:58 +1200 Subject: [PATCH] re-enable replay saving --- .gitignore | 2 +- OpenRA.Game/Game.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b8884a2445..a9ac4c3804 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ mods/*/*.dll sheet-*.png log.txt -/replay.rep +*.rep #binary stuff /*.dll diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 20456cbd8e..649b76561a 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -172,11 +172,17 @@ namespace OpenRA public static string CurrentHost = ""; public static int CurrentPort = 0; + internal static void JoinServer(string host, int port) { CurrentHost = host; CurrentPort = port; - orderManager = new OrderManager(new NetworkConnection( host, port )); // TODO: supplying a replay file prevents osx from joining a game + orderManager = new OrderManager(new NetworkConnection( host, port ), ChooseReplayFilename()); + } + + static string ChooseReplayFilename() + { + return DateTime.UtcNow.ToString("OpenRA-yyyy-MM-ddThhmmssZ.rep"); } internal static void JoinLocal()