|
VoltMod
C++23 framework for CS2 server plugins
|
uv sync installs the voltmod Python package, which pins CMake, Conan, Ninja and clang-format. Conan fetches VoltMod, HL2SDK and KHook; a generated project has no submodules.
voltmod new project writes CMakeLists.txt, CMakePresets.json, conanfile.py, pyproject.toml and plugins/my-plugin/. The generated plugin builds as it is and answers !ping. See Writing a plugin for what is in it.
Add more plugins later:
That creates plugins/fun-votes/ and adds add_subdirectory(plugins/fun-votes) to the root CMakeLists.txt. It refuses to overwrite an existing directory.
Doctor reports on tools, compiler, Conan profiles and the package remote without changing anything. Before the first bootstrap, missing profiles and a missing volty remote are expected.
Presets are windows-msvc-release, windows-msvc-debug, linux-steamrt-release and linux-steamrt-debug; uv run poe build -p windows-msvc-debug picks one. Binaries land in build/<preset>/plugins/<name>/<platform-arch>/. Profiles, lockfiles and the CMake functions are in Consuming VoltMod with Conan.
Point CS2_SERVER_PATH at a CS2 dedicated server root, in .env or the environment:
run builds, then installs the host and the plugin into game/csgo, copying each file under configs/ only when the server does not already have one, so operator edits survive. Then it adds Game csgo/addons/voltmod above Game csgo in gameinfo.gi if it is missing, and launches the server. With no plugin named it installs every plugin in the repo. To do either step on its own:
The host is installed with the plugin, from the same VoltMod build: a plugin built against a different host is refused. Writing a plugin has the resulting addons/ layout.
Windows keeps a loaded module locked, so an install into a running server fails until the file is released. Either restart it, or run volt unload my-plugin on the console, install, then volt load my-plugin.
On the server console:
The host prints each loaded plugin with its version and description, in load order. Join and enter !ping. Running the host covers the rest of the volt commands and what to do when a plugin does not appear.