//----------------------------------------------------------------------------------- protected void onReadyClick(GameObject go) { // 发送消息通知服务器玩家已经准备 CSReady packetReady = mSocketManager.createPacket <CSReady>(); packetReady.mReady.mValue = true; mSocketManager.sendMessage(packetReady); }
protected void onCancelReadyClick(GameObject go) { // 发送消息通知服务器玩家已经准备 CSReady packetReady = mSocketNetManager.createPacket(PACKET_TYPE.PT_CS_READY) as CSReady; packetReady.mReady.mValue = false; mSocketNetManager.sendMessage(packetReady); }
public void PlayerReady() { CSReady proto = new CSReady(); byte[] bytes = ProtoSerialize.Serialize <CSReady>(proto); int size = bytes.Length; MessageBody body = new MessageBody(); body.size = (uint)(size + MessageBody.HEADER_TYPE_BYTES); body.type = (ushort)EMessageType.ECSReady; body.data = bytes; TCPClient.Instance.Send(body); }