示例#1
0
        static void Main(string[] args)
        {
            var gClient = new GameClient("luckygeck.dyndns-home.com");

            gClient.Client.ResponseEvent += (o, e) => Console.WriteLine("server answer is " + e.Message());
            gClient.Client.ResponseErrorEvent += (o, e) => Console.WriteLine("Response error occuried: " + e.Error);
            gClient.NetErrorEvent += (o, e) => Console.WriteLine("Net error occuried: " + e.Error);
            gClient.LoginEvent += (o, e) => { if (e.Ok) Console.WriteLine("Login ok"); else Console.WriteLine("Login not ok: " + e.Error); };

            gClient.Start();

            gClient.Login("s***n", "megapassword");
            Thread.Sleep(1000);
            gClient.GameSessionList();
            Thread.Sleep(1000);
            gClient.GameSessionJoin(1);
            Thread.Sleep(1000);
            gClient.GameHit(27);
            Thread.Sleep(1000);
            gClient.GameLeave();

            Console.ReadLine();
            gClient.Stop();
        }