/// <summary> Replaces this instance's access permissions /// with a copy of the source's access permissions </summary> public void CloneAccess(AccessController source) { Min = source.Min; Max = source.Max; // TODO this sould be atomic Whitelisted.Clear(); Whitelisted.AddRange(source.Whitelisted); Blacklisted.Clear(); Blacklisted.AddRange(source.Blacklisted); }
public bool CheckAffect(Player p, ushort x, ushort y, ushort z, BlockID old, BlockID block) { if (!p.group.Blocks[old] || !p.group.Blocks[block]) { return(false); } AccessController denier = CanAffect(p, x, y, z); if (denier == null) { return(true); } if (p.lastAccessStatus < DateTime.UtcNow) { denier.CheckDetailed(p); p.lastAccessStatus = DateTime.UtcNow.AddSeconds(2); } return(false); }