Example #1
0
 private void SendUsersOnlineListToUser(IBroadcasterClient chatClient)
 {
     foreach (var client in _clientsOnline)
     {
         chatClient.OnUserCame(client.GetUsername());
     }
 }
Example #2
0
 private void SendHeundreedMessagesToUser(IBroadcasterClient chatClient)
 {
     foreach (var message in _hundreedMessages)
     {
         chatClient.OnMessageRecieved(message);
     }
 }
Example #3
0
 public void RemoveBroadcasterClient(IBroadcasterClient chatClient)
 {
     lock (this) {
         _clientsOnline.Remove(chatClient);
         chatClient.Dispose();
         NotifyClientsUserQuit(chatClient.GetUsername());
     }
 }
Example #4
0
        public void AddBroadcasterClient(IBroadcasterClient chatClient)
        {
            lock (this) {
                try {
                    SendHeundreedMessagesToUser(chatClient);
                    SendUsersOnlineListToUser(chatClient);
                }
                catch (Exception) {
                    chatClient.Dispose();
                }

                _clientsOnline.Add(chatClient);
                NotifyClientsNewUserCame(chatClient.GetUsername());
            }
        }