private static bool Check_Clan_Logout() { ArrayList names = Util.GetArray(Globals.gamedata.alertoptions.clan_value_logout); ArrayList clan_ids = new ArrayList(); //first lets convert all our clan names to an arraylist of uint ids Globals.ClanListLock.EnterReadLock(); try { foreach (Clan_Info clan_info in Globals.clanlist.Values) { foreach (string clan_name in names) { if (System.String.Equals(clan_info.ClanName.ToUpperInvariant(), clan_name)) { clan_ids.Add(clan_info.ID); } } } } finally { Globals.ClanListLock.ExitReadLock(); } //now lets look thru every char and see if we can find ppl with those clan ids Globals.PlayerLock.EnterReadLock(); try { foreach (CharInfo player in Globals.gamedata.nearby_chars.Values) { foreach (uint clan_id in clan_ids) { if (player.ClanID == clan_id) { return(true); } } } } finally { Globals.PlayerLock.ExitReadLock(); } return(false); }
private static bool Check_Player() { ArrayList names = Util.GetArray(Globals.gamedata.alertoptions.player_value); Globals.PlayerLock.EnterReadLock(); try { foreach (CharInfo player in Globals.gamedata.nearby_chars.Values) { if (names.Contains(player.Name.ToUpperInvariant())) { if (Globals.gamedata.alertoptions.beepon_player_ignoreparty) { Globals.PartyLock.EnterReadLock(); try { //make sure they aren't in are party... or OOP name list if (!Util.IsPartyMember(player.ID) && !Globals.gamedata.botoptions.OOPIDs.Contains(player.ID)) { return(true); } } finally { Globals.PartyLock.ExitReadLock(); } } else { return(true); } } } } finally { Globals.PlayerLock.ExitReadLock(); } return(false); }
private static bool Check_Player_Logout() { ArrayList names = Util.GetArray(Globals.gamedata.alertoptions.player_value_logout); Globals.PlayerLock.EnterReadLock(); try { foreach (CharInfo player in Globals.gamedata.nearby_chars.Values) { if (names.Contains(player.Name.ToUpperInvariant())) { return(true); } } } finally { Globals.PlayerLock.ExitReadLock(); } return(false); }
private static bool Check_Clan() { ArrayList names = Util.GetArray(Globals.gamedata.alertoptions.clan_value); ArrayList clan_ids = new ArrayList(); //first lets convert all our clan names to an arraylist of uint ids Globals.ClanListLock.EnterReadLock(); try { foreach (Clan_Info clan_info in Globals.clanlist.Values) { foreach (string clan_name in names) { if (System.String.Equals(clan_info.ClanName.ToUpperInvariant(), clan_name)) { clan_ids.Add(clan_info.ID); } } } } finally { Globals.ClanListLock.ExitReadLock(); } //now lets look thru every char and see if we can find ppl with those clan ids Globals.PlayerLock.EnterReadLock(); try { foreach (CharInfo player in Globals.gamedata.nearby_chars.Values) { foreach (uint clan_id in clan_ids) { if (player.ClanID == clan_id) { if (Globals.gamedata.alertoptions.beepon_clan_ignoreparty) { Globals.PartyLock.EnterReadLock(); try { //make sure they aren't in are party... or OOP name list if (!Util.IsPartyMember(player.ID) && !Globals.gamedata.botoptions.OOPIDs.Contains(player.ID)) { return(true); } } finally { Globals.PartyLock.ExitReadLock(); } } else { return(true); } } } } } finally { Globals.PlayerLock.ExitReadLock(); } return(false); }