Allow mods to set default lobby options.

This commit is contained in:
Paul Chote
2013-08-04 12:03:18 +12:00
parent 8fb7ed4913
commit 40533918f3
6 changed files with 12 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ namespace OpenRA.FileFormats
public readonly Dictionary<string, string> Packages;
public readonly MiniYaml LoadScreen;
public readonly MiniYaml LobbyDefaults;
public readonly Dictionary<string, Pair<string,int>> Fonts;
public readonly int TileSize = 24;
@@ -57,6 +58,7 @@ namespace OpenRA.FileFormats
PackageContents = YamlList(yaml, "PackageContents");
LoadScreen = yaml["LoadScreen"];
LobbyDefaults = yaml["LobbyDefaults"];
Fonts = yaml["Fonts"].NodesDict.ToDictionary(x => x.Key,
x => Pair.New(x.Value.NodesDict["Font"].Value,
int.Parse(x.Value.NodesDict["Size"].Value)));

View File

@@ -106,6 +106,7 @@ namespace OpenRA.Server
lobbyInfo.GlobalSettings.Map = settings.Map;
lobbyInfo.GlobalSettings.ServerName = settings.Name;
lobbyInfo.GlobalSettings.Dedicated = settings.Dedicated;
FieldLoader.Load(lobbyInfo.GlobalSettings, modData.Manifest.LobbyDefaults);
foreach (var t in ServerTraits.WithInterface<INotifyServerStart>())
t.ServerStarted(this);

View File

@@ -52,6 +52,7 @@ Sequences:
mods/cnc/sequences/funpark.yaml
mods/cnc/sequences/civilian.yaml
mods/cnc/sequences/campaign.yaml
Cursors:
mods/cnc/cursors.yaml
@@ -117,6 +118,8 @@ ServerTraits:
PlayerPinger
MasterServerPinger
LobbyDefaults:
ChromeMetrics:
mods/cnc/metrics.yaml

View File

@@ -104,6 +104,8 @@ ServerTraits:
PlayerPinger
MasterServerPinger
LobbyDefaults:
ChromeMetrics:
mods/d2k/metrics.yaml

View File

@@ -120,6 +120,8 @@ ServerTraits:
PlayerPinger
MasterServerPinger
LobbyDefaults:
ChromeMetrics:
mods/ra/metrics.yaml

View File

@@ -143,6 +143,8 @@ ServerTraits:
PlayerPinger
MasterServerPinger
LobbyDefaults:
ChromeMetrics:
mods/ra/metrics.yaml