set the order lag to 1 in single player games

This commit is contained in:
Matthias Mailänder
2013-05-16 19:49:45 +02:00
parent a2a3def685
commit cc9a45daff

View File

@@ -326,10 +326,22 @@ namespace OpenRA.Server
if (mods.Any(m => m.Contains("{DEV_VERSION}"))) if (mods.Any(m => m.Contains("{DEV_VERSION}")))
SendMessage("{0} is running an unversioned development build, ".F(client.Name) + SendMessage("{0} is running an unversioned development build, ".F(client.Name) +
"and may desynchronize the game state if they have incompatible rules."); "and may desynchronize the game state if they have incompatible rules.");
SetOrderLag();
} }
catch (Exception) { DropClient(newConn); } catch (Exception) { DropClient(newConn); }
} }
void SetOrderLag()
{
if (lobbyInfo.IsSinglePlayer)
lobbyInfo.GlobalSettings.OrderLatency = 1;
else
lobbyInfo.GlobalSettings.OrderLatency = 3;
SyncLobbyInfo();
}
public static void SyncClientToPlayerReference(Session.Client c, PlayerReference pr) public static void SyncClientToPlayerReference(Session.Client c, PlayerReference pr)
{ {
if (pr == null) if (pr == null)
@@ -524,6 +536,8 @@ namespace OpenRA.Server
toDrop.socket.Disconnect(false); toDrop.socket.Disconnect(false);
} }
catch { } catch { }
SetOrderLag();
} }
public void SyncLobbyInfo() public void SyncLobbyInfo()