public List <Channel> JoinChannels(string PlayerName, bool CheckPassword) { List <Channel> Chans = new List <Channel>(); foreach (Channel Chan in Channels.Values.ToArray()) { if (Chan.Join(PlayerName, "", CheckPassword) == ChannelResult.CHANNEL_OK) { Chans.Add(Chan); } } return(Chans); }
static void OnJoin(WorldClient client, CMSG msgID, BinReader data) { string ChanName = (string)data.ReadString(); if (ChanName != null) { Channel Chan; if ((Chan = ChanExists(ChanName)) != null) { Chan.Join(client); } else { Chan = new Channel(ChanName, client); Channels.Add(Chan); } } }