From 53933a4d8fcdbc6989b6111f3b4d25f37c96bfd2 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 6 Dec 2020 21:42:42 +0000 Subject: [PATCH] Fix restart black screen race condition. --- OpenRA.Game/Game.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index ea065ecb77..522e42d35c 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -934,9 +934,11 @@ namespace OpenRA AdvertiseOnline = false }; + // Always connect to local games using the same loopback connection + // Exposing multiple endpoints introduces a race condition on the client's PlayerIndex (sometimes 0, sometimes 1) + // This would break the Restart button, which relies on the PlayerIndex always being the same for local servers var endpoints = new List { - new IPEndPoint(IPAddress.IPv6Loopback, 0), new IPEndPoint(IPAddress.Loopback, 0) }; server = new Server.Server(endpoints, settings, ModData, ServerType.Local);