Beispiel #1
0
        public void Start()
        {
            Stopwatch sw = Stopwatch.StartNew();

            // Connect to MySQL first
            try
            {
                _logger.InfoAuth("Connecting to AUTH MySQL database...");
                AuthDatabase.Instance.TryConnect(AuthConfig.Instance.MySQLAuth.Server, AuthConfig.Instance.MySQLAuth.User, AuthConfig.Instance.MySQLAuth.Password, AuthConfig.Instance.MySQLAuth.Database);
            }
            catch (Exception ex)
            {
                _logger.Error("Could not connect to MySQL database: {0}\r\n{1}", ex.Message, ex.StackTrace);
                Environment.Exit(0);
            }
            _logger.InfoAuth("Succesfully connected to {0} ", AuthConfig.Instance.MySQLAuth.Database);

            // Start Remote Server
            _remoteServer.Open();
            _logger.InfoAuth("Remote server started! Current setting is: {0}", AuthConfig.Instance.Remote.Binding);

            // Start NAT servers
            _natServer.Start();
            _natServer2.Start();
            _logger.InfoAuth("NAT servers started!");

            _server.Start();

            sw.Stop();
            _logger.InfoAuth("Auth Server finished initializing in {0} ms", sw.Elapsed.TotalMilliseconds);
        }
Beispiel #2
0
        public void Start()
        {
            _logger.Info("Connecting to MySQL database...");
            try
            {
                AuthDatabase.Instance.TryConnect(AuthConfig.Instance.MySQLAuth.Server, AuthConfig.Instance.MySQLAuth.User, AuthConfig.Instance.MySQLAuth.Password, AuthConfig.Instance.MySQLAuth.Database);
            }
            catch (Exception ex)
            {
                _logger.Error("Could not connect to MySQL database: {0}\r\n{1}",
                              ex.Message, ex.StackTrace);
                Environment.Exit(0);
            }

            _remoteServer.Open();
            _natServer.Start();
            _natServer2.Start();
            _server.Start();
            _logger.Info("Ready for connections!");
        }