33 lines
2.2 KiB
C++
33 lines
2.2 KiB
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
// OctoAux: the ported aux add-on (Octo 1.12 "aux Turtle") talks the Source's own 1.12 auction protocol through a
|
|
// private, self-addressed addon prefix. Every request becomes the exact Tortoise packet the 1.12 client would send;
|
|
// every Source result page goes back as plain rows. Nothing is aggregated, split or priced by the gateway.
|
|
#pragma once
|
|
#include "gateway/auction_browse.hpp"
|
|
#include <functional>
|
|
#include <optional>
|
|
#include <span>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
namespace gateway {
|
|
inline constexpr std::string_view AuxPrefix="OctoAux";
|
|
// Requests (fields ';'-separated):
|
|
// Q;page;name;lmin;lmax;slot;class;subclass;quality;usable -> CMSG_AUCTION_LIST_ITEMS 0x258 (class/subclass/slot/quality: Source ids, -1 = any)
|
|
// O;page -> CMSG_AUCTION_LIST_OWNER_ITEMS 0x259
|
|
// I;page -> CMSG_AUCTION_LIST_BIDDER_ITEMS 0x264 (no outbid list)
|
|
// B;auction;amount -> CMSG_AUCTION_PLACE_BID 0x25a
|
|
// C;auction -> CMSG_AUCTION_REMOVE_ITEM 0x257
|
|
// S;item-guid-hex;bid;buyout;minutes -> CMSG_AUCTION_SELL_ITEM 0x256 (the whole bag stack)
|
|
struct AuxSourceRequest {uint16_t opcode=0;Bytes body;char kind=0;}; // kind: Q/O/I for list results, B/C/S for commands
|
|
// item: native item-GUID counter (the hex tail of the client's "Item-..." GUID) -> owned Source item guid, or nullopt.
|
|
using AuxItemLookup=std::function<std::optional<uint64_t>(uint64_t native_counter)>;
|
|
AuxSourceRequest aux_source_request(std::string_view text,uint64_t auctioneer,const AuxItemLookup& item);
|
|
// One Source result page as addon texts: "H;kind;count;total", one "R;..." per row, then "E;kind".
|
|
// R;id;entry;count;start;min_outbid;buyout;time_left_ms;bidder;bid;owner;enchant;random_property;suffix;charges;owner_name
|
|
using AuxNameLookup=std::function<std::string(uint64_t guid)>;
|
|
std::vector<std::string> aux_page_texts(char kind,const TurtleAuctionList&,const AuxNameLookup& name);
|
|
// SMSG_AUCTION_COMMAND_RESULT 0x25b as "A;auction;action;error[;extra]".
|
|
std::string aux_command_text(std::span<const uint8_t> body);
|
|
}
|