コード例 #1
0
ファイル: RconModel.cs プロジェクト: tedd/BFH-Rcon-Admin
        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);
        }