示例#1
0
        public Program()
        {
            Client = new GamePadClient(new WindowsUdpClient(), new WindowsPlatform());

            Client.OnServerDiscovered += ServerDiscovered;

            while (true)
            {
                var commandLine = Console.ReadLine();

                var parts = commandLine.Split(' ');

                var command     = parts[0];
                var commandArgs = new List <String>();

                if (parts.Length > 1)
                {
                    for (int i = 1; i < parts.Length; i++)
                    {
                        commandArgs.Add(parts[i]);
                    }
                }

                try {
                    HandleCommand(command, commandArgs);
                } catch (Exception e) {
                    Console.WriteLine("Failed to parse command");
                }
            }
        }
示例#2
0
 public void ServerDiscovered(GamePadClient client, ClientServerInformation clientServerInformation, int serverIndex)
 {
     Console.WriteLine(String.Format("{0}\t {1}", serverIndex, clientServerInformation.DebugServerInfo()));
 }