/* * 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); } }
void BattlEyeConnected(BattlEyeConnectEventArgs args) { if (OnBeConnectedEvent != null) { OnBeConnectedEvent(); } }
private void Connected(BattlEyeConnectEventArgs pArgs) { if (pArgs.ConnectionResult == BattlEyeConnectionResult.Success) { SendMessage(new BE_Message(BE_MessageType.ServerConnected, null)); Execute(BattlEyeCommand.Players); } }
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; } }
private void OnBattlEyeConnected(BattlEyeConnectEventArgs args) { _log.Info($"{_serverName}: Connected"); if (Connected) { BattlEyeConnected?.Invoke(args); } }
private void Client_BattlEyeConnected(BattlEyeConnectEventArgs args) { lock (_lock) { if (_client.Connected) { Console.WriteLine("Connection reestablished"); } } }
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); // Выход при неподключении } }
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); } } }
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; } }
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(); } } }
private void BattlEyeServerBattlEyeConnected(BattlEyeConnectEventArgs args) { OnConnectHandler(); }
protected virtual void OnBattlEyeConnected(BattlEyeConnectEventArgs args) { BattlEyeConnected?.Invoke(args); }
private static void BattlEyeConnected(BattlEyeConnectEventArgs args) { Console.WriteLine(args.Message); }
public void OnBattlEyeConnected(BattlEyeConnectEventArgs args) { BattlEyeConnected?.Invoke(args); }