private void button2_Click(object sender, EventArgs e) { if (textBox1.Text != "") { client.Player = new PlayerInfo(textBox1.Text, 0, 0); try { client.Connect(); client.Login(textBox1.Text); } catch { MessageBox.Show("서버 접속에 실패했습니다!"); } } }
private void Btn_regame_Click(object sender, EventArgs e) { iHaveToQuit = true; this.Close(); client.gameForm.Close(); string oldNickname = client.Player.Nickname; client.Player = new PlayerInfo(oldNickname, 0, 0); client.Connect(); client.Login(oldNickname); }
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(); }