private void SendGameProtocol(rps.ReqGameProtocol gameProtocol) { MemoryStream memStream = new MemoryStream(); ProtoBuf.Serializer.Serialize <rps.ReqGameProtocol>(memStream, gameProtocol); MSG.ReqGameProtocol req_game_protocol = new MSG.ReqGameProtocol(memStream.ToArray()); client.Send(req_game_protocol); }
private void RequestToss(string menuName) { rps.ReqGameProtocol request = new rps.ReqGameProtocol() { type = rps.ReqGameProtocol.Type.REQ_TOSS, req_toss = new rps.ReqToss() { round = this.round, rps_type = ConvertFromMenuToRPSType(menuName) } }; SendGameProtocol(request); }
private void StartGame(string menuName) { ClearMessage(); rps.ReqGameProtocol request = new rps.ReqGameProtocol { type = rps.ReqGameProtocol.Type.REQ_START_GAME, req_start_game = new rps.ReqStartGame { option = new rps.GameOption { round_num = rps.GameOption.RoundNum.THREE } } }; SendGameProtocol(request); }