private string Color(ChatInfo info) { if (info.Mobile.NetState == null || info.PublicDisabled || (info.Hidden && info.Mobile.AccessLevel > Owner.AccessLevel)) { return(HTML.Gray); } if (info.Banned) { return(HTML.Red); } if (c_Info.Ignoring(info.Mobile)) { return(HTML.AshRed); } if (c_Info.GlobalIgnoring(info.Mobile)) { return(HTML.DarkGray); } if (info.Mobile.AccessLevel != AccessLevel.Player) { return(HTML.Blue); } if (Owner.Guild != null && Owner.Guild == info.Mobile.Guild) { return(HTML.Green); } if (FactionChat.SameFaction(Owner, info.Mobile)) { return(HTML.Purple); } return(HTML.White); }
private void BuildList() { try{ c_List.Clear(); switch (c_Listing) { case Listing.Public: foreach (ChatInfo info in new ArrayList(ChatInfo.ChatInfos.Values)) { if (info.Mobile == null || info.Mobile.Deleted) { ChatInfo.ChatInfos.Remove(info); continue; } if (info.Mobile.NetState == null || info.Mobile.AccessLevel != AccessLevel.Player) { continue; } if (PublicChat.CanChat(info) || Owner.AccessLevel > info.Mobile.AccessLevel) { c_List.Add(info.Mobile); } } c_List.Sort(new MobileName()); break; case Listing.Friends: c_List = new ArrayList(c_Info.Friends); if (!ChatInfo.ShowStaff) { foreach (Mobile m in new ArrayList(c_List)) { if (m.AccessLevel != AccessLevel.Player) { c_List.Remove(m); } } } c_List.Sort(new MobileName()); break; case Listing.Search: if (c_Info.Search == "") { break; } foreach (ChatInfo info in ChatInfo.ChatInfos.Values) { if (!ChatInfo.ShowStaff && info.Mobile.AccessLevel != AccessLevel.Player) { continue; } if (info.Mobile.Name.ToLower().IndexOf(c_Info.Search.ToLower()) != -1 && info.Mobile.NetState != null) { c_List.Add(info.Mobile); } } c_List.Sort(new MobileName()); break; case Listing.IRC: c_List = new ArrayList(ChatInfo.IrcList); c_List.Sort(new Alpha()); break; case Listing.Messages: c_List = new ArrayList(c_Mailbox ? c_Info.Messages : c_Info.SavedMsgs); c_List.Sort(new MessageTime()); break; case Listing.Ignores: c_List = new ArrayList(c_Info.Ignores); c_List.AddRange(c_Info.GlobalIgnores); if (!ChatInfo.ShowStaff) { foreach (Mobile m in new ArrayList(c_List)) { if (m.AccessLevel != AccessLevel.Player) { c_List.Remove(m); } } } c_List.Sort(new MobileName()); break; case Listing.Guild: foreach (ChatInfo info in ChatInfo.ChatInfos.Values) { if (info.Mobile.Guild != null && info.Mobile.Guild == Owner.Guild) { c_List.Add(info.Mobile); } } c_List.Sort(new MobileName()); break; case Listing.Faction: foreach (ChatInfo info in ChatInfo.ChatInfos.Values) { if (FactionChat.SameFaction(Owner, info.Mobile)) { c_List.Add(info.Mobile); } } c_List.Sort(new MobileName()); break; case Listing.Staff: foreach (ChatInfo info in ChatInfo.ChatInfos.Values) { if (info.Mobile.AccessLevel != AccessLevel.Player) { c_List.Add(info.Mobile); } } c_List.Sort(new MobileAccessLevel()); break; case Listing.Banned: foreach (ChatInfo info in ChatInfo.ChatInfos.Values) { if (info.Banned) { c_List.Add(info.Mobile); } } c_List.Sort(new MobileName()); break; } }catch { Errors.Report(String.Format("ListGump-> BuildList-> |{0}|", Owner)); } }