Пример #1
0
        static void Main(string[] args)
        {
            var ip = NetworkUtilities.GetThisIPv4Adress();

            _server = new DrawingHammerServer(new X509Certificate2("certificate.pfx", "password"), ip, 9999);

            _server.ClientConnected    += OnClientConnected;
            _server.PackageReceived    += OnPackageReceived;
            _server.ClientDisconnected += OnClientDisconnected;

            _server.Start();
        }
Пример #2
0
        private static void Main(string[] args)
        {
            //Uid setzen:
            Console.Write("Set your Uid: ");
            _uid = Console.ReadLine();


            _client = new SslClient(NetworkUtilities.GetThisIPv4Adress(), true);

            _client.ConnectionLost    += OnConnectionLost;
            _client.ConnectionSucceed += OnConnectionSucceed;
            _client.PackageReceived   += OnPackageReceived;

            _client.Connect(NetworkUtilities.GetThisIPv4Adress(), 9999);
        }
Пример #3
0
        // ReSharper disable once UnusedParameter.Local
        private static void Main(string[] args)
        {
            _settingsManager = new SettingsManager(SettingsPath);

            InitializeSettingsFile();

            if (String.IsNullOrWhiteSpace(_settingsManager.GetSslCertificatePath()))
            {
                FatalExit($"No Ssl-Certificate path specified. Please set the path to the Ssl-Certificate in {SettingsPath}");
            }

            if (!File.Exists(_settingsManager.GetSslCertificatePath()))
            {
                FatalExit("Ssl-Certificate not found! Please check the path you specified in your Settings-File.");
            }

            Log.DisplaySelfCertDetails(new X509Certificate2(
                                           _settingsManager.GetSslCertificatePath(),
                                           _settingsManager.GetSslCertificatePassword()));

            InitializeDatabaseConnection();
            Log.Info("");

            string ip = !String.IsNullOrWhiteSpace(_settingsManager.GetStartupIp()) ? _settingsManager.GetStartupIp() : NetworkUtilities.GetThisIPv4Adress();

            _server = new DrawingHammerServer(new X509Certificate2(_settingsManager.GetSslCertificatePath(), _settingsManager.GetSslCertificatePassword()), ip, _settingsManager.GetStartupPort());

            _server.ClientConnected    += OnClientConnected;
            _server.ClientDisconnected += OnClientDisconnected;
            _server.PackageReceived    += OnPackageReceived;
            _server.Start();

            _authenticationManager = new AuthenticationManager();

            _matches = new ObservableCollection <Match>();

            StartCommandLineHandler();
        }