VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
SDK wrappers

Table of Contents

The Engine, Entities, Events, Messaging, Hooks and Ui modules wrap HL2SDK and reverse-engineered engine access in typed APIs. Public names live directly in VoltMod.

<VoltMod/Api.hpp> carries the wrapper types Runtime holds by value. Three module headers gather what it does not:

Header Brings in
<VoltMod/Entities/Api.hpp> Entity, Pawn, Controller, EntityRef, EntitySystem, KeyValues, Trace, ConVar, ConVarOverrides
<VoltMod/Hooks/Api.hpp> Movement, PlayerInput, Teleport, TextMessages, Damage, Visibility, GlowVision, ClientConVars, Vote, GameEvents and the event structs, Messages, CenterHtml
<VoltMod/Unsafe/Api.hpp> Interfaces, Bindings, MemoryAccess, RecipientFilter and the hook entry points - opt in only where a plugin pokes at the engine directly

Pages

Page Covers
Gamedata and schema gamedata.jsonc, typed Bindings, the schema layout, re-verifying after a game update
Entities and players entity lookup, the wrapper contract, schema fields, pawn operations, spawning and effects
Rendering and visibility render mode and color, per-recipient visibility filtering, per-viewer glow
Messaging and chat input chat, center HTML, sticky panels, chat input capture, the yes/no vote panel
ConVars and game events typed convars, game event listeners, level changes
Movement, teleports, damage, weapon drops, and server commands movement hooks, teleport tracking, damage, custom vtable hooks, server console commands
Client telemetry the simulation clock, per-client latency, client convar queries

Interfaces

The plugin module fills runtime.Unsafe.Interfaces with the SDK interfaces the framework uses before it builds the runtime, so they are live when every service and the plugin are constructed:

auto* engine = runtime.Unsafe.Interfaces.Engine; // IVEngineServer2*
auto* cvar = runtime.Unsafe.Interfaces.CVar; // ICvar*

Prefer the typed runtime services; reach for this holder only for an engine call the framework has not wrapped.

Available()

A CS2 update can invalidate the gamedata a feature needs. Those features carry Available(), which returns the reason when they cannot work:

if (auto available = runtime.ClientConVars.Available(); !available)
Log::Warn("no client convar queries: {}", available.error().Detail);

Available() is on Movement, Teleport, TextMessages, Damage, Visibility, ClientConVars, Trace, Screens, Messages, Entities, ConVars and GameEvents. A service that is not available stays safe to call and returns an error, an empty Subscription, or no result. The load summary lists every unavailable feature once, and so does the load status section's failed list.