Merge pull request #11456 from obrakmann/disable-singleplayer-by-default-for-dedicateds

Disable single-player games by default on dedicated servers
This commit is contained in:
abcdefg30
2016-06-22 22:28:37 +02:00
committed by GitHub
7 changed files with 16 additions and 16 deletions

View File

@@ -195,7 +195,7 @@ namespace OpenRA.Network
public string GameSpeedType = "default";
public bool AllowVersionMismatch;
public string GameUid;
public bool DisableSingleplayer;
public bool EnableSingleplayer;
[FieldLoader.Ignore]
public Dictionary<string, LobbyOptionState> LobbyOptions = new Dictionary<string, LobbyOptionState>();

View File

@@ -149,7 +149,7 @@ namespace OpenRA.Server
RandomSeed = randomSeed,
Map = settings.Map,
ServerName = settings.Name,
DisableSingleplayer = settings.DisableSinglePlayer,
EnableSingleplayer = settings.EnableSingleplayer || !dedicated,
}
};
@@ -394,8 +394,8 @@ namespace OpenRA.Server
if (!LobbyInfo.IsSinglePlayer && Map.DefinesUnsafeCustomRules)
SendOrderTo(newConn, "Message", "This map contains custom rules. Game experience may change.");
if (Settings.DisableSinglePlayer)
SendOrderTo(newConn, "Message", "Singleplayer games have been disabled on this server.");
if (!LobbyInfo.GlobalSettings.EnableSingleplayer)
SendOrderTo(newConn, "Message", "This server requires at least two human players to start a match.");
else if (Map.Players.Players.Where(p => p.Value.Playable).All(p => !p.Value.AllowBots))
SendOrderTo(newConn, "Message", "Bots have been disabled on this map.");

View File

@@ -76,8 +76,8 @@ namespace OpenRA
[Desc("Value in milliseconds when to terminate the game. Needs to be at least 10000 (10 s) to enable the timer.")]
public int TimeOut = 0;
[Desc("Disallow games where only one player plays with bots.")]
public bool DisableSinglePlayer = false;
[Desc("For dedicated servers only, controls whether a game can be started with just one human player in the lobby.")]
public bool EnableSingleplayer = false;
[Desc("Query map information from the Resource Center if they are not available locally.")]
public bool QueryMapRepository = true;