Fixed how ban logic works so it matches the description of the variables EnableBanOnUsernames & EnableIPBans
Now it doesn't prevent bans being created or found but it only actions kicks on join based on the relavent config options. Changed /unban <player> to only work on names and /unbanip <ip> to only work on ip's to avoid user confusion Changed error message returned when no bans are found when actioning /unban <player> & /unbanip <ip> to be more appropriate Fixed formatting of -maxplayers / -players block
This commit is contained in:
parent
2c8c5dc7b9
commit
2f3bfca082
2 changed files with 21 additions and 24 deletions
|
|
@ -388,11 +388,11 @@ namespace TShockAPI
|
|||
Console.WriteLine("Startup parameter overrode REST port.");
|
||||
|
||||
}
|
||||
if ((parms[i].ToLower() == "-maxplayers")||(parms[i].ToLower() == "-players"))
|
||||
{
|
||||
Config.MaxSlots = Convert.ToInt32(parms[++i]);
|
||||
Console.WriteLine("Startup parameter overrode maximum player slot configuration value.");
|
||||
}
|
||||
if ((parms[i].ToLower() == "-maxplayers")||(parms[i].ToLower() == "-players"))
|
||||
{
|
||||
Config.MaxSlots = Convert.ToInt32(parms[++i]);
|
||||
Console.WriteLine("Startup parameter overrode maximum player slot configuration value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -659,10 +659,18 @@ namespace TShockAPI
|
|||
return;
|
||||
}
|
||||
|
||||
var nameban = Bans.GetBanByName(player.Name);
|
||||
Ban ban = null;
|
||||
if (nameban != null && Config.EnableBanOnUsernames)
|
||||
ban = nameban;
|
||||
if (Config.EnableBanOnUsernames)
|
||||
{
|
||||
var newban = Bans.GetBanByName(player.Name);
|
||||
if (null != newban)
|
||||
ban = newban;
|
||||
}
|
||||
|
||||
if (Config.EnableIPBans && null == ban)
|
||||
{
|
||||
ban = Bans.GetBanByIp(player.IP);
|
||||
}
|
||||
|
||||
if (ban != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue