| 875 | // Find which settings can be changed by the user |
| 876 | let allowedSettings = ["PlayerData"]; |
| 877 | |
| 878 | if (attrs.mapType == "skirmish") |
| 879 | allowedSettings = allowedSettings.concat(["GameType", "VictoryScripts", "WonderDuration", "PopulationCap", "Ceasefire", "StartingResources", "RevealMap", "LockTeams", "ExploreMap", "DisableTreasures"]); |
| 880 | |
| 881 | if (attrs.mapType == "random") |
| 882 | allowedSettings = allowedSettings.concat(["Size", "GameType", "VictoryScripts", "WonderDuration", "PopulationCap", "Ceasefire", "StartingResources", "RevealMap", "LockTeams", "ExploreMap", "DisableTreasures"]); |
| 883 | |
| 884 | attrs.settings.RatingEnabled = Engine.HasXmppClient(); |
| 885 | Engine.SetRankedGame(attrs.settings.RatingEnabled); |
| 886 | |
| 887 | if (g_IsNetworked && !attrs.settings.RatingEnabled) |
| 888 | allowedSettings.push("CheatsEnabled"); |
| 889 | |
| 890 | // Only load settings which can be changed by the user |
| 891 | for (let prop in attrs.settings) |
| 892 | if (!prop in allowedSettings) |
| 893 | delete attrs.settings[prop]; |
| 894 | |
| 895 | // Restore valid matchsettings |