private bool CheckStateOfSession(String IP) { if (activeIPs.ContainsKey(IP)) { SessionManager.Warning warning = sessions.checkSession(getHashcodeOfActiveIP(IP)); switch (warning) { case SessionManager.Warning.SESSION_EXPIRED: Console.WriteLine("The session for {0} has expired as {1} hours have passed.", IP, Session.SESSION_LENGTH_IN_HOURS); return false; case SessionManager.Warning.SESSION_DOES_NOT_EXIST: Console.WriteLine("The user has not the necessary privileges to access this feature."); return false; case SessionManager.Warning.NONE: return true; } } return false; }