Saving server info box & traitor settings
This commit is contained in:
@@ -1965,6 +1965,7 @@ namespace Barotrauma.Networking
|
|||||||
public override void Disconnect()
|
public override void Disconnect()
|
||||||
{
|
{
|
||||||
banList.Save();
|
banList.Save();
|
||||||
|
SaveSettings();
|
||||||
|
|
||||||
if (registeredToMaster && restClient != null)
|
if (registeredToMaster && restClient != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -189,7 +189,8 @@ namespace Barotrauma.Networking
|
|||||||
{
|
{
|
||||||
get { return banList; }
|
get { return banList; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HasDefaultValue(true, true)]
|
||||||
public bool AllowVoteKick
|
public bool AllowVoteKick
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
@@ -218,9 +219,16 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
doc.Root.SetAttributeValue("SubSelection", subSelectionMode.ToString());
|
doc.Root.SetAttributeValue("SubSelection", subSelectionMode.ToString());
|
||||||
doc.Root.SetAttributeValue("ModeSelection", modeSelectionMode.ToString());
|
doc.Root.SetAttributeValue("ModeSelection", modeSelectionMode.ToString());
|
||||||
|
|
||||||
|
doc.Root.SetAttributeValue("TraitorsEnabled", TraitorsEnabled.ToString());
|
||||||
|
|
||||||
doc.Root.SetAttributeValue("MaxFileTransferDuration", FileStreamSender.MaxTransferDuration.TotalSeconds);
|
doc.Root.SetAttributeValue("MaxFileTransferDuration", FileStreamSender.MaxTransferDuration.TotalSeconds);
|
||||||
|
|
||||||
|
if (GameMain.NetLobbyScreen != null && GameMain.NetLobbyScreen.ServerMessage != null)
|
||||||
|
{
|
||||||
|
doc.Root.SetAttributeValue("ServerMessage", GameMain.NetLobbyScreen.ServerMessage.Text);
|
||||||
|
}
|
||||||
|
|
||||||
XmlWriterSettings settings = new XmlWriterSettings();
|
XmlWriterSettings settings = new XmlWriterSettings();
|
||||||
settings.Indent = true;
|
settings.Indent = true;
|
||||||
settings.NewLineOnAttributes = true;
|
settings.NewLineOnAttributes = true;
|
||||||
@@ -253,9 +261,17 @@ namespace Barotrauma.Networking
|
|||||||
modeSelectionMode = SelectionMode.Manual;
|
modeSelectionMode = SelectionMode.Manual;
|
||||||
Enum.TryParse<SelectionMode>(ToolBox.GetAttributeString(doc.Root, "ModeSelection", "Manual"), out modeSelectionMode);
|
Enum.TryParse<SelectionMode>(ToolBox.GetAttributeString(doc.Root, "ModeSelection", "Manual"), out modeSelectionMode);
|
||||||
Voting.AllowModeVoting = modeSelectionMode == SelectionMode.Vote;
|
Voting.AllowModeVoting = modeSelectionMode == SelectionMode.Vote;
|
||||||
|
|
||||||
|
var traitorsEnabled = TraitorsEnabled;
|
||||||
|
Enum.TryParse<YesNoMaybe>(ToolBox.GetAttributeString(doc.Root, "TraitorsEnabled", "No"), out traitorsEnabled);
|
||||||
|
GameMain.NetLobbyScreen.SetTraitorsEnabled(traitorsEnabled);
|
||||||
|
|
||||||
FileStreamSender.MaxTransferDuration = new TimeSpan(0,0,ToolBox.GetAttributeInt(doc.Root, "MaxFileTransferDuration", 150));
|
FileStreamSender.MaxTransferDuration = new TimeSpan(0,0,ToolBox.GetAttributeInt(doc.Root, "MaxFileTransferDuration", 150));
|
||||||
|
|
||||||
|
if (GameMain.NetLobbyScreen != null && GameMain.NetLobbyScreen.ServerMessage != null)
|
||||||
|
{
|
||||||
|
GameMain.NetLobbyScreen.ServerMessage.Text = ToolBox.GetAttributeString(doc.Root, "ServerMessage", "");
|
||||||
|
}
|
||||||
showLogButton.Visible = SaveServerLogs;
|
showLogButton.Visible = SaveServerLogs;
|
||||||
|
|
||||||
List<string> monsterNames = Directory.GetDirectories("Content/Characters").ToList();
|
List<string> monsterNames = Directory.GetDirectories("Content/Characters").ToList();
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private GUITextBox serverMessage;
|
private GUITextBox serverMessage;
|
||||||
|
|
||||||
|
public GUITextBox ServerMessage
|
||||||
|
{
|
||||||
|
get { return serverMessage; }
|
||||||
|
}
|
||||||
|
|
||||||
public GUIListBox SubList
|
public GUIListBox SubList
|
||||||
{
|
{
|
||||||
get { return subList; }
|
get { return subList; }
|
||||||
|
|||||||
Reference in New Issue
Block a user