Beispiel #1
0
        private async void DoConnect()
        {
            if (RconClient != null)
            {
                RconClient.Dispose();
            }

            Dispatcher.Invoke(() => Players.Clear());
            RconClient = new RconClient();

            RconClient.Disconnected += RconClientOnDisconnected;

            RconClient.PlayerListCommand.PlayerJoined += RconClientOnPlayerJoined;
            RconClient.PlayerListCommand.PlayerLeft   += RconClientOnPlayerLeft;
            RconClient.ServerInfoCommand.RoundStart   += ServerInfoCommandOnRoundStart;
            RconClient.Connected += RconClientOnConnected;
            await RconClient.Connect(Config.RconServerAddress, Config.RconServerPort, Config.RconServerPassword);
        }