1#include "BuildStamp.hpp"
36static constexpr std::string_view
GameDataPath =
"addons/voltmod/gamedata/gamedata.jsonc";
57 return std::unexpected(
engine.error());
71 _downloads = std::make_unique<WorkshopDownloads>(_bindings, *
engine);
72 _registry = std::make_unique<PluginRegistry>(
start,
gameData, _downloads.get());
73 _commands = std::make_unique<PlayerCommands>(_bindings, *_registry);
74 _presses = std::make_unique<ButtonPresses>(_bindings, *
engine, *_registry);
76 _schema = std::make_unique<SchemaCheck>(*_registry,
engine->Schema,
engine->Resources);
77 _assets = std::make_unique<ServerAssets>(
engine->Files);
78 _plugins = std::make_unique<PluginLoader>(*_registry, *_assets);
80 _hooks = std::make_unique<EngineHooks>(
83 _plugins->RunPending();
84 _downloads->OnFrame();
87 [
this] { _schema->OnServerStartup(); }, [
this](
int64_t steamId) { _downloads->OnClientConnected(
steamId); },
91 _command = std::make_unique<VoltCommand>(*_registry, *_plugins);
103 _plugins->UnloadAll();
119 std::unique_ptr<GameDataTable> _gameData;
121 std::unique_ptr<WorkshopDownloads> _downloads;
122 std::unique_ptr<PluginRegistry> _registry;
123 std::unique_ptr<PlayerCommands> _commands;
124 std::unique_ptr<ButtonPresses> _presses;
125 std::unique_ptr<SchemaCheck> _schema;
126 std::unique_ptr<ServerAssets> _assets;
127 std::unique_ptr<PluginLoader> _plugins;
128 std::unique_ptr<VoltCommand> _command;
129 std::unique_ptr<EngineHooks> _hooks;
143 return started.has_value();
VOLTMOD_EXPORT void VoltMod_HostStop()
VOLTMOD_EXPORT bool VoltMod_HostStart(const VoltMod::LoaderHandoff *start, char *error, size_t errorSize)
Status Start(const LoaderHandoff &start)
static void CopyToBuffer(char *buffer, std::size_t size, std::string_view text) noexcept
KHook::IKHook * __exported__khook
void Info(std::format_string< Args... > fmt, Args &&... args)
void SetHandler(Handler handler)
Log::Handler MakeConsoleHandler(std::string prefix)
The default handler: tier0 ConColorMsg/Msg, one colour per level.
void SetBaseDir(const std::filesystem::path &baseDir)
Set the base directory for path resolution (the host's csgo directory). Must be called during initial...
static std::string ReadFile(const std::filesystem::path &path)
Result< ScriptTarget > FindScriptBinding(void *classTable, std::string_view name)
Result< EngineInterfaces > ResolveEngineInterfaces(const LoaderHandoff &start)
const void * ReadOriginalSlot(void **vtable, int index)
std::expected< void, Error > Status
static constexpr std::string_view GameDataPath
std::expected< T, Error > Result
Status Bind(const GameDataLookup &lookup)