Files
2026-11-23 03:28:32 +02:00

19 lines
975 B
C++

#pragma once
// Book/letter pages: 70334 CMSG_QUERY_PAGE_TEXT -> Turtle CMSG_PAGE_TEXT_QUERY (0x5a), Turtle
// SMSG_PAGE_TEXT_QUERY_RESPONSE (0x5b) -> 70334 SMSG_QUERY_PAGE_TEXT_RESPONSE. IDs above 65535 travel as aliases
// (page_text_aliases.hpp) because 70334 ItemSparse.PageID is 16-bit.
#include "gateway/protocol.hpp"
#include <string>
#include <cstdint>
#include <span>
namespace gateway {
inline constexpr uint32_t forever_query_page_text_opcode=0x3e0147;
inline constexpr uint32_t forever_query_page_text_response_opcode=0x4b0009;
struct PageTextReply{uint32_t id=0,next=0;std::string text;};
// Client page id (alias or real) from the 70334 query; returns the Turtle request body.
Bytes turtle_page_text_query(std::span<const uint8_t> forever_body,uint32_t* source_id=nullptr);
PageTextReply turtle_page_text_reply(std::span<const uint8_t> body);
// One page, IDs mapped back to the client's aliases.
Bytes forever_page_text_response(const PageTextReply& reply);
}