opcode402.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include <cstdint>
  3. #include "../web_service_envelope.h"
  4. namespace sunrise::middleware::web_service::messages::opcode402 {
  5. /** Web Service opcode used by the Character screen's Dismantle action. */
  6. inline constexpr std::uint16_t kOpcode = 402;
  7. /** The descriptor only ever names a single unit, whatever the stack holds. */
  8. inline constexpr std::uint32_t kSingleQuantity = 1;
  9. /** Exact logical fields carried by the native 128-bit dismantle descriptor. */
  10. struct Request {
  11. std::uint64_t instanceSoid{};
  12. std::uint16_t definitionIndex{};
  13. };
  14. /**
  15. * Parses the exact reflected opcode-402 dismantle descriptor.
  16. *
  17. * Both identities are optional native fields carrying a presence bit. The quantity, the required
  18. * flag, and all three pad runs are fixed for this action, so a descriptor that differs in any of
  19. * them is not the action this codec supports.
  20. *
  21. * Fields are filled as far as the parse reaches, so a refused request still carries what it
  22. * decoded for the caller's trace.
  23. *
  24. * @param message Parsed Web Service envelope.
  25. * @param request Receives the named instance and its definition row.
  26. * @return True only for the complete canonical 16-byte single-unit request.
  27. */
  28. [[nodiscard]] bool parse_request(const Message& message, Request& request) noexcept;
  29. } // namespace sunrise::middleware::web_service::messages::opcode402