Auto ban users that have been vote kicked. Define the auto ban time in the server settings. (Issue #128) NOTE: Not tested!

This commit is contained in:
itchyOwl
2018-03-27 11:27:13 +03:00
parent 3106efa023
commit a48a4975ca
3 changed files with 10 additions and 0 deletions

View File

@@ -1934,6 +1934,7 @@ namespace Barotrauma.Networking
{
SendChatMessage(c.Name + " has been kicked from the server.", ChatMessageType.Server, null);
KickClient(c, "Kicked by vote");
BanClient(c, "Kicked by vote (auto ban)", duration: TimeSpan.FromSeconds(AutoBanTime));
}
GameMain.NetLobbyScreen.LastUpdateID++;

View File

@@ -254,6 +254,12 @@ namespace Barotrauma.Networking
set;
}
[Serialize(60f, true)]
public float AutoBanTime
{
get;
private set;
}
private void SaveSettings()
{
XDocument doc = new XDocument(new XElement("serversettings"));
@@ -361,6 +367,8 @@ namespace Barotrauma.Networking
if (!monsterEnabled.ContainsKey(s)) monsterEnabled.Add(s, true);
}
extraCargo = new Dictionary<ItemPrefab, int>();
AutoBanTime = doc.Root.GetAttributeFloat("autobantime", 60);
}
public void LoadClientPermissions()

View File

@@ -29,4 +29,5 @@
GameMode="SandBox"
MissionType="Random"
TraitorsEnabled="No"
autobantime="60"
/>