Dedicated server loads the name, password and other initial settings from the serversettings file. + Fixed not being able to change the server name if the current name is null or empty

This commit is contained in:
Joonas Rikkonen
2017-07-03 18:28:23 +03:00
parent 8e880b2ded
commit 0d7851367b
5 changed files with 59 additions and 10 deletions
@@ -171,6 +171,27 @@ namespace Barotrauma.Networking
}
}
[HasDefaultValue(8, true)]
private int MaxPlayers
{
get;
set;
}
[HasDefaultValue(false, true)]
private bool Public
{
get;
set;
}
[HasDefaultValue(false, true)]
private bool AttemptUPNP
{
get { return config.EnableUPnP; }
set { config.EnableUPnP = value; }
}
public YesNoMaybe TraitorsEnabled
{
get;
@@ -231,6 +252,10 @@ namespace Barotrauma.Networking
doc.Root.SetAttributeValue("TraitorsEnabled", TraitorsEnabled.ToString());
#if SERVER
doc.Root.SetAttributeValue("password", password);
#endif
if (GameMain.NetLobbyScreen != null
#if CLIENT
&& GameMain.NetLobbyScreen.ServerMessage != null