public void create_session()
        {
            Connector connection = Connector.getInstance();
            SessionManager sm = new SessionManager(connection);

            Eindopdracht.SessionManager.Warning warning;
            int hashcode = sm.Login("chris", "password", "127.0.0.1", out warning);

            Assert.AreEqual(warning, Eindopdracht.SessionManager.Warning.NONE);
        }
        public SecuredWebserver(SettingsReader Settings)
            : base(Settings)
        {
            this.Settings = Settings;
            activeIPs = new Dictionary<string, int>();
            connector = Connector.getInstance();
            sessions = new SessionManager(connector);
            logger = Logger.getInstance();

            listener = new TcpListener(IPAddress.Parse("127.0.0.1"), Settings.AdminPort);
            //certificate = new X509Certificate2(cerficicate_name, "ChrisLuke");
        }
        private int HandleLoginAttempt(String[] loginParams, String IP, out SessionManager.Warning warning)
        {
            string username = loginParams[0].Split('=')[1];
            string password = loginParams[1].Split('=')[1];

            return sessions.Login(username, password, IP, out warning);
        }