mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Fix can't set multiple blocks to hidden
This commit is contained in:
parent
717e2beaed
commit
bb4c1550c6
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user