mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 13:57:05 +02:00
The profile keeps every cosmetic it has seen, a removed mod's too, and refused to save past 8192 of them (or of Build objects). A player who had tried enough mods passed that, every save was refused, and the cosmetic catalog failed with it: no items in the customization menu and no playcard. The saved limit is now 65536 (saved_item_limit), a bound against a damaged file; the game's own catalog of installed items keeps its 8192. Also: one item the catalog cannot hold (two items with one identity hash, a record the game will not read) is left out and named in the log instead of failing the whole catalog, and a catalog that still fails logs why.
43 lines
1.8 KiB
C++
43 lines
1.8 KiB
C++
#pragma once
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
#include "Engine/Core/Json/json.h"
|
|
|
|
namespace dingosdk::profile {
|
|
// The most items a saved profile keeps owned or described (cosmetics, and Build objects). The
|
|
// profile keeps every item it has seen, those of mods since switched off or removed too, so a mod
|
|
// comes back owned: a player who has tried many mods passes the game's own 8192 (the most items
|
|
// installed at once) in the profile alone, and at 8192 every save was refused, leaving the game
|
|
// with no catalog at all (no items in the customization menu, no playcard). A bound against a
|
|
// damaged file, not a size a profile should reach.
|
|
inline constexpr std::size_t saved_item_limit = 65536;
|
|
|
|
// Exact decoded recipe values. Float parameters retain their IEEE-754 bits;
|
|
// resource pointers, allocator state and transient UI flags are never saved.
|
|
struct CosmeticSlot {
|
|
std::uint32_t slot{};
|
|
std::string asset;
|
|
std::vector<std::uint32_t> parameter_bits;
|
|
bool operator==(const CosmeticSlot&) const = default;
|
|
};
|
|
struct CosmeticRecipe {
|
|
std::uint32_t template_key{}, template_version{};
|
|
std::vector<std::uint32_t> scalar_bits;
|
|
std::vector<CosmeticSlot> items;
|
|
bool operator==(const CosmeticRecipe&) const = default;
|
|
};
|
|
struct CosmeticLoadout {
|
|
std::vector<CosmeticRecipe> recipes;
|
|
bool operator==(const CosmeticLoadout&) const = default;
|
|
};
|
|
dingosdk::Json encode_loadout(const CosmeticLoadout&);
|
|
CosmeticLoadout decode_loadout(const dingosdk::Json&);
|
|
void validate_customization(const dingosdk::Json&);
|
|
void validate_player_card(const CosmeticLoadout&);
|
|
// Cached display metadata only. Caller still enumerates installed assets and
|
|
// applies local catalog overrides; this does not determine ownership.
|
|
dingosdk::Json item_display_metadata(const std::string& asset, const dingosdk::Json& overrides);
|
|
}
|