//서버에 매칭 요청 메시지 송신 private void SetScreen() { if (!this.isMatching) { MatchingPacket matchingPacket = new MatchingPacket(); matchingPacket.clientID = this.ClientID; matchingPacket.GameID = (byte)KindOfGame.IndianPokser; matchingPacket.matchingMsg = (byte)Matching.StartMatching; matchingPacket.Ack = 0x01; indianPokerClient.SendMessage(Header.Matching, matchingPacket, indianPokerClient.ao.WorkingSocket); } }
private void SelectedGameScreen_SelectGame(string message) { switch (message) { case "Set Indian Poker Screen": this.SetVisible(Screen.IndianPoker); MatchingData matchingData = new MatchingData(); matchingData.GameID = (byte)KindOfGame.IndianPokser; matchingData.matchingMsg = (byte)Matching.StartMatching; matchingData.Ack = 1; indianPokserClient.SendMessage(Header.Matching, matchingData); //if(indianPokserClient.RequestMatch()) // 서버에 매치요청 보냄 //{ //} break; case "Set Maze of Memory Screen": this.SetVisible(Screen.MazeofMemory); break; default: break; } }
private void LoginScreen_Loginbtn_event(string message) { this.ClientID = this.LoginScreen.IDboxString; if (this.ClientID.Length > 12) { MessageBox.Show("한글 6자 영문 12자 이상은 아이디로 사용하 실 수 없습니다."); return; } //this.indianPokerClient = new IndianPokerClient("127.0.0.1", 10000, this.ClientID); this.indianPokerClient = new IndianPokerClient("192.168.2.42", 10000, this.ClientID); if (this.indianPokerClient.ConnectedServer()) { LoginPacket loginPacket = new LoginPacket(); loginPacket.clientID = this.ClientID; loginPacket.isLogin = true; indianPokerClient.SendMessage(Header.Login, loginPacket, indianPokerClient.ao.WorkingSocket); } else { MessageBox.Show("서버와 연결이 되지 않습니다."); } }
private void LoginScreen_Loginbtn_event(string message) { short id = short.Parse(this.LoginScreen.IDboxString); this.indianPokserClient = new IndianPokerClient("127.0.0.1", 10000, id); if (this.indianPokserClient.ConnectedServer()) { this.SetVisible(Screen.SelectedGame); LoginData loginData = new LoginData(); loginData.clientID = id.ToString(); loginData.isLogin = true; loginData.Ack = 1; indianPokserClient.SendMessage(Header.Login, loginData); } else { MessageBox.Show("서버와 연결이 되지 않습니다."); } }