Пример #1
0
 /// <summary>
 /// Called when recieved Json that should be sent to all clients.
 /// </summary>
 protected virtual void OnAuthenticated(string[] taskServers)
 {
     if (Authenticated != null)
     {
         AuthenticatedEventArgs e = new AuthenticatedEventArgs();
         e.servers = taskServers;
         Authenticated(this, e);
     }
 }
Пример #2
0
        private void Client_Authenticated(object sender, AuthenticatedEventArgs e)
        {
            string[] servers = e.servers;
            foreach (string s in servers)
            {
                if (!taskServers.ContainsKey(s))
                {
                    TaskServer server = new TaskServer(s);
                    taskServers.Add(s, server);
                }

                taskServers[s].AddClient((ClientHandler)sender);
            }
        }