VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
ServerAssets.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <functional>
5#include <map>
6#include <string>
7#include <string_view>
8
9namespace VoltMod
10{
11
12/** Each plugin's `server-assets` folder on the game's search path while the plugin is loaded, ahead of
13 * the game's VPKs, which beat loose files under `game/csgo`. Weapon subclasses apply from the next map. */
15{
16public:
17 /** Null @p files mounts nothing. */
18 explicit ServerAssets(IFileSystem* files) : _files(files) {}
19
20 void Mount(std::string_view plugin);
21 void Unmount(std::string_view plugin);
22
23private:
24 IFileSystem* _files;
25 std::map<std::string, std::string, std::less<>> _mounted; ///< plugin -> folder
26};
27
28} // namespace VoltMod
ServerAssets(IFileSystem *files)
void Mount(std::string_view plugin)
void Unmount(std::string_view plugin)
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56