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()