Beispiel #1
0
        /*
         * MAIN BATTLEYE CALLBACK FUNCTIONS
         */
        #region BE_INTF_MAIN

        private void BattlEyeConnected(BattlEyeConnectEventArgs args)
        {
            bool connected = false;

            if (args.ConnectionResult == BattlEyeConnectionResult.Success)
            {
                this.Invoke((MethodInvoker) delegate() { appendChat("\nConnection successful\n", Color.Black); connected = true; });
            }
            if (args.ConnectionResult == BattlEyeConnectionResult.InvalidLogin)
            {
                this.Invoke((MethodInvoker) delegate() { appendChat("\nInvalid login details\n", Color.Black); });
            }
            if (args.ConnectionResult == BattlEyeConnectionResult.ConnectionFailed)
            {
                this.Invoke((MethodInvoker) delegate() { appendChat("\nConnection failed\n", Color.Black); });
            }

            if (connected)
            {
                this.Invoke((MethodInvoker) delegate() { handleConnect(); });
            }
            else
            {
                this.Invoke((MethodInvoker) delegate() { handleDisconnect(); });
            }
        }
 private void OnBattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     if (Connected)
     {
         BattlEyeConnected?.Invoke(args);
     }
 }
Beispiel #3
0
 void BattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     if (OnBeConnectedEvent != null)
     {
         OnBeConnectedEvent();
     }
 }
Beispiel #4
0
 private void Connected(BattlEyeConnectEventArgs pArgs)
 {
     if (pArgs.ConnectionResult == BattlEyeConnectionResult.Success)
     {
         SendMessage(new BE_Message(BE_MessageType.ServerConnected, null));
         Execute(BattlEyeCommand.Players);
     }
 }
Beispiel #5
0
        private void HandleConnect(BattlEyeConnectEventArgs args)
        {
            switch (args.ConnectionResult)
            {
            case BattlEyeConnectionResult.Success:
                if (Settings.Default.showConnectMessages && _form != null)
                {
                    if (!_reconnecting && _form.connect.Enabled == true)
                    {
                        if (Settings.Default.killFeed)
                        {
                            CreateNewReader();     // Start new ADM Reader instance (_myTail)
                            _hasDisconnected = false;
                        }
                        _form.Log("Connected!", LogType.Console, false);
                    }
                    else
                    {
                        if (Settings.Default.killFeed)
                        {
                            CreateNewReader();     // Start new ADM Reader instance (_myTail)
                            _hasDisconnected = false;
                        }
                        _form.Log("Reconnected!", LogType.Console, false);
                    }
                }
                _error = false;
                break;

            case BattlEyeConnectionResult.InvalidLogin:
                if (_form != null)
                {
                    _form.Log("Login invalid!", LogType.Console, false);
                }
                _error = true;
                break;

            case BattlEyeConnectionResult.ConnectionFailed:
                if (_form.connect.Enabled)
                {
                    if (_form != null)
                    {
                        _form.Log("Failed to connect. Please make sure that you properly set a password in beserver.cfg and the server is running.", LogType.Console, false);
                    }
                }
                _error = true;
                break;

            default:
                if (_form != null)
                {
                    _form.Log("Unknown error.", LogType.Console, false);
                }
                _error = true;
                break;
            }
        }
Beispiel #6
0
        private void OnBattlEyeConnected(BattlEyeConnectEventArgs args)
        {
            _log.Info($"{_serverName}: Connected");

            if (Connected)
            {
                BattlEyeConnected?.Invoke(args);
            }
        }
Beispiel #7
0
 private void Client_BattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     lock (_lock)
     {
         if (_client.Connected)
         {
             Console.WriteLine("Connection reestablished");
         }
     }
 }
Beispiel #8
0
        private static void BattlEyeConnected(BattlEyeConnectEventArgs args)
        {
            //if (args.ConnectionResult == BattlEyeConnectionResult.Success) { /* Connected successfully */ }
            //if (args.ConnectionResult == BattlEyeConnectionResult.InvalidLogin) { /* Connection failed, invalid login details */ }
            //if (args.ConnectionResult == BattlEyeConnectionResult.ConnectionFailed) { /* Connection failed, host unreachable */ }

            if (args.ConnectionResult == BattlEyeConnectionResult.ConnectionFailed) /* Connection failed, host unreachable */
            {
                Environment.Exit(0);                                                // Выход при неподключении
            }
        }
Beispiel #9
0
 private void BattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     if (args.ConnectionResult == BattlEyeConnectionResult.Success)
     {
         AppConsole.Log(String.Format("Connected to {0}:{1}", _settings.Address, _settings.Port));
     }
     else
     {
         AppConsole.Log(String.Format("Connection to {0}:{1} failed: {2}", _settings.Address, _settings.Port, args.Message), ConsoleColor.Red);
         if (_connected)
         {
             Thread.Sleep(2000);
             Environment.Exit(0);
         }
     }
 }
Beispiel #10
0
        private void HandleConnect(BattlEyeConnectEventArgs args)
        {
            switch (args.ConnectionResult)
            {
            case BattlEyeConnectionResult.Success:
                if (Settings.Default.showConnectMessages && _form != null)
                {
                    if (!_reconnecting && _form.connect.Enabled == true)
                    {
                        _form.Log(Resources.Strings.Connected, LogType.Console, false);
                    }
                    else
                    {
                        _form.Log(Resources.Strings.Reconnected, LogType.Console, false);
                    }
                }
                _error = false;
                break;

            case BattlEyeConnectionResult.InvalidLogin:
                if (_form != null)
                {
                    _form.Log(Resources.Strings.Error_login, LogType.Console, false);
                }
                _error = true;
                break;

            case BattlEyeConnectionResult.ConnectionFailed:
                if (_form.connect.Enabled)
                {
                    if (_form != null)
                    {
                        _form.Log(Resources.Strings.Error_connect, LogType.Console, false);
                    }
                }
                _error = true;
                break;

            default:
                if (_form != null)
                {
                    _form.Log(Resources.Strings.Error_occ, LogType.Console, false);
                }
                _error = true;
                break;
            }
        }
Beispiel #11
0
 private static void BattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     // This method decides what to do when getting connected to the BE server
     if (args.ConnectionResult == BattlEyeConnectionResult.Success)
     {
         Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + " Succesful connection to BE server.");
     }
     if (args.ConnectionResult == BattlEyeConnectionResult.InvalidLogin)
     {
         Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + " Connection error: Invalid login details! Please check your password in settings.cfg. Press ENTER to exit");
         Console.ReadLine();
         Environment.Exit(0);
     }
     if (args.ConnectionResult == BattlEyeConnectionResult.ConnectionFailed)
     {
         Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + " Connection error: server unreachable! Checking connection in 5 seconds...");
         Thread.Sleep(5000);
         if (!beConn.b.Connected)
         {
             beConn.b.Connect();
         }
     }
 }
Beispiel #12
0
 private void BattlEyeServerBattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     OnConnectHandler();
 }
Beispiel #13
0
 protected virtual void OnBattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     BattlEyeConnected?.Invoke(args);
 }
Beispiel #14
0
 private static void BattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     Console.WriteLine(args.Message);
 }
Beispiel #15
0
 public void OnBattlEyeConnected(BattlEyeConnectEventArgs args)
 {
     BattlEyeConnected?.Invoke(args);
 }