Added a config option (default off) for banning by usernames.
This commit is contained in:
parent
529f51d95e
commit
3744e49592
2 changed files with 5 additions and 0 deletions
|
|
@ -96,6 +96,7 @@ namespace TShockAPI
|
|||
|
||||
public bool EnableDNSHostResolution = false;
|
||||
|
||||
public bool EnableBanOnUsernames = false;
|
||||
public static ConfigFile Read(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ namespace TShockAPI.DB
|
|||
|
||||
public Ban GetBanByName(string name, bool casesensitive = true)
|
||||
{
|
||||
if (!TShock.Config.EnableBanOnUsernames)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
using (var com = database.CreateCommand())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue