public int Login(string userName) { //is anyone else logged in with my name? foreach (var client in _connectedClients) { if(client.Key.ToLower() == userName.ToLower()) { //if yes return 1; } } var establishedUserConnection = OperationContext.Current.GetCallbackChannel<IClient>(); ConnectedClient newClient = new ConnectedClient(); newClient.connection = establishedUserConnection; newClient.UserName = userName; Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("Client has logged in: {0} at {1}", newClient.UserName, DateTime.Now); Console.ResetColor(); _connectedClients.TryAdd(userName, newClient); return 0; }