[XDBF] Added support for reading Stats and Match Collection
This commit is contained in:
@@ -62,37 +62,12 @@ struct XdbfXstc {
|
||||
};
|
||||
static_assert_size(XdbfXstc, 16);
|
||||
|
||||
struct XdbfXstrSectionHeader {
|
||||
struct XdbfSectionHeader {
|
||||
xe::be<uint32_t> magic;
|
||||
xe::be<uint32_t> version;
|
||||
xe::be<uint32_t> size;
|
||||
xe::be<uint16_t> count;
|
||||
};
|
||||
static_assert_size(XdbfXstrSectionHeader, 14);
|
||||
|
||||
struct XdbfXprpSectionHeader {
|
||||
xe::be<uint32_t> magic;
|
||||
xe::be<uint32_t> version;
|
||||
xe::be<uint32_t> size;
|
||||
xe::be<uint16_t> count;
|
||||
};
|
||||
static_assert_size(XdbfXprpSectionHeader, 14);
|
||||
|
||||
struct XdbfXachSectionHeader {
|
||||
xe::be<uint32_t> magic;
|
||||
xe::be<uint32_t> version;
|
||||
xe::be<uint32_t> size;
|
||||
xe::be<uint16_t> count;
|
||||
};
|
||||
static_assert_size(XdbfXachSectionHeader, 14);
|
||||
|
||||
struct XdbfXcxtSectionHeader {
|
||||
xe::be<uint32_t> magic;
|
||||
xe::be<uint32_t> version;
|
||||
xe::be<uint32_t> size;
|
||||
xe::be<uint32_t> count;
|
||||
};
|
||||
static_assert_size(XdbfXcxtSectionHeader, 16);
|
||||
static_assert_size(XdbfSectionHeader, 12);
|
||||
|
||||
struct XdbfStringTableEntry {
|
||||
xe::be<uint16_t> id;
|
||||
@@ -131,8 +106,56 @@ struct XdbfAchievementTableEntry {
|
||||
xe::be<uint32_t> unk20;
|
||||
};
|
||||
static_assert_size(XdbfAchievementTableEntry, 0x24);
|
||||
|
||||
struct XdbfStatsViewTableEntry {
|
||||
xe::be<uint32_t> id;
|
||||
xe::be<uint32_t> flags;
|
||||
xe::be<uint16_t> shared_index;
|
||||
xe::be<uint16_t> string_id;
|
||||
xe::be<uint32_t> unused;
|
||||
};
|
||||
static_assert_size(XdbfStatsViewTableEntry, 0x10);
|
||||
|
||||
struct XdbfViewFieldEntry {
|
||||
xe::be<uint32_t> size;
|
||||
xe::be<uint32_t> property_id;
|
||||
xe::be<uint32_t> flags;
|
||||
xe::be<uint16_t> attribute_id;
|
||||
xe::be<uint16_t> string_id;
|
||||
xe::be<uint16_t> aggregation_type;
|
||||
xe::be<uint8_t> ordinal;
|
||||
xe::be<uint8_t> field_type;
|
||||
xe::be<uint32_t> format_type;
|
||||
xe::be<uint32_t> unused_1;
|
||||
xe::be<uint32_t> unused_2;
|
||||
};
|
||||
static_assert_size(XdbfViewFieldEntry, 0x20);
|
||||
|
||||
struct XdbfSharedViewMetaTableEntry {
|
||||
xe::be<uint16_t> column_count;
|
||||
xe::be<uint16_t> row_count;
|
||||
xe::be<uint32_t> unused_1;
|
||||
xe::be<uint32_t> unused_2;
|
||||
};
|
||||
static_assert_size(XdbfSharedViewMetaTableEntry, 0xC);
|
||||
#pragma pack(pop)
|
||||
|
||||
struct XdbfPropertyBag {
|
||||
std::vector<xe::be<uint32_t>> contexts;
|
||||
std::vector<xe::be<uint32_t>> properties;
|
||||
};
|
||||
|
||||
struct XdbfSharedView {
|
||||
std::vector<XdbfViewFieldEntry> column_entries;
|
||||
std::vector<XdbfViewFieldEntry> row_entries;
|
||||
XdbfPropertyBag property_bag;
|
||||
};
|
||||
|
||||
struct XdbfViewTable {
|
||||
XdbfStatsViewTableEntry view_entry;
|
||||
XdbfSharedView shared_view;
|
||||
};
|
||||
|
||||
struct XdbfBlock {
|
||||
const uint8_t* buffer;
|
||||
size_t size;
|
||||
@@ -163,6 +186,15 @@ class XdbfWrapper {
|
||||
XdbfAchievementTableEntry GetAchievement(const uint32_t id) const;
|
||||
XdbfPropertyTableEntry GetProperty(const uint32_t id) const;
|
||||
XdbfContextTableEntry GetContext(const uint32_t id) const;
|
||||
std::vector<XdbfViewTable> GetStatsView() const;
|
||||
XdbfSharedView GetSharedView(const uint8_t* ptr,
|
||||
uint32_t& byte_count) const;
|
||||
|
||||
void GetPropertyBagMetadata(const uint8_t* ptr, uint32_t& byte_count,
|
||||
std::vector<xe::be<uint32_t>>& contexts,
|
||||
std::vector<xe::be<uint32_t>>& properties) const;
|
||||
|
||||
XdbfPropertyBag GetMatchCollection() const;
|
||||
|
||||
private:
|
||||
const uint8_t* data_ = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user