VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
Precache.cpp
Go to the documentation of this file.
1
#include <
VoltMod/Core/Log.hpp
>
2
#include <
VoltMod/Engine/Server/Precache.hpp
>
3
#include <algorithm>
4
#include <entity2/entitysystem.h>
5
6
namespace
VoltMod
7
{
8
9
void
Precache::Add
(std::string_view path)
10
{
11
if
(path.empty())
12
{
13
return
;
14
}
15
16
if
(std::ranges::find(_resources, path) != _resources.end())
17
{
18
return
;
19
}
20
21
_resources.emplace_back(path);
22
}
23
24
void
Precache::WriteTo
(IEntityResourceManifest& manifest)
const
25
{
26
for
(
const
auto
& path : _resources)
27
{
28
manifest.AddResource(path.c_str());
29
}
30
31
if
(!_resources.empty())
32
{
33
Log::Info
(
"Precache: added {} resource(s) to the session manifest."
, _resources.size());
34
}
35
}
36
37
}
// namespace VoltMod
Log.hpp
Precache.hpp
VoltMod::Precache::Add
void Add(std::string_view path)
Definition
Precache.cpp:9
VoltMod::Precache::WriteTo
void WriteTo(IEntityResourceManifest &manifest) const
Definition
Precache.cpp:24
VoltMod::Log::Info
void Info(std::format_string< Args... > fmt, Args &&... args)
Definition
Log.hpp:79
VoltMod
Definition
Options.hpp:13
src
Engine
Server
Precache.cpp
Generated by
1.15.0