Added SpamChecks config option which is false by default. This disables redigit's shitty anti grief.
This commit is contained in:
parent
a928a59fe3
commit
c4033af6f2
3 changed files with 5 additions and 12 deletions
|
|
@ -22,5 +22,6 @@
|
||||||
public string DistributationAgent = "facepunch";
|
public string DistributationAgent = "facepunch";
|
||||||
public int MaxSlots = 8;
|
public int MaxSlots = 8;
|
||||||
public bool RangeChecks = true;
|
public bool RangeChecks = true;
|
||||||
|
public bool SpamChecks = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -31,6 +31,7 @@ namespace TShockAPI
|
||||||
public static string distributationAgent = "facepunch";
|
public static string distributationAgent = "facepunch";
|
||||||
public static int authToken;
|
public static int authToken;
|
||||||
public static int maxSlots = 8;
|
public static int maxSlots = 8;
|
||||||
|
public static bool spamChecks = false;
|
||||||
|
|
||||||
public enum NPCList
|
public enum NPCList
|
||||||
{
|
{
|
||||||
|
|
@ -65,6 +66,7 @@ namespace TShockAPI
|
||||||
distributationAgent = cfg.DistributationAgent;
|
distributationAgent = cfg.DistributationAgent;
|
||||||
maxSlots = cfg.MaxSlots;
|
maxSlots = cfg.MaxSlots;
|
||||||
rangeChecks = cfg.RangeChecks;
|
rangeChecks = cfg.RangeChecks;
|
||||||
|
spamChecks = cfg.SpamChecks;
|
||||||
NPC.maxSpawns = defaultMaxSpawns;
|
NPC.maxSpawns = defaultMaxSpawns;
|
||||||
NPC.defaultSpawnRate = defaultSpawnRate;
|
NPC.defaultSpawnRate = defaultSpawnRate;
|
||||||
}
|
}
|
||||||
|
|
@ -100,7 +102,7 @@ namespace TShockAPI
|
||||||
cfg.SpawnProtectionRadius = 5;
|
cfg.SpawnProtectionRadius = 5;
|
||||||
cfg.MaxSlots = maxSlots;
|
cfg.MaxSlots = maxSlots;
|
||||||
cfg.RangeChecks = rangeChecks;
|
cfg.RangeChecks = rangeChecks;
|
||||||
|
cfg.SpamChecks = spamChecks;
|
||||||
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
||||||
TextWriter tr = new StreamWriter(FileTools.SaveDir + "config.json");
|
TextWriter tr = new StreamWriter(FileTools.SaveDir + "config.json");
|
||||||
tr.Write(json);
|
tr.Write(json);
|
||||||
|
|
|
||||||
|
|
@ -140,10 +140,8 @@ namespace TShockAPI
|
||||||
Log.Info(version);
|
Log.Info(version);
|
||||||
Log.Info("Starting...");
|
Log.Info("Starting...");
|
||||||
|
|
||||||
GameHooks.Initialize += OnPreInit;
|
|
||||||
GameHooks.PostInitialize += OnPostInit;
|
GameHooks.PostInitialize += OnPostInit;
|
||||||
GameHooks.Update += OnUpdate;
|
GameHooks.Update += OnUpdate;
|
||||||
GameHooks.LoadContent += OnLoadContent;
|
|
||||||
ServerHooks.Chat += OnChat;
|
ServerHooks.Chat += OnChat;
|
||||||
ServerHooks.Join += OnJoin;
|
ServerHooks.Join += OnJoin;
|
||||||
NetHooks.GetData += GetData;
|
NetHooks.GetData += GetData;
|
||||||
|
|
@ -192,10 +190,8 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
Bans.SaveBans();
|
Bans.SaveBans();
|
||||||
|
|
||||||
GameHooks.Initialize -= OnPreInit;
|
|
||||||
GameHooks.PostInitialize -= OnPostInit;
|
GameHooks.PostInitialize -= OnPostInit;
|
||||||
GameHooks.Update -= OnUpdate;
|
GameHooks.Update -= OnUpdate;
|
||||||
GameHooks.LoadContent -= OnLoadContent;
|
|
||||||
ServerHooks.Chat -= OnChat;
|
ServerHooks.Chat -= OnChat;
|
||||||
ServerHooks.Join -= OnJoin;
|
ServerHooks.Join -= OnJoin;
|
||||||
ServerHooks.Command -= ServerHooks_OnCommand;
|
ServerHooks.Command -= ServerHooks_OnCommand;
|
||||||
|
|
@ -657,14 +653,8 @@ namespace TShockAPI
|
||||||
handler.Handled = true;
|
handler.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void OnLoadContent(ContentManager obj)
|
Netplay.serverSock[ply].spamCheck = ConfigurationManager.spamChecks;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPreInit()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPostInit()
|
private void OnPostInit()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue