Fix: Game can no longer drop you in a single player game.

This commit is contained in:
WolfGaming
2014-12-04 09:26:57 +00:00
parent 8e001663dc
commit f191babec8

View File

@@ -34,6 +34,14 @@ namespace OpenRA.Mods.Common.Server
{ {
isInitialPing = false; isInitialPing = false;
lastPing = Game.RunTime; lastPing = Game.RunTime;
if (server.LobbyInfo.IsSinglePlayer && server.Conns.Any() && server.GetClient(server.Conns.First()).IpAddress == "127.0.0.1")
{
foreach (var c in server.Conns.ToList())
server.SendOrderTo(c, "Ping", Game.RunTime.ToString());
}
else
{
foreach (var c in server.Conns.ToList()) foreach (var c in server.Conns.ToList())
{ {
if (c.TimeSinceLastResponse < ConnTimeout) if (c.TimeSinceLastResponse < ConnTimeout)
@@ -51,7 +59,6 @@ namespace OpenRA.Mods.Common.Server
server.DropClient(c, -1); server.DropClient(c, -1);
} }
} }
}
if (Game.RunTime - lastConnReport > ConnReportInterval) if (Game.RunTime - lastConnReport > ConnReportInterval)
{ {
@@ -67,4 +74,6 @@ namespace OpenRA.Mods.Common.Server
} }
} }
} }
}
}
} }