示例#1
0
		private static void Main(string[] args)
		{
			Console.WriteLine("Starting client...");

			//var client = new MiNetClient(new IPEndPoint(Dns.GetHostEntry("test.bladestorm.net").AddressList[0], 19132), "TheGrey");
			var client = new MiNetClient(new IPEndPoint(IPAddress.Parse("192.168.0.9"), 19132), "TheGrey");
			//var client = new MiNetClient(new IPEndPoint(IPAddress.Parse("83.249.65.92"), 19132), "TheGrey");
			//var client = new MiNetClient(new IPEndPoint(IPAddress.Loopback, 19132), "TheGrey");

			client.StartClient();
			Console.WriteLine("Server started.");


			//while (!client.HaveServer)
			//{
			//	Thread.Sleep(500);
			//	Console.WriteLine("Sending ping...");
			//	client.SendUnconnectedPing();
			//}

			Console.WriteLine("<Enter> to connect!");
			Console.ReadLine();
			client.HaveServer = true;
			client.SendOpenConnectionRequest1();

			Console.WriteLine("<Enter> to exit!");
			Console.ReadLine();
			client.StopClient();
		}
示例#2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Starting client...");

            var client = new MiNetClient(new IPEndPoint(Dns.GetHostEntry("test.bladestorm.net").AddressList[0], 19132), "TheGrey");

            //var client = new MiNetClient(new IPEndPoint(IPAddress.Parse("83.249.65.92"), 19132), "TheGrey");
            //var client = new MiNetClient(new IPEndPoint(IPAddress.Loopback, 19132), "TheGrey");

            client.StartClient();
            Console.WriteLine("Server started.");


            //while (!client.HaveServer)
            //{
            //	Thread.Sleep(500);
            //	Console.WriteLine("Sending ping...");
            //	client.SendUnconnectedPing();
            //}

            Console.WriteLine("<Enter> to connect!");
            Console.ReadLine();
            client.HaveServer = true;
            client.SendOpenConnectionRequest1();

            Console.WriteLine("<Enter> to exit!");
            Console.ReadLine();
            client.StopClient();
        }
示例#3
0
        public void Connect(IPEndPoint endpoint, string username = "******")
        {
            var client = new MiNetClient(endpoint, username, new DedicatedThreadPool(new DedicatedThreadPoolSettings(Environment.ProcessorCount)));

            client.WS = this;
            client.StartClient();

            Task.Run(BotHelpers.DoWaitForSpawn(client))
            .ContinueWith(t => CommandResponse("Client spawned successfully"));

            client._serverEndpoint = endpoint;
            client.HaveServer      = true;
            client.SendOpenConnectionRequest1();

            Client = client;
        }