Пример #1
0
        // Login client
        public Cookie LogIn(string clientName, string folderPath)
        {
            var clientAccount = new ClientAccount()
            {
                Name                = clientName,
                IsPremium           = Configuration.PremiumClients.Contains(clientName),
                PerformedOperations = 0,
                TransferTotalSize   = 0
            };

            Server.LogClientIn(clientAccount);

            return(new Cookie(clientName, folderPath));
        }
Пример #2
0
 public static void LogClientIn(ClientAccount clientAccount)
 {
     LoggedClients.Add(clientAccount);
     CalculateMaxTasksPerClient();
     ClientLoggedIn?.Invoke(LoggedClients);
 }
Пример #3
0
 public static void LogClientOut(ClientAccount clientAccount)
 {
     LoggedClients.Remove(clientAccount);
     CalculateMaxTasksPerClient();
     ClientLoggedOut?.Invoke(LoggedClients);
 }