From bb4c1550c69e778f848e406ece2d0f92a9fcaef2 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 15 Apr 2018 06:59:47 +1000 Subject: [PATCH] Fix can't set multiple blocks to hidden --- MCGalaxy/Commands/CPE/CustomBlockCommand.cs | 2 +- MCGalaxy/CorePlugin/IPThrottler.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MCGalaxy/Commands/CPE/CustomBlockCommand.cs b/MCGalaxy/Commands/CPE/CustomBlockCommand.cs index 48940c548..769f9398c 100644 --- a/MCGalaxy/Commands/CPE/CustomBlockCommand.cs +++ b/MCGalaxy/Commands/CPE/CustomBlockCommand.cs @@ -481,7 +481,7 @@ namespace MCGalaxy.Commands.CPE { } // Don't let multiple blocks be assigned to same order - if (order != def.BlockID) { + if (order != def.BlockID && order != 255) { for (int i = 0; i < defs.Length; i++) { if (defs[i] == null || defs[i].InventoryOrder != order) continue; Player.Message(p, "Block {0} already had order {1}", defs[i].Name, order); diff --git a/MCGalaxy/CorePlugin/IPThrottler.cs b/MCGalaxy/CorePlugin/IPThrottler.cs index b308a9778..8ad779465 100644 --- a/MCGalaxy/CorePlugin/IPThrottler.cs +++ b/MCGalaxy/CorePlugin/IPThrottler.cs @@ -32,16 +32,16 @@ namespace MCGalaxy.Core { DateTime blockedUntil, now = DateTime.UtcNow; lock (ipsLock) { - IPThrottleEntry entries; - if (!ips.TryGetValue(p.ip, out entries)) { - entries = new IPThrottleEntry(); - ips[p.ip] = entries; + IPThrottleEntry entry; + if (!ips.TryGetValue(p.ip, out entry)) { + entry = new IPThrottleEntry(); + ips[p.ip] = entry; } - blockedUntil = entries.BlockedUntil; + blockedUntil = entry.BlockedUntil; if (blockedUntil < now) { - if (!entries.AddSpamEntry(ServerConfig.IPSpamCount, ServerConfig.IPSpamInterval)) { - entries.BlockedUntil = now.AddSeconds(ServerConfig.IPSpamBlockTime); + if (!entry.AddSpamEntry(ServerConfig.IPSpamCount, ServerConfig.IPSpamInterval)) { + entry.BlockedUntil = now.AddSeconds(ServerConfig.IPSpamBlockTime); } return true; }