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 int MaxSlots = 8;
|
||||
public bool RangeChecks = true;
|
||||
public bool SpamChecks = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -31,6 +31,7 @@ namespace TShockAPI
|
|||
public static string distributationAgent = "facepunch";
|
||||
public static int authToken;
|
||||
public static int maxSlots = 8;
|
||||
public static bool spamChecks = false;
|
||||
|
||||
public enum NPCList
|
||||
{
|
||||
|
|
@ -65,6 +66,7 @@ namespace TShockAPI
|
|||
distributationAgent = cfg.DistributationAgent;
|
||||
maxSlots = cfg.MaxSlots;
|
||||
rangeChecks = cfg.RangeChecks;
|
||||
spamChecks = cfg.SpamChecks;
|
||||
NPC.maxSpawns = defaultMaxSpawns;
|
||||
NPC.defaultSpawnRate = defaultSpawnRate;
|
||||
}
|
||||
|
|
@ -100,7 +102,7 @@ namespace TShockAPI
|
|||
cfg.SpawnProtectionRadius = 5;
|
||||
cfg.MaxSlots = maxSlots;
|
||||
cfg.RangeChecks = rangeChecks;
|
||||
|
||||
cfg.SpamChecks = spamChecks;
|
||||
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
||||
TextWriter tr = new StreamWriter(FileTools.SaveDir + "config.json");
|
||||
tr.Write(json);
|
||||
|
|
|
|||
|
|
@ -140,10 +140,8 @@ namespace TShockAPI
|
|||
Log.Info(version);
|
||||
Log.Info("Starting...");
|
||||
|
||||
GameHooks.Initialize += OnPreInit;
|
||||
GameHooks.PostInitialize += OnPostInit;
|
||||
GameHooks.Update += OnUpdate;
|
||||
GameHooks.LoadContent += OnLoadContent;
|
||||
ServerHooks.Chat += OnChat;
|
||||
ServerHooks.Join += OnJoin;
|
||||
NetHooks.GetData += GetData;
|
||||
|
|
@ -192,10 +190,8 @@ namespace TShockAPI
|
|||
{
|
||||
Bans.SaveBans();
|
||||
|
||||
GameHooks.Initialize -= OnPreInit;
|
||||
GameHooks.PostInitialize -= OnPostInit;
|
||||
GameHooks.Update -= OnUpdate;
|
||||
GameHooks.LoadContent -= OnLoadContent;
|
||||
ServerHooks.Chat -= OnChat;
|
||||
ServerHooks.Join -= OnJoin;
|
||||
ServerHooks.Command -= ServerHooks_OnCommand;
|
||||
|
|
@ -657,14 +653,8 @@ namespace TShockAPI
|
|||
handler.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnLoadContent(ContentManager obj)
|
||||
{
|
||||
}
|
||||
|
||||
private void OnPreInit()
|
||||
{
|
||||
Netplay.serverSock[ply].spamCheck = ConfigurationManager.spamChecks;
|
||||
}
|
||||
|
||||
private void OnPostInit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue