private bool CheckWhitelist(PlayerModel player, uint flags)
{
if (player == null) return false;
String guid = (String.IsNullOrEmpty(player.EAGUID)) ? INVALID_NAME_TAG_GUID : player.EAGUID;
String xt = ExtractTag(player);
if (String.IsNullOrEmpty(xt)) xt = INVALID_NAME_TAG_GUID;
foreach (String item in fSettingWhitelist) {
List<String> tokens = new List<String>(Regex.Split(item, @"\s+"));
if (tokens.Count < 1) {
ConsoleError("tokens.Count < 1!");
continue;
}
if (tokens[0] == player.Name || tokens[0] == xt || tokens[0] == guid) {
if (DebugLevel >= 7) {
DebugWrite("^b" + player.Name + ", " + xt + ", ^n" + player.Whitelist.ToString("X") + ", " + guid, 7);
DebugWrite("WL: " + String.Join(", ", tokens.ToArray()), 7);
String fs = String.Empty;
if ((player.Whitelist & WL_BALANCE) == WL_BALANCE) fs = fs + "B ";
if ((player.Whitelist & WL_UNSTACK) == WL_UNSTACK) fs = fs + "U ";
if ((player.Whitelist & WL_SWITCH) == WL_SWITCH) fs = fs + "S ";
if ((player.Whitelist & WL_RANK) == WL_RANK) fs = fs + "R ";
if ((player.Whitelist & WL_DISPERSE) == WL_DISPERSE) fs = fs + "D ";
if (fs == String.Empty) fs = "(none)";
DebugWrite("CheckWhitelist ^b" + player.FullName + "^n " + fs, 7);
}
return ((player.Whitelist & flags) == flags);
}
}
return false;
}