/// <summary> /// 客户端发送语音 /// </summary> /// <param name="bytes"></param> private void ClientSendMicro(byte[] bytes) { OP_PLAYER_MESSAGE_GET proto = new OP_PLAYER_MESSAGE_GET(); proto.typeId = ENUM_PLAYER_MESSAGE.BYTES; proto.content = bytes; NetWorkSocket.Instance.Send(proto.encode(), OP_PLAYER_MESSAGE_GET.CODE, GameCtrl.Instance.SocketHandle); }
/// <summary> /// 客户端发送消息 /// </summary> /// <param name="message"></param> private void ClientSendMessage(ENUM_PLAYER_MESSAGE type, string message, int toPlayerId) { OP_PLAYER_MESSAGE_GET proto = new OP_PLAYER_MESSAGE_GET(); proto.typeId = type; proto.content = System.Text.Encoding.UTF8.GetBytes(message); proto.toId = toPlayerId; NetWorkSocket.Instance.Send(proto.encode(), OP_PLAYER_MESSAGE_GET.CODE, GameCtrl.Instance.SocketHandle); }