VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
GameDataLocation.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string_view>
5
6namespace VoltMod
7{
8
9/** The sections of `gamedata.jsonc`, as flags: an address binds from a function or a global. */
11{
12 Function = 1u << 0,
13 Global = 1u << 1,
14 VTable = 1u << 2,
15 Offset = 1u << 3,
16};
17
19{
20 return static_cast<GameDataSection>(static_cast<uint32_t>(left) | static_cast<uint32_t>(right));
21}
22
23/** What gamedata holds for one key. */
25{
26 bool Found = false;
27 /** A function or global address, or the class table a vtable slot counts in. */
28 void* Address = nullptr;
29 /** A vtable slot index or a byte offset. -1 when unbound. */
30 int Value = -1;
31 /** Why it did not bind. Borrowed until the next lookup; copy it to keep it. Empty when @ref Found. */
32 std::string_view Reason;
33};
34
35} // namespace VoltMod
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
constexpr GameDataSection operator|(GameDataSection left, GameDataSection right)