예제 #1
0
        public static void Run(string[] args)
        {
            UDPConnectionManager udp = new UDPConnectionManager(null);

            tcp = new TcpListener(IPAddress.Any, 5154);
            tcp.Start();

            tcp.BeginAcceptTcpClient(TCPClientAccepted, null);

            udp.AllowAll             = true;
            udp.OutOfBandUDPMessage += Udp_OutOfBandUDPMessage;
            udp.Listen(5154);

            UdpClient udpc = new UdpClient("127.0.0.1", 5154);

            udpc.Send(Encoding.ASCII.GetBytes("hello"), 5);


            ps             = new PublicServer();
            ps.Address     = "trials.hyperdrive.tech";
            ps.Port        = 5154;
            ps.Description = "An unusable test server";
            ps.Version     = BZFlag.Services.Hosts.ApplicationVersion;
            ps.Name        = "trials.hyperdrive.tech";

            ps.Key = args[0];

            ps.RequestCompleted += Ps_RequestCompleted;
            ps.RequestErrored   += Ps_RequestErrored;

            ps.UpdateMasterServer();

            bool b = false;

            while (!b)
            {
                lock (locker)
                    b = Done;
                Thread.Sleep(10);
            }
        }