Fixes to server settings. Closes #225

- Selected mode and mission type settings are saved and loaded.
- RandomizeSeed setting can be changed via the debug console and it also has an effect in the dedicated server.
- Dedicated server randomizes sub & mode settings if their selection modes are set to random.
This commit is contained in:
Joonas Rikkonen
2018-01-25 15:09:44 +02:00
parent 490e373c7a
commit a1ccf501c7
6 changed files with 70 additions and 19 deletions
@@ -79,10 +79,9 @@ namespace Barotrauma.Networking
public bool RandomizeSeed
{
get;
private set;
set;
}
[Serialize(300.0f, true)]
public float RespawnInterval
{
@@ -241,6 +240,20 @@ namespace Barotrauma.Networking
set;
}
[Serialize("Sandbox", true)]
public string GameMode
{
get;
set;
}
[Serialize("Random", true)]
public string MissionType
{
get;
set;
}
private void SaveSettings()
{
XDocument doc = new XDocument(new XElement("serversettings"));
@@ -327,6 +340,8 @@ namespace Barotrauma.Networking
{
#if SERVER
GameMain.NetLobbyScreen.ServerName = doc.Root.GetAttributeString("name", "");
GameMain.NetLobbyScreen.SelectedModeName = GameMode;
GameMain.NetLobbyScreen.MissionTypeName = MissionType;
#endif
GameMain.NetLobbyScreen.ServerMessageText = doc.Root.GetAttributeString("ServerMessage", "");
}