using System.Buffers.Binary;
namespace AcDream.Core.Net.Messages;
///
/// Outbound 0x00C8 IdentifyObject / Appraise GameAction.
///
///
/// Wire shape (inside the 0xF7B1 envelope):
///
/// u32 0xF7B1 // GameMessage opcode (GameAction envelope)
/// u32 gameActionSequence // client-tracked sequence
/// u32 0x00C8 // GameAction sub-opcode
/// u32 targetGuid // whose appraisal we're requesting
///
///
///
///
/// Server replies with a 0xF7B0 / 0x00C9 IdentifyObjectResponse
/// containing the full AppraiseInfo property bundle. See
/// GameEvents.cs for the matching parser (once wired).
///
///
public static class AppraiseRequest
{
public const uint GameActionEnvelope = 0xF7B1u;
public const uint SubOpcode = 0x00C8u;
///
/// Pack an AppraiseRequest body (with envelope) ready to be handed
/// to WorldSession.SendGameAction.
///
public static byte[] Build(uint gameActionSequence, uint targetGuid)
{
byte[] body = new byte[16];
BinaryPrimitives.WriteUInt32LittleEndian(body, GameActionEnvelope);
BinaryPrimitives.WriteUInt32LittleEndian(body.AsSpan(4), gameActionSequence);
BinaryPrimitives.WriteUInt32LittleEndian(body.AsSpan(8), SubOpcode);
BinaryPrimitives.WriteUInt32LittleEndian(body.AsSpan(12), targetGuid);
return body;
}
}