Пример #1
0
 public static string GenerateNames(string channel, Channel chan)
 {
     string nameList = "";
     foreach (KeyValuePair<string, Client> entry in chan.Clients)
         nameList += entry.Value.NickName + " ";
     return "server NAMES " + channel + " :" + nameList;
 }
Пример #2
0
 public void SendToChannel(Channel channel, string message, Client sender, bool sendToSender = false)
 {
     try
     {
         foreach (KeyValuePair<string, Client> client in channel.Clients)
             if (client.Value.NickName != sender.NickName || sendToSender)
                 SendToUser(client.Value.NickName, message, sender);
     }
     catch (IOException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Пример #3
0
 private void removeUser(Client client, Channel channel)
 {
     channel.Clients.Remove(client.NickName);
     if (channel.OpUsers.ContainsKey(client.NickName))
         channel.OpUsers.Remove(client.NickName);
     client.Channels.Remove(channel.ChannelName);
 }
Пример #4
0
 public static string GenerateTopic(Channel channel)
 {
     return "server TOPIC " + channel.ChannelName + " :" + channel.ChannelTopic;
 }
Пример #5
0
 private bool checkPerms(Channel channel, string nick)
 {
     return channel.OpUsers.ContainsKey(nick);
 }