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:
@@ -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++;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -29,4 +29,5 @@
|
||||
GameMode="SandBox"
|
||||
MissionType="Random"
|
||||
TraitorsEnabled="No"
|
||||
autobantime="60"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user