VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod Namespace Reference

Namespaces

namespace  Validation
namespace  Internal
namespace  Args
 The argument types a command handler's parameter list is written in.
namespace  Log
namespace  ChatColors
namespace  Schema
namespace  Palette
 The default theme's colours for center HTML and other text markup.
namespace  CommandSyntax
namespace  InstalledPlugins
namespace  PluginDependencies
namespace  MenuCursor

Classes

class  Options
 Owns a plugin's settings and republishes them whole on every Load. More...
struct  StandardPluginSettings
 The "plugin" section of settings.jsonc. LoadConfig applies the locale. More...
struct  PanoramaMenuSettings
 The "menu" section of a plugin with a Panorama menu screen. More...
struct  LoadConfigOptions
 Paths and translation behavior for LoadConfig. More...
class  Plugin
 Everything a plugin owns for one load cycle. More...
class  ServiceExchange
 Typed view of the host's table of interfaces plugins publish to each other. More...
class  StatusService
 Build text and JSON diagnostics from named providers. More...
struct  ArgDesc
struct  BoundArgVariant
struct  BoundArgVariant< std::tuple< A... > >
struct  ArgTrait
 What one handler parameter type means to the framework. More...
struct  ArgTrait< T >
struct  ArgTrait< Args::Opt< T > >
struct  ArgUnpack
struct  ArgUnpack< Args::Opt< T > >
struct  Reply
 What a command handler answers with. More...
struct  Caller
 Who invoked the command, and how to answer them. More...
struct  CommandDefinition
 One command as the builder assembled it. More...
struct  CommandArgList
struct  CommandHandlerArgs
 The parameter list of a handler, after the leading Caller. More...
struct  CommandHandlerArgs< F >
struct  CommandHandlerArgs< R(Caller, A...)>
struct  CommandHandlerArgs< R(C::*)(Caller, A...) const >
struct  CommandHandlerArgs< R(C::*)(Caller, A...) const noexcept >
struct  CommandHandlerArgs< R(C::*)(Caller, A...)>
struct  CommandHandlerArgs< R(C::*)(Caller, A...) noexcept >
struct  CommandHandlerArgs< R(*)(Caller, A...)>
struct  CommandHandlerArgs< R(*)(Caller, A...) noexcept >
class  CommandBuilder
 Fluent command registration, returned by CommandManager::Add. More...
class  CommandManager
 Typed commands for chat and the server console. More...
struct  FailedCheck
class  LoadReport
struct  Error
 One failure: a code to branch on, text for the log, and an optional translation key. More...
class  CallbackRegistry
struct  EventLifecycle
 Starting and stopping an Event source, driven by whether anything is listening. More...
class  Event
 A multicast signal with a fixed handler signature: the one way to subscribe in VoltMod. More...
class  HookResult
 A hook before-handler's verdict. More...
class  HookResult< void >
class  LazyHook
 An engine hook that exists only while one of its events has handlers. More...
class  Subscription
 Owns one registration and releases it on destruction. More...
class  Subscriptions
 Holds the subscriptions an object makes and releases them together, newest first. More...
class  PerSlot
 Per-player-slot value store that never leaks state across occupants. More...
class  SlotEvents
 "The occupant of this slot changed" - raised by PlayerManager, consumed below it. More...
class  SteamId
 Static utilities for converting between SteamID formats (64-bit, SteamID2, SteamID3). More...
struct  CharBuf
 A value for a fixed engine character array (char m_name[N]). More...
class  Json
 System.Text.Json-style helpers for mapping C++ types to and from JSON. More...
struct  Labeled
class  PlayerLanguages
struct  StringHash
class  Strings
 Collection of static string manipulation utilities. More...
class  Translations
 Localization system. Loads one JSON file per language; nested objects flatten into dotted keys (category.punish). Use Get(key, slot) for per-player text. More...
class  GameThreadQueue
 Callbacks worker threads hand to the game thread: Push from any thread, RunAll on the game thread. More...
class  Cooldown
 A per-key cooldown, such as one notice per player per minute. More...
class  DecayingScore
 A score that loses half its weight every half-life - the building block for evidence that should fade with age rather than expire on a window edge. More...
struct  DurationUnitLabels
class  Time
class  Scheduler
 One-shot delays and repeating timers, run on the game thread. More...
class  Database
 Async database access over Postgres, MariaDB and SQLite. More...
struct  DatabaseConfig
 Connection parameters for every supported backend. More...
struct  MigrationOptions
struct  MigrationResult
struct  Dialect
 The DDL spellings the three drivers disagree on, one per migration placeholder. More...
struct  Color
 An RGBA color in the engine's byte order, as m_clrRender and glow colors hold it. More...
struct  ConVarChange
class  ConVar
class  ConVarRawScope
class  ConVars
class  ConVarOverrides
class  EnginePawn
class  EngineMovementServices
class  EngineWeaponServices
class  EngineNavPhysics
struct  EntityRef
struct  Bindings
class  Address
class  ClassTable
class  Fn
class  Fn< Ret(Args...)>
class  VirtualFn
class  VirtualFn< Ret(Object *, Args...)>
class  Offset
class  Offset< void >
struct  GameDataLocation
struct  Interfaces
 Centralized holder for all SDK interface pointers. More...
struct  Axes
struct  CommandStatus
class  NetChannels
 Per-client network access: latency, userids, usercmd status and the client's replicated userinfo cvars. More...
struct  SubtickMove
struct  InputHistorySample
struct  PlayerInput
 Protobuf-free snapshot of the CUserCmd handed to CPlayer_MovementServices::RunCommand, decoded once per command by Movement. More...
class  Clock
 The engine's simulation clock, read straight from IVEngineServer2::GetServerGlobals(). More...
class  Map
class  Precache
class  ServerCommand
 RAII server console command: registers a tier1 ConCommand on construction and unregisters on destruction. More...
class  BoneFollow
 Has one pawn copy another entity's bones while traces, bullets included, keep hitting it, and gives that pawn alone its collision back on detach, so a respawn is never written to. Keep one per player. More...
class  Controller
 A player's identity behind a slot: name, money, team, scoreboard row. It survives death and respawn; the body is Pawn(). Its own CBaseEntity fields, such as Health, mean nothing for gameplay. More...
struct  WeaponData
class  Entity
 A live entity, valid for this frame only. More...
struct  PropGlow
struct  PropSpec
class  EntitySystem
 runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see Entity. More...
class  FireHold
 Pawn::HoldFire that can be let go: a release hands the weapon back the wait it had, so the next click fires at once. Keep one per player. More...
class  KeyValues
 Spawn keyvalues such as "origin", "spawnflags" or "effect_name". More...
class  MovementFreeze
 Holds one pawn still and gives its move type back to that pawn only, so a player who respawns while held never inherits the dead body's. Keep one per player. More...
struct  PlayerHull
class  Pawn
 A player's body: health, armor, movement, aim, weapons. The engine replaces it on every spawn; the Controller is the identity that stays. More...
class  Rounds
 runtime.Rounds: the running round's timer, and ending the round with the engine's own win panel and round_end, even with mp_ignore_round_win_conditions on. Team scores are not changed. More...
struct  TraceOptions
struct  TraceHit
class  Trace
 runtime.Trace: line and box traces against the physics world. Game-thread only. More...
struct  BulletImpact
 One bullet landing, fired once per impact (so a shotgun blast produces several). More...
struct  AchievementEarned
struct  AchievementEarnedLocal
struct  AchievementEvent
struct  AchievementInfoLoaded
struct  AchievementWriteFailed
struct  AddBulletHitMarker
struct  AddPlayerSonarIcon
struct  AmmoPickup
struct  AmmoRefill
struct  AnnouncePhaseEnd
struct  BeginNewMatch
struct  BombAbortdefuse
struct  BombAbortplant
struct  BombBeep
struct  BombBegindefuse
struct  BombBeginplant
struct  BombDefused
struct  BombDropped
struct  BombExploded
struct  BombPickup
struct  BombPlanted
struct  BonusUpdated
struct  BotTakeover
struct  BreakBreakable
struct  BreakProp
struct  BrokenBreakable
struct  BulletDamage
struct  BuymenuClose
struct  BuymenuOpen
struct  BuytimeEnded
struct  CartUpdated
struct  ChoppersIncomingWarning
struct  ClientDisconnect
struct  ClientLoadoutChanged
struct  ClientsideLessonClosed
struct  ClientsideReloadCustomEcon
struct  CsGameDisconnected
struct  CsIntermission
struct  CsMatchEndRestart
struct  CsPreRestart
struct  CsPrevNextSpectator
struct  CsRoundFinalBeep
struct  CsRoundStartBeep
struct  CsWinPanelMatch
struct  CsWinPanelRound
struct  DecoyDetonate
struct  DecoyFiring
struct  DecoyStarted
struct  DefuserDropped
struct  DefuserPickup
struct  DemoSkip
struct  DemoStart
struct  DemoStop
struct  DifficultyChanged
struct  DmBonusWeaponStart
struct  DoorBreak
struct  DoorClose
struct  DoorClosed
struct  DoorMoving
struct  DoorOpen
struct  DroneAboveRoof
struct  DroneCargoDetached
struct  DroneDispatched
struct  DronegunAttack
struct  DropRateModified
struct  DynamicShadowLightChanged
struct  DzItemInteraction
struct  EnableRestartVoting
struct  EndmatchCmmStartRevealItems
struct  EndmatchMapvoteSelectingMap
struct  EnterBombzone
struct  EnterBuyzone
struct  EnterRescueZone
struct  EntityKilled
struct  EntityVisible
struct  EventTicketModified
struct  ExitBombzone
struct  ExitBuyzone
struct  ExitRescueZone
struct  FinaleStart
struct  FirstbombsIncomingWarning
struct  FlareIgniteNpc
struct  FlashbangDetonate
struct  GameEnd
struct  GameInit
struct  GameMessage
struct  GameNewmap
struct  GamePhaseChanged
struct  GameStart
struct  GameinstructorDraw
struct  GameinstructorNodraw
struct  GameuiHidden
struct  GcConnected
struct  GgKilledEnemy
struct  GrenadeBounce
struct  GrenadeThrown
struct  GuardianWaveRestart
struct  HegrenadeDetonate
struct  HelicopterGrenadePuntMiss
struct  HideDeathpanel
struct  HltvCameraman
struct  HltvChangedMode
struct  HltvChase
struct  HltvChat
struct  HltvFixed
struct  HltvMessage
struct  HltvRankCamera
struct  HltvRankEntity
struct  HltvReplay
struct  HltvReplayStatus
struct  HltvStatus
struct  HltvTitle
struct  HltvVersioninfo
struct  HostageCallForHelp
struct  HostageFollows
struct  HostageHurt
struct  HostageKilled
struct  HostageRescued
struct  HostageRescuedAll
struct  HostageStopsFollowing
struct  HostnameChanged
struct  InfernoExpire
struct  InfernoExtinguish
struct  InfernoStartburn
struct  InspectWeapon
struct  InstructorCloseLesson
struct  InstructorServerHintCreate
struct  InstructorServerHintStop
struct  InstructorStartLesson
struct  InventoryUpdated
struct  ItemEquip
struct  ItemPickup
struct  ItemPickupFailed
struct  ItemPickupSlerp
struct  ItemPurchase
struct  ItemRemove
struct  ItemSchemaInitialized
struct  JointeamFailed
struct  LocalPlayerControllerTeam
struct  LocalPlayerPawnChanged
struct  LocalPlayerTeam
struct  LootCrateOpened
struct  LootCrateVisible
struct  MapShutdown
struct  MapTransition
struct  MatchEndConditions
struct  MaterialDefaultComplete
struct  MbInputLockCancel
struct  MbInputLockSuccess
struct  MolotovDetonate
struct  NavBlocked
struct  NavGenerate
struct  NextlevelChanged
struct  OpenCrateInstr
struct  OtherDeath
struct  ParachuteDeploy
struct  ParachutePickup
struct  PhysgunPickup
struct  PlayerActivate
struct  PlayerAvengedTeammate
struct  PlayerBlind
struct  PlayerChangename
struct  PlayerChat
struct  PlayerConnect
struct  PlayerConnectFull
struct  PlayerDeath
struct  PlayerDecal
struct  PlayerDisconnect
struct  PlayerFalldamage
struct  PlayerFootstep
struct  PlayerFullUpdate
struct  PlayerGivenC4
struct  PlayerHintmessage
struct  PlayerHurt
struct  PlayerInfo
struct  PlayerJump
struct  PlayerPing
struct  PlayerPingStop
struct  PlayerRadio
struct  PlayerResetVote
struct  PlayerScore
struct  PlayerShoot
struct  PlayerSound
struct  PlayerSpawn
struct  PlayerSpawned
struct  PlayerStatsUpdated
struct  PlayerTeam
struct  RagdollDissolved
struct  ReadGameTitledata
struct  RepostXboxAchievements
struct  ResetGameTitledata
struct  RoundAnnounceFinal
struct  RoundAnnounceLastRoundHalf
struct  RoundAnnounceMatchPoint
struct  RoundAnnounceMatchStart
struct  RoundAnnounceWarmup
struct  RoundEnd
struct  RoundEndUploadStats
struct  RoundFreezeEnd
struct  RoundMvp
struct  RoundOfficiallyEnded
struct  RoundPoststart
struct  RoundPrestart
struct  RoundStart
struct  RoundStartPostNav
struct  RoundStartPreEntity
struct  RoundTimeWarning
struct  SeasoncoinLevelup
struct  ServerCvar
struct  ServerMessage
struct  ServerPreShutdown
struct  ServerShutdown
struct  ServerSpawn
struct  SetInstructorGroupEnabled
struct  Sfuievent
struct  ShowDeathpanel
struct  ShowSurvivalRespawnStatus
struct  SilencerDetach
struct  SilencerOff
struct  SilencerOn
struct  SmokeBeaconParadrop
struct  SmokegrenadeDetonate
struct  SmokegrenadeExpired
struct  SpecModeUpdated
struct  SpecTargetUpdated
struct  StartHalftime
struct  StartVote
struct  StorePricesheetUpdated
struct  SurvivalAnnouncePhase
struct  SurvivalNoRespawnsFinal
struct  SurvivalNoRespawnsWarning
struct  SurvivalParadropBreak
struct  SurvivalParadropSpawn
struct  SurvivalTeammateRespawn
struct  SwitchTeam
struct  TagrenadeDetonate
struct  TeamInfo
struct  TeamIntroEnd
struct  TeamIntroStart
struct  TeamScore
struct  TeamchangePending
struct  TeamplayBroadcastAudio
struct  TeamplayRoundStart
struct  TournamentReward
struct  TrialTimeExpired
struct  UgcFileDownloadFinished
struct  UgcFileDownloadStart
struct  UgcMapDownloadError
struct  UgcMapInfoReceived
struct  UgcMapUnsubscribed
struct  UpdateMatchmakingStats
struct  UserDataDownloaded
struct  VipEscaped
struct  VipKilled
struct  VoteCast
struct  VoteCastNo
struct  VoteCastYes
struct  VoteChanged
struct  VoteEnded
struct  VoteFailed
struct  VoteOptions
struct  VotePassed
struct  VoteStarted
struct  WarmupEnd
struct  WeaponFire
struct  WeaponFireOnEmpty
struct  WeaponReload
struct  WeaponZoom
struct  WeaponZoomRifle
struct  WeaponhudSelection
struct  WriteGameTitledata
struct  WriteProfileData
class  GameEvents
 Creates, fires and listens to game events. More...
class  ClientConVars
 Asks a connected client what one of its own convars is set to. More...
struct  DamageInfo
struct  DamageHit
class  Damage
 Every entity's damage, from CBaseEntity::TakeDamageOld, and a way to deal it. More...
class  GlowVision
 Players as team-colored outlines through walls, for one client or one team alone. More...
struct  HiddenPlayer
 A player turned into a nameless spectator nobody else sees, who sees every player through walls. More...
class  Movement
 Each player's command from CCSPlayer_MovementServices::RunCommand. More...
class  Teleport
 Report player pawn moves through CBaseEntity::Teleport. More...
struct  TextMessage
class  TextMessages
 Outgoing TextMsg user messages, the game's own lines included. More...
struct  GlowConfig
class  Visibility
 Which clients receive which entities, filtered after CheckTransmit. More...
struct  VoiceListen
class  Voice
 Who hears whose voice, decided each time the game opens a voice channel. More...
struct  VoteTally
struct  VoteRequest
class  Vote
 The game's yes/no vote panel (F1/F2), with the ballots counted here. More...
struct  WeaponDropRequest
class  WeaponDrop
 A player's own weapon drops, from CCSPlayer_WeaponServices::DropWeapon. More...
struct  IPluginAddons
struct  IPluginContext
struct  IPluginEvents
struct  IPluginGameData
struct  IPluginLanguages
struct  IPluginServices
struct  PluginDescriptor
struct  HeaderNameLess
struct  HttpRequest
class  HttpClient
 Runs HTTP requests off the game thread and their completions on it. More...
struct  HttpResult
class  CenterHtmlMenu
 Menus drawn as center HTML and driven with W/S/A/D/E/R. It needs no client addon, so runtime.Menus falls back to it for a player another surface cannot draw for. More...
class  ChatInput
 Per-player pending-prompt registry for menu free-text input. More...
class  Flow
class  EnabledCondition
struct  ButtonRow
struct  ToggleRow
struct  ChoiceIndex
struct  ChoiceRow
struct  InputRow
struct  SubmenuRow
struct  TextRow
class  MenuBuilder
class  MenuFreeze
 Holding players still while a menu is open, for every menu surface. More...
struct  MenuRow
struct  MenuOptions
class  MenuSurface
struct  MenuItem
struct  Menu
struct  PlayerPicker
struct  DurationMenu
class  SummaryRows
struct  ConfirmMenu
class  MenuRouter
 runtime.Menus: the surface menus start on, chosen once per session. More...
class  MenuStack
 One player's open menus, and the row behaviour every surface shares. More...
class  PanoramaMenu
 Run menu sessions on a plugin's PanoramaMenuLayout. More...
struct  MenuButton
struct  MenuHeader
struct  MenuTab
class  PanoramaMenuLayout
 The screen built from the menu Panorama block, as PanoramaMenu draws on it. More...
class  PendingCommit
 One held-back row commit per player: what a stepped row was left showing, applied once the stepping stops. More...
class  CenterHtml
 Shows a center-HTML panel until stopped. render runs every refresh, so live values stay current; a page goes out when it changes and at least every CenterHtmlKeepAliveMs. More...
class  Messages
 Send chat, center print, center HTML, and alert messages. More...
struct  IPermissions
 The server's permission source, published by one plugin (admin-system) through runtime.Exchange. More...
class  Player
 One connected player, owned by PlayerManager for the length of the connection. More...
struct  ConnectRequest
struct  ChatMessage
class  PlayerManager
 The roster: every connected player, and the signals for the connection lifecycle. More...
struct  PlayerRef
 A storable reference to a player: the slot plus the SteamID that occupied it. More...
struct  Authorized
 A caller/target pair that cleared Policy::Authorize. More...
class  Policy
 The one permission and targeting gate, plus the plugin's reply callback. More...
class  Runtime
 Framework services for one load and unload cycle. More...
struct  ButtonPress
 A Button press inside a custom HUD layout. More...
class  PlayerScreens
 One layout's player screens, each created the first time something draws for that slot. More...
class  Screen
 A spawned Panorama layout created by ScreenManager. More...
class  ScreenManager
 Create Screen objects and report their button presses. More...
struct  UnsafeServices
 Opt-in access to raw engine interfaces and typed gamedata bindings. More...
class  MultiAddonManager
class  ArgBinder
 The one thing command dispatch needs a running server for. More...
class  EngineArgBinder
struct  ArgError
 A binding failure, as the key and tokens the reply is built from. More...
class  CommandRouter
 The registered commands, their usage lines, and the dispatch that runs one. More...
struct  TargetRules
struct  TargetFailure
struct  TargetQuery
struct  PlayerView
struct  Migration
struct  SslModeName
class  MemberBinder
struct  PatternByte
struct  Image
struct  ScanRange
struct  ModuleScan
struct  ScriptTarget
struct  MemoryRegion
struct  ScanResult
struct  FoundBase
struct  BaseSubobject
struct  TypeInfoKinds
class  MappedFile
struct  StartSoundEventInfo
struct  EngineDamageInfo
struct  EngineDamageResult
struct  PendingConVarQuery
 One outstanding client convar query, identified by the cookie sent to the client. More...
class  PendingConVarQueries
 Bookkeeping for ClientConVars: per-slot, cookie-keyed queries awaiting an answer. More...
class  VoltCommand
class  EngineHooks
 The engine hooks, installed once for the whole process. More...
struct  EngineInterfaces
class  ServerAssets
struct  GameDataDocument
struct  GameDataRecord
struct  VirtualSlot
struct  GameDataEntry
class  GameDataScanner
class  GameDataTable
class  ModuleSymbols
class  Host
class  ButtonPresses
 The FilterMessage hook for every plugin: custom HUD button presses, raised on the frame after they arrive. Game thread only. More...
class  PlayerCommands
 The RunCommand hook for every plugin: each command is decoded once, and only while a plugin listens. Game thread only. More...
struct  LoaderHandoff
class  CallbackList
class  CommandNames
struct  PluginDocument
struct  PluginManifest
struct  RefusedPlugin
struct  InstalledScan
class  LanguageTable
struct  ConnectedClient
struct  SharedState
struct  LeakReport
class  PluginContext
struct  LoadList
struct  LoadedPlugin
class  PluginLoader
 Finds the installed plugins and loads the ones their dependencies allow. More...
class  PluginRegistry
 The loaded plugins and the engine events raised on them, one per process. More...
class  PublishedInterfaces
class  SharedLibrary
class  SchemaCheck
struct  AddonDecision
class  DownloadQueue
class  WorkshopDownloads
struct  WaitingRequest
class  KHookForwarder
 The loader's KHook, which every module's hooks go through. More...
struct  CenterHtmlHeader
struct  CenterHtmlView
struct  ChoiceState
struct  CursorRows
class  LayoutPath
 A layout resource the client will accept, checked before anything is spawned. More...
class  ScreenEntity
 The custom_hud_layout entity behind a Screen: spawning, removal, and every write. More...
class  WriteCache
 What each player, or everyone, was last sent on one screen, so an unchanged write is skipped. More...

Concepts

concept  NamesArgKind
concept  CommandArg
concept  CommandSignature
concept  HasOneCallOperator
concept  ConVarValue
concept  RawConVarValue
concept  MenuRowSpec

Typedefs

using BoundArg = typename BoundArgVariant<Args::All>::Type
template<class T>
using Result = std::expected<T, Error>
using Status = std::expected<void, Error>
template<class Value>
using StringMap = std::unordered_map<std::string, Value, StringHash, std::equal_to<>>
using Tokens = std::map<std::string, std::string>
template<class TFirst, class TSecond>
using PairCooldown = Cooldown<std::pair<TFirst, TSecond>, std::map<std::pair<TFirst, TSecond>, int64_t>>
using PostgresConnection = sqlpp::postgresql::connection
using MariaDbConnection = sqlpp::mysql::connection
using SqliteConnection = sqlpp::sqlite3::connection
using AnyConnection = std::variant<std::monostate, PostgresConnection, MariaDbConnection, SqliteConnection>
using HasDefault = std::true_type
using Required = std::false_type
using GameDataLookup = std::function<GameDataLocation(GameDataSection sections, std::string_view name)>
using Vector = ::Vector
using QAngle = ::QAngle
using OriginalSlotLookup = std::function<const void*(void** vtable, int index)>
using HttpHeaders = std::map<std::string, std::string, HeaderNameLess>
using HttpCompletion = std::function<void(const HttpResult&)>
using PostgresSslMode = sqlpp::postgresql::connection_config::sslmode_t
using ByteHistogram = std::array<size_t, 256>
using ScriptBindingLookup = std::function<Result<ScriptTarget>(void* classTable, std::string_view name)>
using EmitSoundFilterFn
using PostEvent
using HandleVector = CNetworkUtlVectorBase<CEntityHandle>
using InterfaceFactory = void* (*)(const char* name, int* returnCode)
using HostStartFn = bool (*)(const LoaderHandoff* start, char* error, size_t errorSize)
using HostStopFn = void (*)()
using PluginsByName = std::map<std::string, const PluginManifest*, std::less<>>
using RefusalsByName = std::map<std::string, Error, std::less<>>
using StringTable = CNetworkUtlVectorBase<CUtlString>

Enumerations

enum class  ArgKind : uint8_t {
  Target , Targets , Duration , SteamId ,
  PlayerOrSteamId , Int , U64 , Word ,
  Rest
}
 Which binder runs for one declared argument. More...
enum class  CommandAccess : uint8_t { Chat , Players , PlayersAndServer , ServerOnly }
enum class  LogLevel : uint8_t { Info , Warn , Error }
enum class  ErrorCode : uint8_t {
  NotFound , NotReady , Invalid , Denied ,
  Immune , Unsupported , Engine , Failed
}
 Why an operation did not produce a value. More...
enum class  HookAction : uint8_t { Allow = 0 , Replace , Block }
enum class  Driver { Postgres , MariaDb , Sqlite }
enum class  GameDataSection : uint32_t { Function = 1u << 0 , Global = 1u << 1 , VTable = 1u << 2 , Offset = 1u << 3 }
enum class  Team : uint8_t { None = 0 , Spectator = 1 , T = 2 , CT = 3 }
enum class  HitGroup : int {
  Invalid = -1 , Generic = 0 , Head = 1 , Chest = 2 ,
  Stomach = 3 , LeftArm = 4 , RightArm = 5 , LeftLeg = 6 ,
  RightLeg = 7 , Neck = 8
}
enum class  ObserverMode : uint8_t {
  None = 0 , Fixed = 1 , InEye = 2 , Chase = 3 ,
  Roaming = 4
}
enum class  RoundEndReason : uint32_t { CounterTerroristsWin = 8 , TerroristsWin = 9 , Draw = 10 }
enum class  TraceLayers { Sight , Solid , Surfaces }
enum class  ClientConVarStatus { Answered = 0 , NotFound , NotAConVar , Protected }
 How the client answered a convar query (CCLCMsg_RespondCvarValue::status_code). More...
enum class  VoteEndReason { AllVoted , TimeUp , Cancelled }
enum class  HttpMethod {
  Get , Post , Put , Patch ,
  Delete
}
enum class  ChoiceApply { AfterStep , OnActivate }
enum class  MenuRowKind {
  Text , Button , Submenu , Toggle ,
  Choice , Input
}
enum class  MenuButtonKind {
  Cancel , Back , Close , PreviousPage ,
  NextPage , Tab , Row , StepDown ,
  StepUp
}
enum class  MessageKind { Chat , Center , CenterHtml , Alert }
enum class  Origin : uint8_t { Chat , Console }
enum class  TargetError {
  NoMatch , Immune , Ambiguous , MultiNotAllowed ,
  DeadNotAllowed , BotNotAllowed
}
enum class  TargetKind {
  All , Me , NotMe , Team ,
  Dead , Alive , Bots , Humans ,
  Random , RandomTeam , Slot , SteamId ,
  Name
}
enum class  ConVarType : int16_t {
  Invalid = -1 , Bool , Int16 , UInt16 ,
  Int32 , UInt32 , Int64 , UInt64 ,
  Float32 , Float64 , String , Color ,
  Vector2 , Vector3 , Vector4 , QAngle ,
  VectorWS
}
enum class  AddonAction {
  Unchanged , Send , TrimToFirst , Kick ,
  KeepMounted
}
enum class  WriteKind { Text , Class }

Functions

template<class TConfig>
TConfig LoadConfig (Runtime &runtime, TConfig config={}, const LoadConfigOptions &options={})
 Load the plugin's settings, then its translations, and return config.
template<std::size_t... I>
consteval bool ArgKindsMatchOrder (std::index_sequence< I... >)
template<class... A>
consteval bool OptionalsTrail ()
template<class... A>
consteval bool RestIsLast ()
template<class... A>
std::vector< ArgDesc > DescribeArgs ()
Result< std::string > ReadAllText (std::string_view path)
 Read path (resolved via ResolvePath) into a string.
Status WriteAllText (std::string_view path, std::string_view text)
 Write text to path (resolved via ResolvePath), creating its directory.
void SetBaseDir (const std::filesystem::path &baseDir)
 Set the base directory for path resolution (the host's csgo directory). Must be called during initialization before any file loading.
std::filesystem::path ResolvePath (std::string_view relativePath)
 a relative path against the base directory. If the path is already absolute, returns it as-is.
std::string PluginDir (std::string_view plugin)
 "addons/voltmod/plugins/<plugin>". Pure string building, so safe at static init.
std::string PluginFile (std::string_view plugin, std::string_view relative)
 "addons/voltmod/plugins/<plugin>/<relative>".
std::size_t RandomIndex (std::size_t count)
constexpr bool IsValidSlot (int slot)
template<class E>
constexpr std::string_view Name (E value) noexcept
template<class E>
constexpr std::optional< E > Parse (std::string_view name) noexcept
template<class E>
constexpr std::size_t EnumIndex (E value) noexcept
template<class E>
constexpr auto EnumValues () noexcept
std::optional< int64_t > ParseInt64 (std::string_view text)
std::optional< uint64_t > ParseUInt64 (std::string_view text)
int ParseDuration (std::string_view text)
MigrationResult RunMigrations (Database &db, std::string_view dir, const MigrationOptions &options={})
template<class Conn, class Statement>
int64_t Insert (Conn &conn, const Statement &insert, std::string_view table, std::string_view key="id")
template<class Conn, class Update, class Statement>
void Upsert (Conn &conn, const Update &update, const Statement &insert)
std::optional< Driver > ParseDriver (std::string_view name)
std::string DriverName (Driver driver)
std::optional< int > ParseMigrationVersion (std::string_view filename)
Dialect PickDialect (Driver driver)
Result< std::string > ResolveDialect (std::string_view sql, Driver driver)
std::vector< std::string > SplitStatements (std::string_view sql)
template<class T>
std::string ConVarText (const T &value)
template<>
std::string ConVarText< bool > (const bool &value)
template<>
std::string ConVarText< int > (const int &value)
template<>
std::string ConVarText< float > (const float &value)
template<>
std::string ConVarText< std::string > (const std::string &value)
const void * ReadOriginalSlot (void **vtable, int index)
constexpr GameDataSection operator| (GameDataSection left, GameDataSection right)
Vector AngleToForward (const QAngle &angles)
Vector YawToForward (float yaw)
Axes AngleToAxes (const QAngle &angles)
Vector OffsetLocal (const Vector &origin, const QAngle &angles, const Vector &forwardLeftUp)
QAngle AngleTo (const Vector &from, const Vector &to)
float AngleDelta (float from, float to)
float TurnToward (float current, float target, float maxStep)
template<typename T>
T * MemberPtr (void *base, std::ptrdiff_t offset) noexcept
template<typename T>
T ReadAt (void *base, std::ptrdiff_t offset) noexcept
template<typename T>
void WriteAt (void *base, std::ptrdiff_t offset, const T &value) noexcept
constexpr bool IsPlaying (Team team)
constexpr Team Opposite (Team team)
int HoldFireTick (const Clock &clock)
constexpr int PageCount (int items, int perPage)
constexpr int WrapIndex (int value, int count)
bool IsRowActionable (const MenuItem &item, int slot)
void AppendPlayerRows (MenuBuilder &builder, PlayerManager &players, const PlayerPicker &spec)
std::shared_ptr< Menu > BuildPlayerPicker (PlayerManager &players, PlayerPicker spec)
std::shared_ptr< Menu > BuildDurationMenu (DurationMenu spec)
std::shared_ptr< Menu > BuildConfirmMenu (ConfirmMenu spec)
template<class Iface, class Ret, class... Args, class Before, class After = std::nullptr_t>
Subscription HookInterface (Ret(Iface::*method)(Args...), Iface *instance, Before &&before, After &&after=nullptr)
 Hook one virtual method of an engine interface for a subscription's lifetime.
template<class Object, class Ret, class... Args, class Before, class After = std::nullptr_t>
Result< Subscription > HookVirtual (std::string_view name, const VirtualFn< Ret(Object *, Args...)> &function, Before &&before, After &&after=nullptr)
 Hook a gamedata-bound virtual function on objects sharing its class vtable.
template<class Object, class Ret, class... Args, class Before, class After = std::nullptr_t>
Result< Subscription > HookTable (std::string_view name, Ret(Object::*method)(Args...), const ClassTable &table, Before &&before, After &&after=nullptr)
 Hook an SDK-declared virtual on every object sharing a gamedata-found class table.
template<class Object, class Ret, class... Args, class Before, class After = std::nullptr_t>
Result< Subscription > HookFunction (std::string_view name, const Fn< Ret(Object *, Args...)> &function, Before &&before, After &&after=nullptr)
 Hook a signature-bound function at its entry.
template<class Iface, class Ret, class... Args, class... Passed>
Ret CallOriginal (Ret(Iface::*method)(Args...), Iface *instance, Passed &&... args)
static ArgError TargetKey (const TargetFailure &failure, const std::string &token)
static std::expected< Args::Target, ArgError > BindTarget (ArgBinder &binder, const std::string &token, Player *caller)
static std::expected< Args::Targets, ArgError > BindTargets (ArgBinder &binder, const std::string &token, Player *caller)
static std::expected< Args::PlayerOrSteamId, ArgError > BindPlayerOrSteamId (ArgBinder &binder, const std::string &token, Player *caller)
static std::expected< Args::Duration, ArgError > BindDuration (const std::string &token)
static std::expected< Args::SteamId, ArgError > BindSteamId (const std::string &token)
static std::expected< Args::Int, ArgError > BindInt (const std::string &token)
static std::expected< Args::U64, ArgError > BindU64 (const std::string &token)
template<class T>
static std::optional< ArgError > Store (std::expected< T, ArgError > parsed, std::vector< BoundArg > &bound)
std::expected< std::vector< BoundArg >, ArgError > BindArgs (const CommandDefinition &def, std::span< const std::string > tokens, Player *caller, ArgBinder &binder)
static std::string FailureLine (const Error &error, const Translations &translations, int slot)
static std::string UsagePlaceholderKey (ArgKind kind)
TargetQuery ParseTargetToken (std::string_view token)
std::expected< std::vector< int >, TargetFailure > FilterPlayers (std::span< const PlayerView > players, const TargetQuery &query, const TargetRules &rules, int callerSlot, const std::function< std::size_t(std::size_t)> &randomIndex)
std::string_view GameBuild ()
static std::string ReplaceAll (const std::string &str, const std::string &from, const std::string &to)
static void FlattenInto (const glz::generic &node, const std::string &prefix, StringMap< std::string > &out)
static const StringMap< std::string > & KitDefaults ()
static bool IsValidTableName (const std::string &name)
static std::string HistoryTableDdl (const std::string &table)
template<class Conn>
static void ApplyMigration (Conn &conn, const std::string &table, const Migration &migration, const std::vector< std::string > &statements)
static std::optional< PostgresSslMode > ParseSslMode (std::string_view name)
static sqlpp::postgresql::connection_config PostgresSettings (const DatabaseConfig &config)
static sqlpp::mysql::connection_config MariaDbSettings (const DatabaseConfig &config)
static sqlpp::sqlite3::connection_config SqliteSettings (const DatabaseConfig &config)
Result< Driver > CheckConfig (const DatabaseConfig &config)
bool IsOpen (const AnyConnection &connection)
void OpenConnection (AnyConnection &connection, Driver driver, const DatabaseConfig &config)
template Result< ConVar< std::string > > ConVars::Find< std::string > (std::string_view)
template<class T>
bool ConVarTypeMatches (ConVarType type)
template bool ConVarTypeMatches< bool > (ConVarType)
template bool ConVarTypeMatches< int > (ConVarType)
template bool ConVarTypeMatches< float > (ConVarType)
template bool ConVarTypeMatches< std::string > (ConVarType)
template<>
std::string ConVarText< bool > (const bool &value)
template<>
std::string ConVarText< int > (const int &value)
template<>
std::string ConVarText< float > (const float &value)
template<>
std::string ConVarText< std::string > (const std::string &value)
std::vector< PatternByte > ParsePattern (const std::string &pattern)
void CountBytes (const uint8_t *base, size_t size, ByteHistogram &counts)
size_t Anchor (const std::vector< PatternByte > &pattern, const ByteHistogram &frequencies)
static bool Matches (const uint8_t *at, const std::vector< PatternByte > &pattern)
const uint8_t * FindFirst (const uint8_t *base, size_t size, const std::vector< PatternByte > &pattern, size_t anchor)
bool FindModuleAndRanges (std::string_view fileName, Image &module, std::vector< ScanRange > &ranges)
static std::string_view BaseName (std::string_view path)
static int DlIterateCallback (struct dl_phdr_info *info, size_t, void *data)
static std::string_view BaseName (std::string_view path)
static bool SameFileName (std::string_view left, std::string_view right)
constexpr uintptr_t Rel32Site (uintptr_t matchAddress, int ripOffset) noexcept
constexpr uintptr_t Rel32Target (uintptr_t site, int32_t displacement, int ripSize=Rel32Size) noexcept
constexpr bool Rel32ReadInBounds (uintptr_t moduleBase, size_t moduleSize, uintptr_t matchAddress, int ripOffset) noexcept
static const ScriptFunctionBinding_t * FindBinding (const ScriptClassDesc_t *description, std::string_view name)
static int VirtualIndex (const void *function)
Result< ScriptTarget > FindScriptBinding (void *classTable, std::string_view name)
static const ByteHistogram & Frequencies (const Image &module, const std::vector< ScanRange > &ranges)
std::string PlatformModuleName (std::string_view moduleName)
bool FindImage (std::string_view moduleName, Image &module)
ScanResult FindPatternEx (std::string_view moduleName, const std::string &pattern)
uintptr_t ResolveRelativeAddress (const Image &module, uintptr_t matchAddress, int ripOffset, int ripSize)
static std::optional< MemoryRegion > QueryRegion (const void *address)
bool IsExecutableAddress (const void *address)
bool IsReadableAddress (const void *address, size_t bytes)
void * FindVirtualTable (std::string_view moduleName, std::string_view className)
static uintptr_t ReadWord (uintptr_t address)
static uint32_t ReadU32 (uintptr_t address)
static std::vector< uintptr_t > FindWords (std::span< const ScanRange > ranges, uintptr_t value)
std::string LengthPrefixedName (std::string_view className)
void * FindVirtualTableByTypeName (std::span< const ScanRange > ranges, std::string_view className)
bool HasVtable (const void *object, const void *table)
static bool LooksLikeTypeInfo (uintptr_t address)
static bool NameIs (uintptr_t address, std::string_view wanted)
static bool HasSingleBase (uintptr_t typeInfo, const TypeInfoKinds &kinds)
static uint32_t BaseCount (uintptr_t typeInfo, const TypeInfoKinds &kinds)
static void CollectBases (uintptr_t typeInfo, std::string_view wanted, FoundBase at, const TypeInfoKinds &kinds, int depth, std::vector< FoundBase > &found)
Result< int > FindBaseOffsetByTypeInfo (const void *typeInfo, std::string_view baseName, const TypeInfoKinds &kinds)
void * FindVirtualTableByTypeInfo (std::span< const ScanRange > ranges, const void *typeInfo, intptr_t offsetToTop)
void * FindVirtualTableIn (const Image &module, std::string_view className)
Result< BaseSubobject > FindBaseIn (const Image &module, std::string_view className, std::string_view baseName)
static uint64_t FindSymbolValue (const MappedFile &elf, const std::string &symbol)
static bool FindRanges (const Image &module, std::vector< ScanRange > &ranges)
static const TypeInfoKinds & ExportedTypeInfoKinds ()
static const uint8_t * FindValue (const uint8_t *begin, const uint8_t *end, const void *needle, size_t len, size_t stride)
template<typename T>
static T ReadAt (const uint8_t *address)
static const uint8_t * End (const ScanRange &range)
static const uint8_t * AtRva (const PeRtti &rtti, int64_t rva, size_t bytes)
static std::array< std::string, 2 > ClassAndStructNames (std::string_view name)
static uint32_t FindTypeDescriptor (const PeRtti &rtti, std::string_view className)
static bool TypeDescriptorMatches (const PeRtti &rtti, int32_t rva, std::span< const std::string > names)
static const uint8_t * FindLocator (const PeRtti &rtti, uint32_t typeDescriptor, uint32_t offset)
static void * TableAfter (const PeRtti &rtti, const uint8_t *locator)
static std::pair< uint32_t, const uint8_t * > PrimaryLocator (const PeRtti &rtti, std::string_view className)
void * FindVirtualTableInRtti (const PeRtti &rtti, std::string_view className)
Result< BaseSubobject > FindBaseInRtti (const PeRtti &rtti, std::string_view className, std::string_view baseName)
static ScanRange FindSection (const Image &module, std::string_view name)
static PeRtti Rtti (const Image &module)
bool PostUserMessage (Interfaces &interfaces, NetMessageInfo_t *&cached, std::string_view partialName, IRecipientFilter &filter, const std::function< bool(CNetMessage *)> &fill)
Log::Handler MakeConsoleHandler (std::string prefix)
 The default handler: tier0 ConColorMsg/Msg, one colour per level.
static bool TokenizeOneCommand (std::string_view command, CCommand &args)
static void FireInput (const Bindings &bindings, CEntityInstance *entity, std::string_view input, variant_t &value, CEntityInstance *activator)
static Schema::CGameSceneNode SceneNode (const Entity &entity)
static bool IsModelEntity (CEntityInstance *entity)
static Schema::CCSGameRules GameRules (EntitySystem &entities)
static Status NoGameRules ()
static uint64_t Mask (TraceLayers layers)
static CTraceFilter MakeFilter (const TraceOptions &options)
static EntityRef Ref (const CEntityInstance *entity)
static TraceHit ToHit (const CGameTrace &trace)
static std::optional< TraceHit > OnlyHit (const Result< TraceHit > &trace)
static EngineNavPhysics * NavPhysics (void *&table)
static void SetWeapon (IGameEvent &event, std::string_view weapon)
static Result< Subscription > HookTeleport (const Bindings &bindings, EntitySystem &entities, Event< int > &before)
static HookResult< void > FilterTextMessage (Event< TextMessage & > &before, NetMessageInfo_t *kind, const CNetMessage *data)
static void AddIndex (HiddenPlayer &player, int index)
static void AddHandleVector (EntitySystem &entities, HiddenPlayer &player, const void *vector)
static CEntityInstance * ObserverTarget (EntitySystem &entities, int recipientSlot)
static void CollectHiddenPlayer (EntitySystem &entities, int slot, bool pawnHidden, bool controllerHidden, HiddenPlayer &out)
static HookResult< bool > FilterListening (Event< VoiceListen & > &before, IVEngineServer2 &engine, CPlayerSlot receiver, CPlayerSlot sender, bool listen)
static std::string_view Text (const char *text)
static HookResult< void > RunCommand (PluginRegistry &registry, std::string_view name, const CCommand &arguments, int slot)
static HookResult< bool > AdmitClient (PluginRegistry &registry, int slot, uint64_t xuid, std::string_view name, CBufferString *rejectReason)
static std::string_view ClientAddress (IVEngineServer2 *server, CPlayerSlot slot)
static Result< Subscription > HookSessionManifest (PluginRegistry &registry)
template<class Iface>
static Status Find (Iface *&target, InterfaceFactory factory, const char *version)
template<class Iface>
static void FindOptional (Iface *&target, InterfaceFactory factory, const char *version)
Result< EngineInterfaces > ResolveEngineInterfaces (const LoaderHandoff &start)
template<class TEntry>
const auto & PlatformColumn (const TEntry &entry)
void WriteGameDataRecord (const GameDataRecord &resolved)
static std::unexpected< Error > Unbound (std::string reason)
static uint64_t Rva (const Image &module, const void *address)
static Result< ScanResult > Scan (std::string_view moduleName, const std::string &pattern)
template<class TEntry>
static Result< int > ColumnValue (const TEntry &entry, std::string_view what)
static const void * OriginalSlot (void *table, int index, const OriginalSlotLookup &originalSlots)
static std::unexpected< Error > Unbound (std::string reason)
static int OwnerSlot (void *movementServices)
Status ValidateDescriptor (const PluginDescriptor *descriptor, std::string_view hostVersion)
static void RefuseUnsatisfied (const PluginsByName &plugins, RefusalsByName &refused)
static void WarnLeaks (std::string_view name, const LeakReport &leaks)
static std::filesystem::path LibraryPath (std::string_view name)
static InstalledScan Installed ()
static void RaiseCommand (CallbackList< IPluginEvents::PlayerCommandFn > &listeners, int slot, const PlayerInput &input)
static std::string LastError ()
static void * OpenLibrary (const std::filesystem::path &path)
static void * FindExport (void *handle, const char *name)
static void CloseLibrary (void *handle)
static std::vector< std::string_view > SplitAddonList (std::string_view field)
std::vector< uint64_t > ParseAddonList (std::string_view field)
std::vector< uint64_t > AppendToAddonList (std::string &field, const std::vector< uint64_t > &ids)
void RemoveFromAddonList (std::string &field, const std::vector< uint64_t > &ids)
static CUtlString * AddonList (CNetworkGameServerBase &server)
static HttpResult ToResult (cpr::Response &&response)
static HttpResult Perform (const HttpRequest &request, const std::atomic_bool &stopped)
static bool SameKey (std::string_view left, std::string_view right)
static std::string_view NextWord (std::string_view &line)
std::vector< std::string > GameSearchPaths (std::string_view gameinfo)
 The Game values under SearchPaths in a gameinfo.gi, in file order.
template<class Fn>
static Fn SwapSlot (void *object, int index, Fn replacement)
static std::filesystem::path GameDir ()
static std::string ReadFile (const std::filesystem::path &path)
static InterfaceFactory LoadNextServer ()
static InterfaceFactory FindNextFactory ()
static void StartHost ()
static bool OnConnect (void *config, InterfaceFactory engineFactory)
static InitReturnVal_t OnInit (void *server)
static void StopHost ()
static void OnShutdown (void *server)
static void OnDisconnect (void *config)
static void Patch (const char *name, void *object)
void * OpenModule (const std::filesystem::path &path)
std::filesystem::path OwnPath ()
InterfaceFactory FactoryAt (const void *address)
static HMODULE ModuleAt (const void *address)
std::string RenderHeader (const CenterHtmlHeader &header)
static std::string FooterChunk (std::string_view keyColor, std::string_view keyText, const std::string &label)
std::string RenderFooter (bool isSubmenu, bool isPaginated, bool selectedRowSteps, int slot, Translations &translations)
static std::string RowText (const MenuRow &row)
static std::string RenderItems (const CenterHtmlView &view, int pageStart, int pageEnd, MenuRow &selected)
std::string RenderMenuHtml (const Menu *menu, const CenterHtmlView &view, Translations &translations)
std::string RenderCaptureOverlay (const std::string &menuTitle, std::string_view prompt)
static std::function< MenuRow(int)> DescribeRow (std::string label, MenuRowKind kind, EnabledCondition enabled, std::function< void(int slot, MenuRow &row)> live={})
static std::function< void(int, MenuSurface &)> WhenEnabled (EnabledCondition enabled, std::function< void(int, MenuSurface &)> action)
static bool IsSelectable (const CursorRows &rows, int index)
static PendingCommit::Timer TimerOn (Scheduler &scheduler)
static std::string EnsureColorPrefix (std::string_view message)
static std::string Render (std::string_view message, MessageKind kind)
static int HudDestination (MessageKind kind)
static Subscription WatchCommands (IPluginEvents &events, Movement &movement)
static Subscription WatchPresses (IPluginEvents &events, ScreenManager &screens)
static Error NotSourceXml (std::string_view layout)
static std::string RootElement (std::string_view layout)
static std::string_view ModifierClass (std::string &out, std::string_view block, std::string_view name)
static void SetStr (CUtlString &out, std::string_view text)
static std::string_view ClassValue (bool on)

Variables

template<class T>
constexpr bool IsOptionalArg = false
template<class T>
constexpr bool IsOptionalArg< Args::Opt< T > > = true
constexpr int MaxPlayers = 64
constexpr int EveryoneSlot = -1
template<class E>
constexpr std::size_t EnumCount = magic_enum::enum_count<E>()
template<class Conn>
constexpr bool IsPostgres = std::same_as<std::remove_cvref_t<Conn>, PostgresConnection>
template<class Conn>
constexpr bool IsMariaDb = std::same_as<std::remove_cvref_t<Conn>, MariaDbConnection>
template<class Conn>
constexpr bool IsSqlite = std::same_as<std::remove_cvref_t<Conn>, SqliteConnection>
constexpr float DegreesPerRadian = 180.0f / std::numbers::pi_v<float>
constexpr uint32_t DamageGeneric = 0
constexpr uint32_t DamageCrush = 1u << 0
constexpr uint32_t DamageBullet = 1u << 1
constexpr uint32_t DamageSlash = 1u << 2
constexpr uint32_t DamageBurn = 1u << 3
constexpr uint32_t DamageFall = 1u << 5
constexpr uint32_t DamageBlast = 1u << 6
constexpr uint32_t DamageClub = 1u << 7
constexpr uint32_t DamageShock = 1u << 8
constexpr uint32_t DamageHeadshot = 1u << 19
constexpr const char * PluginEntryName = "VoltMod_Plugin"
constexpr int64_t CenterHtmlKeepAliveMs = 250
static std::filesystem::path g_baseDir
static constexpr size_t MaxQueuedJobs = 4096
static constexpr auto ReconnectBackoff = std::chrono::seconds(5)
static constexpr SslModeName SslModes []
static constexpr PostgresSslMode TlsModes []
static constexpr std::string_view InMemory = ":memory:"
constexpr int Rel32Size = 4
static constexpr size_t TypeInfoBase = 2 * sizeof(void*)
static constexpr size_t TypeInfoFlags = 2 * sizeof(void*)
static constexpr size_t TypeInfoCount = TypeInfoFlags + sizeof(uint32_t)
static constexpr size_t TypeInfoBaseList = 3 * sizeof(void*)
static constexpr size_t BaseEntrySize = 2 * sizeof(void*)
static constexpr uintptr_t VirtualBaseFlag = 1
static constexpr uint32_t MaxBases = 64
static constexpr int MaxDepth = 32
static constexpr size_t TypeDescriptorName = 0x10
static constexpr size_t LocatorOffset = 0x04
static constexpr size_t LocatorTypeDescriptor = 0x0C
static constexpr size_t LocatorHierarchy = 0x10
static constexpr size_t LocatorSelf = 0x14
static constexpr size_t LocatorSize = 0x18
static constexpr size_t HierarchyBaseCount = 0x08
static constexpr size_t HierarchyBaseList = 0x0C
static constexpr size_t HierarchySize = 0x10
static constexpr size_t BaseMemberOffset = 0x08
static constexpr size_t BaseVirtualOffset = 0x0C
static constexpr size_t BaseSize = 0x18
static constexpr uint32_t MaxBases = 1024
static constexpr float MinScale = 0.05f
static constexpr float MaxScale = 3.0f
static constexpr std::string_view ControllerClass = "cs_player_controller"
static constexpr int GlowTeamAny = -1
static constexpr int GlowStateAlwaysOn = 3
static constexpr int OutlineRenderAmount = 1
static constexpr int TargetSentToClients = 1
static constexpr int HoldFireTicks = 24
static constexpr int HoldFireStep = 12
static constexpr uint64_t SightMask = CONTENTS_SOLID | CONTENTS_BLOCK_LOS
static constexpr uint64_t SurfacesMask = CONTENTS_SOLID | CONTENTS_WINDOW | CONTENTS_PASS_BULLETS | CONTENTS_SKY
static constexpr int PropSpawnFlags = 256
static constexpr int MaxIndicesPerPlayer = 24
static constexpr std::string_view ControllerClass = "vote_controller"
static constexpr int YesNoIssueIndex = 2
static constexpr int NoIssue = -1
static constexpr int AllTeams = -1
static constexpr int YesOption = 0
static constexpr int NoOption = 1
static constexpr std::string_view VoteStartMessage = "CCSUsrMsg_VoteStart"
static constexpr std::string_view VotePassMessage = "CCSUsrMsg_VotePass"
static constexpr std::string_view VoteFailedMessage = "CCSUsrMsg_VoteFailed"
static constexpr std::string_view CommandUsage
constexpr std::string_view PlatformName = "linux"
static constexpr std::string_view GameDataPath = "addons/voltmod/gamedata/gamedata.jsonc"
static Host g_host
static constexpr const char * UserMessageName = "CSVCMsg_UserMessage"
static constexpr int64_t WarningIntervalSeconds = 10
constexpr const char * HostStartName = "VoltMod_HostStart"
constexpr const char * HostStopName = "VoltMod_HostStop"
static constexpr std::string_view ManifestName = "plugin.json"
static constexpr std::string_view LibrarySuffix = ".so"
static constexpr double DownloadTimeoutSeconds = 30.0
static constexpr int MaxDownloadAttempts = 3
static constexpr double ForgetAfterSeconds = 12.0 * 60.0 * 60.0
static constexpr size_t MaxWorkers = 4
static constexpr size_t MaxWaiting = 64
static constexpr std::string_view Blank = " \t\r"
static KHookForwarder g_dispatcher
static std::string g_gameDir
static LoaderHandoff g_start {.HookDispatcher = &g_dispatcher}
static HostStopFn g_stopHost = nullptr
static bool(* g_connect )(void *config, InterfaceFactory engineFactory) = nullptr
static void(* g_disconnect )(void *config) = nullptr
static InitReturnVal_t(* g_init )(void *server) = nullptr
static void(* g_shutdown )(void *server) = nullptr
constexpr std::string_view PlatformDir = VOLTMOD_BIN_DIR
constexpr std::string_view HostFile = VOLTMOD_HOST_FILE
constexpr std::string_view ServerFile = "libserver.so"
constexpr int CenterHtmlRowsPerPage = 5
static constexpr std::string_view kBreadcrumbSeparator = " › "
static constexpr std::string_view SourceExtension = ".xml"
static constexpr int32_t ClassAbsent = 0
static constexpr int32_t ClassPresent = 1
static constexpr int StringTableCap = 1024
static constexpr int StringTableHeadroom = 64
static constexpr char KeySeparator = '\x1f'

Typedef Documentation

◆ AnyConnection

A connection of whichever driver is configured; monostate while closed.

Definition at line 24 of file Connection.hpp.

◆ BoundArg

using VoltMod::BoundArg = typename BoundArgVariant<Args::All>::Type

One bound argument. std::monostate is an optional argument the caller omitted.

Definition at line 177 of file Args.hpp.

◆ ByteHistogram

using VoltMod::ByteHistogram = std::array<size_t, 256>

How often each byte value occurs in the memory being searched.

Definition at line 29 of file BytePattern.hpp.

◆ EmitSoundFilterFn

Initial value:
StartSoundEventInfo (*)(IRecipientFilter& filter, CEntityIndex sourceIndex,
const EmitSound_t& params)

Definition at line 42 of file Entity.cpp.

◆ GameDataLookup

using VoltMod::GameDataLookup = std::function<GameDataLocation(GameDataSection sections, std::string_view name)>

Reads what gamedata holds for name, when sections admits the section holding it.

Injected so Bindings::Bind is unit-tested against a plain lambda; the app passes the host's lookup.

Definition at line 15 of file GameDataLookup.hpp.

◆ HandleVector

using VoltMod::HandleVector = CNetworkUtlVectorBase<CEntityHandle>

Definition at line 19 of file Visibility.cpp.

◆ HasDefault

using VoltMod::HasDefault = std::true_type

HasDefault argument of VOLTMOD_COLUMN: the insert may leave this column out.

Definition at line 10 of file Table.hpp.

◆ HostStartFn

using VoltMod::HostStartFn = bool (*)(const LoaderHandoff* start, char* error, size_t errorSize)

Start the host. On false, it wrote why into error, which holds errorSize bytes.

Definition at line 22 of file LoaderHandoff.hpp.

◆ HostStopFn

using VoltMod::HostStopFn = void (*)()

Unload every plugin and remove the host's hooks.

Definition at line 24 of file LoaderHandoff.hpp.

◆ HttpCompletion

using VoltMod::HttpCompletion = std::function<void(const HttpResult&)>

Definition at line 21 of file HttpResult.hpp.

◆ HttpHeaders

using VoltMod::HttpHeaders = std::map<std::string, std::string, HeaderNameLess>

Header name -> value; Content-Type and content-type are one entry.

Definition at line 39 of file HttpClient.hpp.

◆ InterfaceFactory

using VoltMod::InterfaceFactory = void* (*)(const char* name, int* returnCode)

A module's exported CreateInterface.

Definition at line 10 of file LoaderHandoff.hpp.

◆ MariaDbConnection

using VoltMod::MariaDbConnection = sqlpp::mysql::connection

Definition at line 20 of file Connection.hpp.

◆ OriginalSlotLookup

using VoltMod::OriginalSlotLookup = std::function<const void*(void** vtable, int index)>

Reads the value that vtable's index held before a hook patched it, or nullptr. An empty lookup reads the current slot. The injected lookup keeps vtable searches SDK-free; the default implementation is ReadOriginalSlot in Detours.hpp.

Definition at line 13 of file OriginalSlotLookup.hpp.

◆ PairCooldown

template<class TFirst, class TSecond>
using VoltMod::PairCooldown = Cooldown<std::pair<TFirst, TSecond>, std::map<std::pair<TFirst, TSecond>, int64_t>>

std::pair has no std::hash, so pair keys use an ordered map.

Definition at line 76 of file Cooldown.hpp.

◆ PluginsByName

using VoltMod::PluginsByName = std::map<std::string, const PluginManifest*, std::less<>>

Definition at line 15 of file PluginDependencies.cpp.

◆ PostEvent

Initial value:
void (IGameEventSystem::*)(CSplitScreenSlot, bool, int, const uint64*, NetMessageInfo_t*,
const CNetMessage*, unsigned long, NetChannelBufType_t)

Definition at line 12 of file TextMessages.cpp.

◆ PostgresConnection

using VoltMod::PostgresConnection = sqlpp::postgresql::connection

Definition at line 19 of file Connection.hpp.

◆ PostgresSslMode

using VoltMod::PostgresSslMode = sqlpp::postgresql::connection_config::sslmode_t

Definition at line 15 of file OpenConnection.cpp.

◆ QAngle

using VoltMod::QAngle = ::QAngle

The engine's angles in degrees: (pitch, yaw, roll), positive pitch looks down.

Definition at line 15 of file Math.hpp.

◆ RefusalsByName

using VoltMod::RefusalsByName = std::map<std::string, Error, std::less<>>

Definition at line 16 of file PluginDependencies.cpp.

◆ Required

using VoltMod::Required = std::false_type

HasDefault argument of VOLTMOD_COLUMN: every insert must supply this column.

Definition at line 13 of file Table.hpp.

◆ Result

template<class T>
using VoltMod::Result = std::expected<T, Error>

A T or an Error. Check with if (result), read *result / result.error().

Definition at line 64 of file Result.hpp.

◆ ScriptBindingLookup

using VoltMod::ScriptBindingLookup = std::function<Result<ScriptTarget>(void* classTable, std::string_view name)>

Finds VScript binding name on the class with vtable classTable or on its bases. Injected so the resolver stays SDK-free.

Definition at line 19 of file ScriptBindings.hpp.

◆ SqliteConnection

using VoltMod::SqliteConnection = sqlpp::sqlite3::connection

Definition at line 21 of file Connection.hpp.

◆ Status

using VoltMod::Status = std::expected<void, Error>

A Result with nothing to return. return {}; succeeds.

Definition at line 67 of file Result.hpp.

◆ StringMap

template<class Value>
using VoltMod::StringMap = std::unordered_map<std::string, Value, StringHash, std::equal_to<>>

A string-keyed map that finds a std::string_view key without building a string.

Definition at line 21 of file StringMap.hpp.

◆ StringTable

using VoltMod::StringTable = CNetworkUtlVectorBase<CUtlString>

Definition at line 14 of file ScreenEntitySetters.cpp.

◆ Tokens

using VoltMod::Tokens = std::map<std::string, std::string>

{token} -> replacement, for Strings::SubstituteTokens and the text built on it.

Definition at line 14 of file Strings.hpp.

◆ Vector

using VoltMod::Vector = ::Vector

The engine's Vector. Its default constructor leaves the value uninitialised; write Vector{0.0f, 0.0f, 0.0f} for a zero.

Definition at line 12 of file Math.hpp.

Enumeration Type Documentation

◆ AddonAction

enum class VoltMod::AddonAction
strong

What the hook does to one outgoing join message.

Enumerator
Unchanged 

send the message as it is

Send 

point the client at AddonDecision::Id and wait for its reconnect

TrimToFirst 

the message names several addons; keep only AddonDecision::Id

Kick 

the client refused AddonDecision::Id too often

KeepMounted 

a map change names no addon; name AddonDecision::Id so the client keeps it

Definition at line 14 of file DownloadQueue.hpp.

◆ ArgKind

enum class VoltMod::ArgKind : uint8_t
strong

Which binder runs for one declared argument.

Derived from the handler's parameter list; plugins never write one. The enumerator name is also the suffix of the argument's usage-placeholder key (ArgKind::Target -> cmd.usage.target), so adding a kind adds one translation key and no switch.

Declaration order is the order of Args::All and of BoundArg's alternatives; a static_assert below holds the three together.

Enumerator
Target 
Targets 
Duration 
SteamId 
PlayerOrSteamId 
Int 
U64 
Word 
Rest 

Definition at line 29 of file Args.hpp.

◆ ChoiceApply

enum class VoltMod::ChoiceApply
strong

When a ChoiceRow runs its Commit.

Enumerator
AfterStep 

About 400 ms after the last step, so a burst of presses applies once.

OnActivate 

Only on E or a click; stepping just changes what the row shows.

Definition at line 64 of file MenuBuilder.hpp.

◆ ClientConVarStatus

enum class VoltMod::ClientConVarStatus
strong

How the client answered a convar query (CCLCMsg_RespondCvarValue::status_code).

Enumerator
Answered 

The client reported the convar's current value.

NotFound 

The client has no convar by that name.

NotAConVar 

The name exists on the client but is a command, not a convar.

Protected 

The convar is marked protected; the client withholds its value.

Definition at line 19 of file ClientConVars.hpp.

◆ CommandAccess

enum class VoltMod::CommandAccess : uint8_t
strong

Who may run a command, and so where it can be typed.

Enumerator
Chat 

Players, from chat. The default.

Players 

Players, from chat or their own console, so they can bind it to a key. The server cannot run it.

PlayersAndServer 

Players from chat or their own console, and the server from its console, rcon and cfg files.

ServerOnly 

The server only, from its console, rcon and cfg files. Players are ignored.

Definition at line 75 of file CommandBuilder.hpp.

◆ ConVarType

enum class VoltMod::ConVarType : int16_t
strong

SDK-free mirror of EConVarType used by handle validation and console parsing. ConVar.cpp verifies every value against the SDK with static_asserts.

Enumerator
Invalid 
Bool 
Int16 
UInt16 
Int32 
UInt32 
Int64 
UInt64 
Float32 
Float64 
String 
Color 
Vector2 
Vector3 
Vector4 
QAngle 
VectorWS 

Definition at line 13 of file ConVarTypes.hpp.

◆ Driver

enum class VoltMod::Driver
strong

Database backend selected at runtime by DatabaseConfig::driver.

Enumerator
Postgres 
MariaDb 
Sqlite 

Definition at line 13 of file Driver.hpp.

◆ ErrorCode

enum class VoltMod::ErrorCode : uint8_t
strong

Why an operation did not produce a value.

Coarse on purpose: the code is what a caller branches on, Error::Detail is what a log line says. Adding a code is an API change for every switch over it, so prefer a better Detail.

Enumerator
NotFound 

The named thing does not exist (no such player, convar, row).

NotReady 

It exists but the subsystem behind it is not usable yet.

Invalid 

The caller's input does not parse or does not satisfy a precondition.

Denied 

The caller lacks the permission the operation requires.

Immune 

The target outranks the caller; a Denied that names the target, not the verb.

Unsupported 

The build, the game version, or the gamedata does not offer this at all.

Engine 

The engine or SDK refused, returned nothing, or is not where it was expected.

Failed 

Anything else; the default so a value-initialized Error is never a false success.

Definition at line 21 of file Result.hpp.

◆ GameDataSection

enum class VoltMod::GameDataSection : uint32_t
strong

The sections of gamedata.jsonc, as flags: an address binds from a function or a global.

Enumerator
Function 
Global 
VTable 
Offset 

Definition at line 10 of file GameDataLocation.hpp.

◆ HitGroup

enum class VoltMod::HitGroup : int
strong

The body part a bullet hit. Damage with no bullet, such as fire, the bomb or a fall, is Invalid.

Enumerator
Invalid 
Generic 
Head 
Chest 
Stomach 
LeftArm 
RightArm 
LeftLeg 
RightLeg 
Neck 

Definition at line 8 of file HitGroup.hpp.

◆ HookAction

enum class VoltMod::HookAction : uint8_t
strong

What a before-handler decides should happen to the call it intercepted.

Enumerator
Allow 

Let the engine's own handler run and keep its return value.

Replace 

Let it run, but return this value instead of its own.

Block 

Skip it entirely and return this value.

Definition at line 11 of file HookResult.hpp.

◆ HttpMethod

enum class VoltMod::HttpMethod
strong
Enumerator
Get 
Post 
Put 
Patch 
Delete 

Definition at line 15 of file HttpClient.hpp.

◆ LogLevel

enum class VoltMod::LogLevel : uint8_t
strong
Enumerator
Info 
Warn 
Error 

Definition at line 12 of file Log.hpp.

◆ MenuButtonKind

enum class VoltMod::MenuButtonKind
strong

What a pressed button on the menu stands for.

Enumerator
Cancel 
Back 
Close 
PreviousPage 
NextPage 
Tab 
Row 
StepDown 
StepUp 

Definition at line 18 of file PanoramaMenuLayout.hpp.

◆ MenuRowKind

enum class VoltMod::MenuRowKind
strong

Row type used by renderers.

Enumerator
Text 

Not selectable; a caption or a summary line.

Button 

Runs something.

Submenu 

Opens another menu.

Toggle 

Carries an on/off value.

Choice 

Carries one of several values, stepped left and right.

Input 

Carries a value the player types in chat.

Definition at line 26 of file MenuModel.hpp.

◆ MessageKind

enum class VoltMod::MessageKind
strong

Where a message renders on the client.

Enumerator
Chat 

Chat box line (color escapes honored).

Center 

Plain center-screen print.

CenterHtml 

Center HTML panel (same channel the menu system renders into).

Alert 

Top-center alert bar.

Definition at line 15 of file Messages.hpp.

◆ ObserverMode

enum class VoltMod::ObserverMode : uint8_t
strong

How a dead or spectating player's camera follows; Pawn.cpp checks the values against the SDK.

Enumerator
None 
Fixed 
InEye 
Chase 
Roaming 

Definition at line 9 of file ObserverMode.hpp.

◆ Origin

enum class VoltMod::Origin : uint8_t
strong

Which surface an invocation arrived on. The usage line's prefix and whether a permission is checked at all both follow from it.

Enumerator
Chat 
Console 

Definition at line 22 of file CommandRouter.hpp.

◆ RoundEndReason

enum class VoltMod::RoundEndReason : uint32_t
strong

Why a round ended, as the engine's CSRoundEndReason numbers it; round_end reports the same.

Enumerator
CounterTerroristsWin 
TerroristsWin 
Draw 

Definition at line 14 of file Rounds.hpp.

◆ TargetError

enum class VoltMod::TargetError
strong
Enumerator
NoMatch 
Immune 

matches existed, but the policy blocked all of them

Ambiguous 

a name fragment matched more than one player

MultiNotAllowed 

a multi-selector was used where the command takes a single target

DeadNotAllowed 
BotNotAllowed 

Definition at line 23 of file Targeting.hpp.

◆ TargetKind

enum class VoltMod::TargetKind
strong
Enumerator
All 
Me 
NotMe 
Team 

uses TargetQuery::Team

Dead 
Alive 
Bots 
Humans 
Random 
RandomTeam 

uses TargetQuery::Team

Slot 
SteamId 
Name 

Definition at line 40 of file Targeting.hpp.

◆ Team

enum class VoltMod::Team : uint8_t
strong

Engine team indices, as m_iTeamNum holds them. SDK-free so command parsing can share them.

Enumerator
None 
Spectator 
T 
CT 

Definition at line 9 of file Team.hpp.

◆ TraceLayers

enum class VoltMod::TraceLayers
strong

Which interaction layers a trace stops at.

Enumerator
Sight 

what hides one player from another

Solid 

what a player body collides with, players included

Surfaces 

every drawn surface and the sky; no player clips or players

Definition at line 15 of file Trace.hpp.

◆ VoteEndReason

enum class VoltMod::VoteEndReason
strong

Why a vote stopped taking ballots.

Enumerator
AllVoted 

every eligible player cast a ballot

TimeUp 
Cancelled 

an admin (or a peer feature) called it off

Definition at line 23 of file Vote.hpp.

◆ WriteKind

enum class VoltMod::WriteKind
strong

Keeps a text and a class of the same name on the same element apart.

Enumerator
Text 
Class 

Definition at line 14 of file WriteCache.hpp.

Function Documentation

◆ AddHandleVector()

void VoltMod::AddHandleVector ( EntitySystem & entities,
HiddenPlayer & player,
const void * vector )
static

◆ AddIndex()

void VoltMod::AddIndex ( HiddenPlayer & player,
int index )
static

◆ AddonList()

CUtlString * VoltMod::AddonList ( CNetworkGameServerBase & server)
static

The server's addon list, or nullptr when the SDK layout misses the string GetAddonName returns.

Definition at line 144 of file WorkshopDownloads.cpp.

References VoltMod::Log::Error().

◆ AdmitClient()

HookResult< bool > VoltMod::AdmitClient ( PluginRegistry & registry,
int slot,
uint64_t xuid,
std::string_view name,
CBufferString * rejectReason )
static

Ask the plugins about a joining client, and refuse it with the first reason one gives.

Definition at line 42 of file EngineHooks.cpp.

References VoltMod::HookResult< Ret >::Block(), and VoltMod::PluginRegistry::RaiseClientConnecting().

Referenced by VoltMod::EngineHooks::EngineHooks().

◆ Anchor()

size_t VoltMod::Anchor ( const std::vector< PatternByte > & pattern,
const ByteHistogram & frequencies )

Index of the pattern byte to search for, or pattern.size() when it is all wildcards.

Which byte is searched for is what decides a scan's cost, because the rest of the pattern is only compared where that byte lands. The first byte - the obvious anchor - is close to the worst one for x86-64: nearly every signature opens with a REX prefix (0x48), which saturates the image. Measured over CS2's server.dll, anchoring on the rarest byte instead scans ~16x faster.

Definition at line 47 of file BytePattern.cpp.

Referenced by FindPatternEx().

◆ AngleDelta()

float VoltMod::AngleDelta ( float from,
float to )

How far to is from from in degrees, the short way round, in [-180, 180).

Definition at line 49 of file Math.cpp.

Referenced by TurnToward().

◆ AngleTo()

QAngle VoltMod::AngleTo ( const Vector & from,
const Vector & to )

The angles that aim from from at to, with no roll. Pitch is in [-90, 90], positive down, as the engine has it.

Definition at line 42 of file Math.cpp.

References DegreesPerRadian.

◆ AngleToAxes()

Axes VoltMod::AngleToAxes ( const QAngle & angles)

The axes of a body turned to angles.

Definition at line 27 of file Math.cpp.

References VoltMod::Axes::Forward, VoltMod::Axes::Left, and VoltMod::Axes::Up.

Referenced by OffsetLocal().

◆ AngleToForward()

Vector VoltMod::AngleToForward ( const QAngle & angles)

The unit vector angles aim along; roll does not change it.

Definition at line 9 of file Math.cpp.

Referenced by VoltMod::Pawn::EyeForward().

◆ AppendPlayerRows()

void VoltMod::AppendPlayerRows ( MenuBuilder & builder,
PlayerManager & players,
const PlayerPicker & spec )

◆ AppendToAddonList()

std::vector< uint64_t > VoltMod::AppendToAddonList ( std::string & field,
const std::vector< uint64_t > & ids )

Append each of ids that field lacks. Returns the ids appended.

Definition at line 239 of file DownloadQueue.cpp.

References ParseAddonList().

◆ ApplyMigration()

template<class Conn>
void VoltMod::ApplyMigration ( Conn & conn,
const std::string & table,
const Migration & migration,
const std::vector< std::string > & statements )
static

Definition at line 45 of file Migrator.cpp.

References VoltMod::Migration::Name, VoltMod::Time::Now(), and VoltMod::Migration::Version.

Referenced by RunMigrations().

◆ ArgKindsMatchOrder()

template<std::size_t... I>
bool VoltMod::ArgKindsMatchOrder ( std::index_sequence< I... > )
consteval

Whether every type in Args::All sits at the index its own ArgKind names.

Definition at line 181 of file Args.hpp.

◆ AtRva()

const uint8_t * VoltMod::AtRva ( const PeRtti & rtti,
int64_t rva,
size_t bytes )
static

Definition at line 62 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti(), and TypeDescriptorMatches().

◆ BaseCount()

uint32_t VoltMod::BaseCount ( uintptr_t typeInfo,
const TypeInfoKinds & kinds )
static

◆ BaseName() [1/2]

std::string_view VoltMod::BaseName ( std::string_view path)
static

Definition at line 13 of file Image.linux.cpp.

Referenced by DlIterateCallback().

◆ BaseName() [2/2]

std::string_view VoltMod::BaseName ( std::string_view path)
static

Definition at line 15 of file Image.windows.cpp.

◆ BindArgs()

std::expected< std::vector< BoundArg >, ArgError > VoltMod::BindArgs ( const CommandDefinition & def,
std::span< const std::string > tokens,
Player * caller,
ArgBinder & binder )

Bind tokens against def's argument descriptor.

Arity is the caller's job: this assumes tokens already satisfies def's required count, so a short list can only mean a trailing optional argument. Takes nothing from the router, which is why it is a free function - the descriptor and the binder are the whole input.

Definition at line 133 of file ArgBinding.cpp.

References VoltMod::CommandDefinition::Args, BindDuration(), BindInt(), BindPlayerOrSteamId(), BindSteamId(), BindTarget(), BindTargets(), BindU64(), Duration, Int, VoltMod::Strings::Join(), VoltMod::ArgDesc::Kind, PlayerOrSteamId, Rest, Store(), Target, Targets, U64, and Word.

Referenced by VoltMod::CommandRouter::Dispatch().

◆ BindDuration()

std::expected< Args::Duration, ArgError > VoltMod::BindDuration ( const std::string & token)
static

Definition at line 78 of file ArgBinding.cpp.

References VoltMod::Strings::IsNumeric(), and ParseDuration().

Referenced by BindArgs().

◆ BindInt()

std::expected< Args::Int, ArgError > VoltMod::BindInt ( const std::string & token)
static

Definition at line 101 of file ArgBinding.cpp.

References ParseInt64().

Referenced by BindArgs().

◆ BindPlayerOrSteamId()

std::expected< Args::PlayerOrSteamId, ArgError > VoltMod::BindPlayerOrSteamId ( ArgBinder & binder,
const std::string & token,
Player * caller )
static

One token to a player if anybody online answers to it, otherwise to a bare SteamID64.

The fallback is only for NoMatch: falling back on Immune would turn a refused target into an offline one and act on it anyway, and on Ambiguous it would pick nobody's id.

Definition at line 57 of file ArgBinding.cpp.

References VoltMod::Strings::IsNumeric(), NoMatch, ParseInt64(), VoltMod::ArgBinder::Resolve(), VoltMod::Player::SteamId(), and TargetKey().

Referenced by BindArgs().

◆ BindSteamId()

std::expected< Args::SteamId, ArgError > VoltMod::BindSteamId ( const std::string & token)
static

Definition at line 91 of file ArgBinding.cpp.

References VoltMod::Strings::IsNumeric(), and ParseInt64().

Referenced by BindArgs().

◆ BindTarget()

std::expected< Args::Target, ArgError > VoltMod::BindTarget ( ArgBinder & binder,
const std::string & token,
Player * caller )
static

One token to the single player it names, or the key explaining why it named none.

Definition at line 30 of file ArgBinding.cpp.

References VoltMod::ArgBinder::Resolve(), and TargetKey().

Referenced by BindArgs().

◆ BindTargets()

std::expected< Args::Targets, ArgError > VoltMod::BindTargets ( ArgBinder & binder,
const std::string & token,
Player * caller )
static

One token to every player it names. AllowMultiple is what separates this from BindTarget.

Definition at line 41 of file ArgBinding.cpp.

References VoltMod::ArgBinder::Resolve(), and TargetKey().

Referenced by BindArgs().

◆ BindU64()

std::expected< Args::U64, ArgError > VoltMod::BindU64 ( const std::string & token)
static

Definition at line 111 of file ArgBinding.cpp.

References ParseUInt64().

Referenced by BindArgs().

◆ BuildConfirmMenu()

◆ BuildDurationMenu()

std::shared_ptr< Menu > VoltMod::BuildDurationMenu ( DurationMenu spec)

Builds a duration menu. Invalid text prompts again.

Definition at line 24 of file MenuPresets.cpp.

References VoltMod::MenuBuilder::Button(), VoltMod::DurationMenu::Pick, VoltMod::DurationMenu::Presets, and VoltMod::DurationMenu::Title.

Referenced by VoltMod::Flow< TState >::AddDurationStep().

◆ BuildPlayerPicker()

std::shared_ptr< Menu > VoltMod::BuildPlayerPicker ( PlayerManager & players,
PlayerPicker spec )

Builds a menu containing only the AppendPlayerRows list.

Definition at line 47 of file PlayerRows.cpp.

References AppendPlayerRows(), VoltMod::MenuBuilder::Build(), and VoltMod::PlayerPicker::Title.

◆ CallOriginal()

template<class Iface, class Ret, class... Args, class... Passed>
Ret VoltMod::CallOriginal ( Ret(Iface::* method )(Args...),
Iface * instance,
Passed &&... args )

The engine's own implementation of method, bypassing every hook on the slot.

Definition at line 250 of file Hook.hpp.

Referenced by FilterListening().

◆ CheckConfig()

Result< Driver > VoltMod::CheckConfig ( const DatabaseConfig & config)

◆ ClassAndStructNames()

std::array< std::string, 2 > VoltMod::ClassAndStructNames ( std::string_view name)
static

Definition at line 71 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti(), and FindTypeDescriptor().

◆ ClassValue()

std::string_view VoltMod::ClassValue ( bool on)
static

The value a class write is cached under.

Definition at line 10 of file WriteCache.cpp.

Referenced by VoltMod::WriteCache::ClassChanged(), and VoltMod::WriteCache::IsClassOn().

◆ ClientAddress()

std::string_view VoltMod::ClientAddress ( IVEngineServer2 * server,
CPlayerSlot slot )
static

A client's address, or empty for a bot, which has no net channel.

Definition at line 58 of file EngineHooks.cpp.

References Text().

Referenced by VoltMod::EngineHooks::EngineHooks().

◆ CloseLibrary()

void VoltMod::CloseLibrary ( void * handle)
static

Definition at line 60 of file SharedLibrary.cpp.

◆ CollectBases()

void VoltMod::CollectBases ( uintptr_t typeInfo,
std::string_view wanted,
FoundBase at,
const TypeInfoKinds & kinds,
int depth,
std::vector< FoundBase > & found )
static

◆ CollectHiddenPlayer()

◆ ColumnValue()

template<class TEntry>
Result< int > VoltMod::ColumnValue ( const TEntry & entry,
std::string_view what )
static

A non-negative number from this platform's column, or why there is none.

Definition at line 50 of file GameDataScanner.cpp.

References PlatformColumn(), PlatformName, and Unbound().

◆ ConVars::Find< std::string >()

template Result< ConVar< std::string > > VoltMod::ConVars::Find< std::string > ( std::string_view )

◆ ConVarText()

template<class T>
std::string VoltMod::ConVarText ( const T & value)

Console and network text for a supported convar value. Bools use 1 and 0 for clients.

Referenced by VoltMod::ConVar< T >::SendTo(), VoltMod::ConVar< T >::Set(), and VoltMod::ConVarOverrides::Set().

◆ ConVarText< bool >() [1/2]

template<>
std::string VoltMod::ConVarText< bool > ( const bool & value)

Definition at line 42 of file ConVarTypes.cpp.

◆ ConVarText< bool >() [2/2]

template<>
std::string VoltMod::ConVarText< bool > ( const bool & value)

Definition at line 42 of file ConVarTypes.cpp.

◆ ConVarText< float >() [1/2]

template<>
std::string VoltMod::ConVarText< float > ( const float & value)

Definition at line 54 of file ConVarTypes.cpp.

◆ ConVarText< float >() [2/2]

template<>
std::string VoltMod::ConVarText< float > ( const float & value)

Definition at line 54 of file ConVarTypes.cpp.

◆ ConVarText< int >() [1/2]

template<>
std::string VoltMod::ConVarText< int > ( const int & value)

Definition at line 48 of file ConVarTypes.cpp.

◆ ConVarText< int >() [2/2]

template<>
std::string VoltMod::ConVarText< int > ( const int & value)

Definition at line 48 of file ConVarTypes.cpp.

◆ ConVarText< std::string >() [1/2]

template<>
std::string VoltMod::ConVarText< std::string > ( const std::string & value)

Definition at line 60 of file ConVarTypes.cpp.

◆ ConVarText< std::string >() [2/2]

template<>
std::string VoltMod::ConVarText< std::string > ( const std::string & value)

Definition at line 60 of file ConVarTypes.cpp.

◆ ConVarTypeMatches()

template<class T>
bool VoltMod::ConVarTypeMatches ( ConVarType type)

Whether a handle for T can access engine kind type.

All integer kinds use int; the engine accessor preserves their storage width. Bool remains a separate kind because accepting an int handle for it silently drops writes.

Definition at line 12 of file ConVarTypes.cpp.

References Bool, Float32, Int16, Int32, String, and UInt16.

Referenced by VoltMod::ConVars::Find().

◆ ConVarTypeMatches< bool >()

template bool VoltMod::ConVarTypeMatches< bool > ( ConVarType )

◆ ConVarTypeMatches< float >()

template bool VoltMod::ConVarTypeMatches< float > ( ConVarType )

◆ ConVarTypeMatches< int >()

template bool VoltMod::ConVarTypeMatches< int > ( ConVarType )

◆ ConVarTypeMatches< std::string >()

template bool VoltMod::ConVarTypeMatches< std::string > ( ConVarType )

◆ CountBytes()

void VoltMod::CountBytes ( const uint8_t * base,
size_t size,
ByteHistogram & counts )

Add the byte values in [base, base + size) to counts.

Definition at line 39 of file BytePattern.cpp.

Referenced by Frequencies().

◆ DescribeArgs()

template<class... A>
std::vector< ArgDesc > VoltMod::DescribeArgs ( )

The descriptor the router binds against, derived from the handler's parameter list.

Definition at line 280 of file Args.hpp.

◆ DescribeRow()

std::function< MenuRow(int)> VoltMod::DescribeRow ( std::string label,
MenuRowKind kind,
EnabledCondition enabled,
std::function< void(int slot, MenuRow &row)> live = {} )
static

◆ DlIterateCallback()

int VoltMod::DlIterateCallback ( struct dl_phdr_info * info,
size_t ,
void * data )
static

Definition at line 29 of file Image.linux.cpp.

References BaseName().

Referenced by FindModuleAndRanges().

◆ DriverName()

std::string VoltMod::DriverName ( Driver driver)
inline

The config spelling of driver; also the per-dialect migrations folder name.

Definition at line 27 of file Driver.hpp.

References Name(), and VoltMod::Strings::ToLower().

◆ End()

const uint8_t * VoltMod::End ( const ScanRange & range)
static

◆ EnsureColorPrefix()

std::string VoltMod::EnsureColorPrefix ( std::string_view message)
static

Definition at line 24 of file Messages.cpp.

References VoltMod::ChatColors::Default.

Referenced by Render().

◆ EnumIndex()

template<class E>
std::size_t VoltMod::EnumIndex ( E value)
constexprnoexcept

Position of value in E's declaration order, for indexing a per-enumerator array.

Definition at line 57 of file EnumNames.hpp.

References EnumCount.

◆ EnumValues()

template<class E>
auto VoltMod::EnumValues ( )
constexprnoexcept

Every enumerator of E, in declaration order.

Definition at line 64 of file EnumNames.hpp.

◆ ExportedTypeInfoKinds()

const TypeInfoKinds & VoltMod::ExportedTypeInfoKinds ( )
static

The cxxabi typeinfo vptrs exported by this process, cached for its lifetime.

Definition at line 157 of file VtableLookup.linux.cpp.

References VoltMod::TypeInfoKinds::MultipleBases, and VoltMod::TypeInfoKinds::SingleBase.

Referenced by FindBaseIn().

◆ FactoryAt()

InterfaceFactory VoltMod::FactoryAt ( const void * address)

CreateInterface of the loaded module whose image holds address.

Definition at line 34 of file Loader.linux.cpp.

Referenced by Patch().

◆ FailureLine()

std::string VoltMod::FailureLine ( const Error & error,
const Translations & translations,
int slot )
static

The line a failed handler replies with: its own localized line, else its key, else the log text.

Definition at line 16 of file CommandRouter.cpp.

References VoltMod::Error::Detail, VoltMod::Translations::Get(), VoltMod::Error::Key, and VoltMod::Error::Text.

Referenced by VoltMod::CommandRouter::Dispatch().

◆ FilterListening()

HookResult< bool > VoltMod::FilterListening ( Event< VoiceListen & > & before,
IVEngineServer2 & engine,
CPlayerSlot receiver,
CPlayerSlot sender,
bool listen )
static

◆ FilterPlayers()

std::expected< std::vector< int >, TargetFailure > VoltMod::FilterPlayers ( std::span< const PlayerView > players,
const TargetQuery & query,
const TargetRules & rules,
int callerSlot,
const std::function< std::size_t(std::size_t)> & randomIndex = {} )

◆ FilterTextMessage()

HookResult< void > VoltMod::FilterTextMessage ( Event< TextMessage & > & before,
NetMessageInfo_t * kind,
const CNetMessage * data )
static

◆ Find()

template<class Iface>
Status VoltMod::Find ( Iface *& target,
InterfaceFactory factory,
const char * version )
static

Naming the version is the point: a game update is what breaks one.

Definition at line 19 of file EngineInterfaces.cpp.

References VoltMod::Error::Engine().

Referenced by FindOptional(), and ResolveEngineInterfaces().

◆ FindBaseIn()

Result< BaseSubobject > VoltMod::FindBaseIn ( const Image & module,
std::string_view className,
std::string_view baseName )

Find base baseName inside className in module through RTTI.

Returns
NotFound when either class is missing, Invalid when the base is in the class more than once, Unsupported for a virtual base. Table is null when the base has no vtable.

Definition at line 173 of file VtableLookup.linux.cpp.

References ExportedTypeInfoKinds(), FindBaseOffsetByTypeInfo(), FindRanges(), FindVirtualTableByTypeInfo(), FindVirtualTableIn(), VoltMod::Error::NotFound(), and NotFound.

Referenced by VoltMod::ModuleSymbols::Base(), and Rtti().

◆ FindBaseInRtti()

◆ FindBaseOffsetByTypeInfo()

Result< int > VoltMod::FindBaseOffsetByTypeInfo ( const void * typeInfo,
std::string_view baseName,
const TypeInfoKinds & kinds )

Find baseName in the class described by Itanium typeInfo. Uses the same NotFound, Invalid, and Unsupported errors as FindBaseIn.

Definition at line 233 of file VtableLookup.cpp.

References CollectBases(), VoltMod::Error::Invalid(), LengthPrefixedName(), LooksLikeTypeInfo(), VoltMod::Error::NotFound(), and VoltMod::Error::Unsupported().

Referenced by FindBaseIn().

◆ FindBinding()

const ScriptFunctionBinding_t * VoltMod::FindBinding ( const ScriptClassDesc_t * description,
std::string_view name )
static

Definition at line 15 of file ScriptBindings.cpp.

Referenced by FindScriptBinding().

◆ FindExport()

void * VoltMod::FindExport ( void * handle,
const char * name )
static

Definition at line 55 of file SharedLibrary.cpp.

Referenced by StartHost(), and VoltMod::SharedLibrary::Symbol().

◆ FindFirst()

const uint8_t * VoltMod::FindFirst ( const uint8_t * base,
size_t size,
const std::vector< PatternByte > & pattern,
size_t anchor )

First match of pattern in [base, base + size), searched for by its anchor byte.

Parameters
anchorfrom Anchor, against the frequencies of the memory being searched. Any index of a non-wildcard byte gives the same answer; only the speed differs.
Returns
the match, or nullptr.

Definition at line 80 of file BytePattern.cpp.

References Matches().

Referenced by FindPatternEx().

◆ FindImage()

bool VoltMod::FindImage ( std::string_view moduleName,
Image & module )

Definition at line 58 of file SigScanner.cpp.

References FindModuleAndRanges(), and PlatformModuleName().

Referenced by FindVirtualTable(), and VoltMod::ModuleSymbols::Module().

◆ FindLocator()

const uint8_t * VoltMod::FindLocator ( const PeRtti & rtti,
uint32_t typeDescriptor,
uint32_t offset )
static

◆ FindModuleAndRanges()

bool VoltMod::FindModuleAndRanges ( std::string_view fileName,
Image & module,
std::vector< ScanRange > & ranges )

Locate the exact platform fileName and populate its mapping and readable scan ranges.

Windows returns the mapped image as one range. Linux returns individual PT_LOAD segments because the full module span may contain unmapped gaps.

Returns
false when the module is not loaded. Both outputs remain unchanged.

Definition at line 61 of file Image.linux.cpp.

References DlIterateCallback(), and VoltMod::ModuleScan::Ranges.

Referenced by FindImage(), FindPatternEx(), and FindRanges().

◆ FindNextFactory()

InterfaceFactory VoltMod::FindNextFactory ( )
static

Definition at line 109 of file Loader.cpp.

References LoadNextServer().

Referenced by CreateInterface().

◆ FindOptional()

template<class Iface>
void VoltMod::FindOptional ( Iface *& target,
InterfaceFactory factory,
const char * version )
static

Definition at line 30 of file EngineInterfaces.cpp.

References VoltMod::Log::Error(), and Find().

Referenced by ResolveEngineInterfaces().

◆ FindPatternEx()

ScanResult VoltMod::FindPatternEx ( std::string_view moduleName,
const std::string & pattern )

Scan a loaded module for a byte pattern with ? wildcards. Address holds the first match, while Unique reports whether it is safe to bind.

Definition at line 64 of file SigScanner.cpp.

References Anchor(), VoltMod::Log::Error(), FindFirst(), FindModuleAndRanges(), Frequencies(), ParsePattern(), PlatformModuleName(), and VoltMod::Log::Warn().

Referenced by Scan().

◆ FindRanges()

bool VoltMod::FindRanges ( const Image & module,
std::vector< ScanRange > & ranges )
static

Definition at line 122 of file VtableLookup.linux.cpp.

References FindModuleAndRanges(), and VoltMod::Image::Path.

Referenced by FindBaseIn(), and FindVirtualTableIn().

◆ FindScriptBinding()

Result< ScriptTarget > VoltMod::FindScriptBinding ( void * classTable,
std::string_view name )

The ScriptBindingLookup the host uses.

Definition at line 64 of file ScriptBindings.cpp.

References FindBinding(), VoltMod::Error::NotFound(), and VirtualIndex().

Referenced by VoltMod::Host::Start().

◆ FindSection()

ScanRange VoltMod::FindSection ( const Image & module,
std::string_view name )
static

Definition at line 205 of file VtableLookup.windows.cpp.

References VoltMod::Image::Size.

◆ FindSymbolValue()

uint64_t VoltMod::FindSymbolValue ( const MappedFile & elf,
const std::string & symbol )
static

Definition at line 72 of file VtableLookup.linux.cpp.

References VoltMod::MappedFile::At().

Referenced by FindVirtualTableIn().

◆ FindTypeDescriptor()

uint32_t VoltMod::FindTypeDescriptor ( const PeRtti & rtti,
std::string_view className )
static

Definition at line 76 of file VtableLookup.windows.cpp.

References ClassAndStructNames(), End(), FindValue(), and TypeDescriptorName.

Referenced by PrimaryLocator().

◆ FindValue()

const uint8_t * VoltMod::FindValue ( const uint8_t * begin,
const uint8_t * end,
const void * needle,
size_t len,
size_t stride )
static

Definition at line 32 of file VtableLookup.windows.cpp.

Referenced by FindLocator(), FindTypeDescriptor(), and TableAfter().

◆ FindVirtualTable()

void * VoltMod::FindVirtualTable ( std::string_view moduleName,
std::string_view className )

Find className's primary vtable in loaded moduleName, or nullptr. It uses compiler metadata: MSVC RTTI on Windows (top-level, non-template classes only), and on Linux the Itanium _ZTV symbol, or the Itanium RTTI when the module hides that symbol.

Definition at line 18 of file VtableLookup.cpp.

References FindImage(), FindVirtualTableIn(), PlatformModuleName(), and VoltMod::Log::Warn().

Referenced by HookSessionManifest().

◆ FindVirtualTableByTypeInfo()

void * VoltMod::FindVirtualTableByTypeInfo ( std::span< const ScanRange > ranges,
const void * typeInfo,
intptr_t offsetToTop )

Find the single vtable with typeInfo and offsetToTop whose first slot holds code. Returns nullptr when no candidate exists or the metadata is ambiguous.

Definition at line 260 of file VtableLookup.cpp.

References FindWords(), IsExecutableAddress(), and ReadWord().

Referenced by FindBaseIn().

◆ FindVirtualTableByTypeName()

void * VoltMod::FindVirtualTableByTypeName ( std::span< const ScanRange > ranges,
std::string_view className )

Definition at line 77 of file VtableLookup.cpp.

References FindWords(), IsExecutableAddress(), LengthPrefixedName(), and ReadWord().

Referenced by FindVirtualTableIn().

◆ FindVirtualTableIn()

void * VoltMod::FindVirtualTableIn ( const Image & module,
std::string_view className )

◆ FindVirtualTableInRtti()

void * VoltMod::FindVirtualTableInRtti ( const PeRtti & rtti,
std::string_view className )

Definition at line 139 of file VtableLookup.windows.cpp.

References PrimaryLocator(), and TableAfter().

Referenced by Rtti().

◆ FindWords()

std::vector< uintptr_t > VoltMod::FindWords ( std::span< const ScanRange > ranges,
uintptr_t value )
static

Definition at line 54 of file VtableLookup.cpp.

References ReadWord().

Referenced by FindVirtualTableByTypeInfo(), and FindVirtualTableByTypeName().

◆ FireInput()

void VoltMod::FireInput ( const Bindings & bindings,
CEntityInstance * entity,
std::string_view input,
variant_t & value,
CEntityInstance * activator )
static

◆ FlattenInto()

void VoltMod::FlattenInto ( const glz::generic & node,
const std::string & prefix,
StringMap< std::string > & out )
static

Definition at line 15 of file Translations.cpp.

References FlattenInto().

Referenced by FlattenInto(), and VoltMod::Translations::Load().

◆ FooterChunk()

std::string VoltMod::FooterChunk ( std::string_view keyColor,
std::string_view keyText,
const std::string & label )
static

Definition at line 45 of file CenterHtmlRender.cpp.

References VoltMod::Palette::TextMuted.

Referenced by RenderFooter().

◆ Frequencies()

const ByteHistogram & VoltMod::Frequencies ( const Image & module,
const std::vector< ScanRange > & ranges )
static

Byte frequencies are stable for a mapped module, so cache them by base address. Count explicit scan ranges because a Linux module's overall span may include unmapped gaps.

Definition at line 30 of file SigScanner.cpp.

References VoltMod::Image::Base, and CountBytes().

Referenced by FindPatternEx().

◆ GameBuild()

std::string_view VoltMod::GameBuild ( )

steam.inf's ServerVersion, or "unknown"; read once per process.

Definition at line 10 of file GameBuild.cpp.

References ReadAllText(), and VoltMod::Strings::Trim().

Referenced by VoltMod::GameDataScanner::LogSummary(), WriteGameDataRecord(), and VoltMod::Schema::WriteSchemaDump().

◆ GameDir()

std::filesystem::path VoltMod::GameDir ( )
static

csgo/addons/voltmod/bin/<platform>/ holds this module, so csgo is four directories up.

Definition at line 47 of file Loader.cpp.

References OwnPath().

Referenced by LoadNextServer().

◆ GameRules()

◆ GameSearchPaths()

std::vector< std::string > VoltMod::GameSearchPaths ( std::string_view gameinfo)

The Game values under SearchPaths in a gameinfo.gi, in file order.

Other keys (Game_LowViolence, Mod...), comments, quotes and trailing conditions are dropped. The values are relative to the game directory.

Definition at line 36 of file GameSearchPaths.cpp.

References NextWord(), and SameKey().

Referenced by LoadNextServer().

◆ HasSingleBase()

bool VoltMod::HasSingleBase ( uintptr_t typeInfo,
const TypeInfoKinds & kinds )
static

◆ HasVtable()

bool VoltMod::HasVtable ( const void * object,
const void * table )

Definition at line 110 of file VtableLookup.cpp.

References IsReadableAddress(), and ReadWord().

◆ HistoryTableDdl()

std::string VoltMod::HistoryTableDdl ( const std::string & table)
static

Definition at line 38 of file Migrator.cpp.

Referenced by RunMigrations().

◆ HoldFireTick()

int VoltMod::HoldFireTick ( const Clock & clock)

The tick to hold fire until when holding it every frame: past what a client predicts, so it shows no shot or recoil, and moved in steps, so the weapon's networked ticks change once a step.

Definition at line 27 of file Pawn.cpp.

References HoldFireStep, HoldFireTicks, and VoltMod::Clock::Tick().

Referenced by VoltMod::FireHold::Hold(), and VoltMod::Pawn::HoldFire().

◆ HookFunction()

template<class Object, class Ret, class... Args, class Before, class After = std::nullptr_t>
Result< Subscription > VoltMod::HookFunction ( std::string_view name,
const Fn< Ret(Object *, Args...)> & function,
Before && before,
After && after = nullptr )
nodiscard

Hook a signature-bound function at its entry.

Use this for functions without a vtable slot. The hook affects every caller of the matched code, including callers from other classes that share it.

Parameters
nameNames the hook in the log and in any error.
functionThe binding; its first parameter is the object the function runs on.
beforeHandler invoked before the engine call, or nullptr.
afterHandler invoked after the engine call, or nullptr.

Definition at line 232 of file Hook.hpp.

References VoltMod::Log::Info(), Installed(), VoltMod::Internal::ToSubscription(), and VoltMod::Error::Unsupported().

◆ HookInterface()

template<class Iface, class Ret, class... Args, class Before, class After = std::nullptr_t>
Subscription VoltMod::HookInterface ( Ret(Iface::* method )(Args...),
Iface * instance,
Before && before,
After && after = nullptr )
nodiscard

Hook one virtual method of an engine interface for a subscription's lifetime.

Only instance is hooked, even when other objects share its vtable. Pass nullptr for an unused handler. A before-handler that only observes returns nothing.

hooks.Add(VoltMod::HookInterface(&IServerGameClients::ClientFullyConnect, gi.ServerGameClients, nullptr,
[this](IServerGameClients&, CPlayerSlot slot) { Greet(slot.Get()); }));
Subscription HookInterface(Ret(Iface::*method)(Args...), Iface *instance, Before &&before, After &&after=nullptr)
Hook one virtual method of an engine interface for a subscription's lifetime.
Definition Hook.hpp:142

Definition at line 142 of file Hook.hpp.

References Installed(), and VoltMod::Internal::ToSubscription().

Referenced by VoltMod::EngineHooks::EngineHooks().

◆ HookSessionManifest()

Result< Subscription > VoltMod::HookSessionManifest ( PluginRegistry & registry)
static

Hand every map's resource manifest to the plugins. The game rules system is in every session.

Definition at line 65 of file EngineHooks.cpp.

References FindVirtualTable(), HookVirtual(), and VoltMod::PluginRegistry::RaiseBuildGameSessionManifest().

Referenced by VoltMod::EngineHooks::EngineHooks().

◆ HookTable()

template<class Object, class Ret, class... Args, class Before, class After = std::nullptr_t>
Result< Subscription > VoltMod::HookTable ( std::string_view name,
Ret(Object::* method )(Args...),
const ClassTable & table,
Before && before,
After && after = nullptr )
nodiscard

Hook an SDK-declared virtual on every object sharing a gamedata-found class table.

The SDK declaration gives the slot, so gamedata only names the class.

Parameters
nameNames the hook in the log and in any error.
methodThe SDK declaration; the handlers receive its class as the object.
tableThe class table, from a vtables entry without an index.
beforeHandler invoked before the engine call, or nullptr.
afterHandler invoked after the engine call, or nullptr.

Definition at line 200 of file Hook.hpp.

References VoltMod::Log::Info(), Installed(), VoltMod::ClassTable::Ptr(), VoltMod::Internal::ToSubscription(), and VoltMod::Error::Unsupported().

◆ HookTeleport()

Result< Subscription > VoltMod::HookTeleport ( const Bindings & bindings,
EntitySystem & entities,
Event< int > & before )
static

◆ HookVirtual()

template<class Object, class Ret, class... Args, class Before, class After = std::nullptr_t>
Result< Subscription > VoltMod::HookVirtual ( std::string_view name,
const VirtualFn< Ret(Object *, Args...)> & function,
Before && before,
After && after = nullptr )
nodiscard

Hook a gamedata-bound virtual function on objects sharing its class vtable.

The hook catches calls through that table only, even when its slot code is shared by other classes.

Parameters
nameNames the hook in the log and in any error.
functionGamedata-resolved slot and class table. Its first parameter is the object.
beforeHandler invoked before the engine call, or nullptr.
afterHandler invoked after the engine call, or nullptr.

Definition at line 168 of file Hook.hpp.

References VoltMod::Log::Info(), Installed(), VoltMod::Internal::ToSubscription(), and VoltMod::Error::Unsupported().

Referenced by HookSessionManifest(), and HookTeleport().

◆ HudDestination()

int VoltMod::HudDestination ( MessageKind kind)
static

Definition at line 43 of file Messages.cpp.

References Alert, and Center.

Referenced by VoltMod::Messages::Broadcast(), and VoltMod::Messages::Send().

◆ Insert()

template<class Conn, class Statement>
int64_t VoltMod::Insert ( Conn & conn,
const Statement & insert,
std::string_view table,
std::string_view key = "id" )

Insert one row and return its generated id. Postgres reads the <table>_<key>_seq sequence of a SERIAL column; the other drivers report it on the insert result.

Definition at line 39 of file Connection.hpp.

References IsPostgres.

◆ Installed()

◆ IsExecutableAddress()

bool VoltMod::IsExecutableAddress ( const void * address)

Whether address lies in committed, executable memory.

This accepts hook trampolines allocated outside a module while rejecting vtable slots that point at data, such as RTTI, strings, or the tail of a shorter table.

Definition at line 174 of file SigScanner.cpp.

References QueryRegion().

Referenced by FindVirtualTableByTypeInfo(), and FindVirtualTableByTypeName().

◆ IsModelEntity()

bool VoltMod::IsModelEntity ( CEntityInstance * entity)
static

◆ IsOpen()

bool VoltMod::IsOpen ( const AnyConnection & connection)

Definition at line 109 of file OpenConnection.cpp.

◆ IsPlaying()

bool VoltMod::IsPlaying ( Team team)
constexpr

True for the two teams that play a round.

Definition at line 18 of file Team.hpp.

References CT, and T.

Referenced by VoltMod::Controller::ChangeTeam(), VoltMod::Visibility::HideFromTeam(), VoltMod::GlowVision::Refresh(), VoltMod::HiddenPlayer::Show(), and VoltMod::Visibility::ShowOnlyToTeam().

◆ IsReadableAddress()

bool VoltMod::IsReadableAddress ( const void * address,
size_t bytes )

Whether the complete span [address, address + bytes) is readable in one mapping.

Use this before dereferencing untrusted object bytes. Calling IsExecutableAddress on p[0] is already too late because evaluating p[0] performs the unsafe read.

Definition at line 185 of file SigScanner.cpp.

References QueryRegion().

Referenced by BaseCount(), HasSingleBase(), HasVtable(), LooksLikeTypeInfo(), NameIs(), and VirtualIndex().

◆ IsRowActionable()

bool VoltMod::IsRowActionable ( const MenuItem & item,
int slot )
inline

True when item is one a player may act on right now: it describes itself as both enabled and selectable. A cursor lands only on these, and only these activate.

Definition at line 128 of file MenuModel.hpp.

References VoltMod::MenuItem::Describe, VoltMod::MenuRow::Enabled, and VoltMod::MenuRow::Selectable.

Referenced by VoltMod::MenuStack::Activate(), and VoltMod::MenuCursor::Rows().

◆ IsSelectable()

bool VoltMod::IsSelectable ( const CursorRows & rows,
int index )
static

◆ IsValidSlot()

bool VoltMod::IsValidSlot ( int slot)
inlineconstexpr

True if slot is a valid player-slot index.

Definition at line 13 of file Slot.hpp.

References MaxPlayers.

Referenced by VoltMod::MenuStack::Activate(), VoltMod::PendingConVarQueries::Add(), VoltMod::PendingCommit::Apply(), VoltMod::ChatInput::BeginCapture(), VoltMod::MenuStack::Breadcrumb(), VoltMod::ChatInput::CancelCapture(), VoltMod::PanoramaMenu::CanShow(), VoltMod::MenuStack::Clear(), VoltMod::PendingConVarQueries::Clear(), VoltMod::CenterHtmlMenu::Close(), VoltMod::MenuFreeze::Close(), VoltMod::CenterHtmlMenu::CloseAll(), VoltMod::PendingConVarQueries::Count(), VoltMod::ScreenManager::Create(), VoltMod::MenuStack::Current(), VoltMod::MenuStack::Depth(), VoltMod::PendingCommit::Drop(), VoltMod::Entity::EmitSoundTo(), VoltMod::EngineHooks::EngineHooks(), VoltMod::Controller::ExecuteCommand(), VoltMod::PendingConVarQueries::Find(), VoltMod::PlayerScreens::Find(), VoltMod::PlayerScreens::For(), VoltMod::GameEvents::GetClientLegacyListener(), VoltMod::NetChannels::GetCommandStatus(), VoltMod::NetChannels::GetNetInfo(), VoltMod::ChatInput::GetPrompt(), VoltMod::NetChannels::GetUserId(), VoltMod::NetChannels::GetUserInfoCvar(), VoltMod::PendingCommit::Hold(), HookTeleport(), VoltMod::PendingCommit::Index(), VoltMod::ChatInput::IsCapturing(), VoltMod::PluginRegistry::IsConnected(), VoltMod::PlayerScreens::IsOpen(), VoltMod::Visibility::IsPawnHidden(), VoltMod::WorkshopDownloads::IsReady(), VoltMod::LanguageTable::Language(), VoltMod::PendingConVarQueries::NextCookie(), VoltMod::GameEvents::On(), VoltMod::CenterHtmlMenu::Open(), VoltMod::MenuFreeze::Open(), VoltMod::CenterHtmlMenu::OpenSession(), VoltMod::PerSlot< T >::operator[](), VoltMod::PerSlot< T >::operator[](), OwnerSlot(), VoltMod::MenuStack::Pop(), VoltMod::MenuStack::PopToRoot(), VoltMod::PendingConVarQueries::Prune(), VoltMod::MenuStack::Push(), VoltMod::ClientConVars::Query(), VoltMod::PluginRegistry::RaiseClientConnected(), VoltMod::PluginRegistry::RaiseClientFullyConnected(), VoltMod::Voice::Refresh(), VoltMod::PerSlot< T >::Reset(), VoltMod::MenuStack::Root(), VoltMod::Messages::SendCenterHtml(), VoltMod::Visibility::SetControllerHidden(), VoltMod::LanguageTable::SetLanguage(), VoltMod::Visibility::SetPawnHidden(), VoltMod::CenterHtml::Show(), VoltMod::Visibility::ShowOnlyTo(), VoltMod::Pawn::Slot(), VoltMod::Vote::Start(), VoltMod::CenterHtml::Stop(), VoltMod::PendingConVarQueries::Take(), VoltMod::Vote::TryCastBallot(), VoltMod::ChatInput::TryConsume(), and VoltMod::Visibility::Visibility().

◆ IsValidTableName()

bool VoltMod::IsValidTableName ( const std::string & name)
static

[A-Za-z_][A-Za-z0-9_]* - the table name is interpolated into SQL, so reject anything else.

Definition at line 25 of file Migrator.cpp.

Referenced by RunMigrations().

◆ KitDefaults()

const StringMap< std::string > & VoltMod::KitDefaults ( )
static

English text for the keys the framework itself emits, and each language's own name for a language picker. Translations::Get returns the raw key on a miss, so without this every plugin had to hand-copy all of them into every language file or players saw the literal string cmd.noPermission. A plugin's own file still wins - these are the floor, not an override.

Definition at line 42 of file Translations.cpp.

◆ LastError()

std::string VoltMod::LastError ( )
static

Why the last OpenModule or FindExport failed.

Definition at line 43 of file SharedLibrary.cpp.

Referenced by LoadNextServer(), VoltMod::SharedLibrary::Open(), StartHost(), and VoltMod::SharedLibrary::Symbol().

◆ LengthPrefixedName()

std::string VoltMod::LengthPrefixedName ( std::string_view className)

◆ LibraryPath()

std::filesystem::path VoltMod::LibraryPath ( std::string_view name)
static

Definition at line 40 of file PluginLoader.cpp.

References LibrarySuffix, PluginFile(), and ResolvePath().

◆ LoadConfig()

template<class TConfig>
TConfig VoltMod::LoadConfig ( Runtime & runtime,
TConfig config = {},
const LoadConfigOptions & options = {} )

Load the plugin's settings, then its translations, and return config.

Meant for the App's Config member initializer, so every member below it is built with settings: ConfigManager Config = VoltMod::LoadConfig<ConfigManager>(Runtime);.

The required "Configuration" step reads the plugin's LoadConfigOptions::SettingsFile through TConfig::LoadSettings when available, otherwise Options::Load. A failure keeps the defaults, and the framework refuses the plugin before Load runs. Translation loading then applies plugin.locale and reads the plugin's translations directory when enabled.

Definition at line 35 of file LoadConfig.hpp.

◆ LoadNextServer()

InterfaceFactory VoltMod::LoadNextServer ( )
static

The first server library on the Game paths: Metamod's loader where it is installed, else the game's.

Definition at line 64 of file Loader.cpp.

References g_gameDir, g_start, GameDir(), GameSearchPaths(), LastError(), OpenModule(), PlatformDir, ReadFile(), and ServerFile.

Referenced by FindNextFactory().

◆ LooksLikeTypeInfo()

bool VoltMod::LooksLikeTypeInfo ( uintptr_t address)
static

Definition at line 127 of file VtableLookup.cpp.

References IsReadableAddress(), and ReadWord().

Referenced by BaseCount(), CollectBases(), FindBaseOffsetByTypeInfo(), and HasSingleBase().

◆ MakeConsoleHandler()

Log::Handler VoltMod::MakeConsoleHandler ( std::string prefix)

The default handler: tier0 ConColorMsg/Msg, one colour per level.

The returned handler owns a copy of prefix and reaches the engine, so it may only be invoked on the game thread - which is exactly the contract VoltMod::Log::Handler already states.

Definition at line 11 of file ConsoleLogger.cpp.

References Error, Info, and Warn.

Referenced by VoltMod::Host::Start().

◆ MakeFilter()

◆ MariaDbSettings()

◆ Mask()

uint64_t VoltMod::Mask ( TraceLayers layers)
static

Definition at line 19 of file Trace.cpp.

References Sight, SightMask, Surfaces, and SurfacesMask.

Referenced by MakeFilter().

◆ Matches()

bool VoltMod::Matches ( const uint8_t * at,
const std::vector< PatternByte > & pattern )
static

Whether pattern matches at at, which must have room for all of it.

Definition at line 68 of file BytePattern.cpp.

Referenced by FindFirst().

◆ MemberPtr()

template<typename T>
T * VoltMod::MemberPtr ( void * base,
std::ptrdiff_t offset )
noexcept

Pointer to the field of type T located offset bytes into base.

Definition at line 21 of file MemoryAccess.hpp.

References T.

Referenced by VoltMod::Schema::CGameSceneNode::AbsOrigin(), VoltMod::Schema::CGameSceneNode::AbsRotation(), VoltMod::Schema::CBaseEntity::AbsVelocity(), VoltMod::Schema::CVoteController::AcceptingVotesTimer(), VoltMod::Schema::CCSPlayerController_InGameMoneyServices::Account(), VoltMod::Schema::CCSPlayerController::ActionTrackingServices(), VoltMod::Schema::CVoteController::ActiveIssueIndex(), VoltMod::Schema::CPlayer_WeaponServices::ActiveWeapon(), VoltMod::Schema::CBaseEntity::ActualMoveType(), VoltMod::Schema::CCSPlayerPawn::AimPunchServices(), VoltMod::Schema::CCSPlayerPawn::ArmorValue(), VoltMod::Schema::CBaseEntity::BodyComponent(), VoltMod::Schema::CPlayer_MovementServices::Buttons(), VoltMod::Schema::CInButtonState::ButtonStates(), VoltMod::Schema::CBasePlayerPawn::CameraServices(), VoltMod::Schema::CCSPlayerController::Clan(), VoltMod::Schema::CCSCustomHudLayout::ClassNames(), VoltMod::Schema::CBaseModelEntity::Collision(), VoltMod::Schema::CCollisionProperty::CollisionAttribute(), VoltMod::Schema::VPhysicsCollisionAttribute_t::CollisionFunctionMask(), VoltMod::Schema::ComponentOwner(), VoltMod::Schema::CBasePlayerPawn::ControllerRef(), VoltMod::Schema::CParticleSystem::ControlPointRef(), VoltMod::Schema::CCSCustomHudLayout::DialogVariableNames(), VoltMod::Schema::CCSPlayer_MovementServices::DuckAmount(), VoltMod::Schema::CCSPlayer_MovementServices::Ducked(), VoltMod::Schema::CCSPlayer_MovementServices::DuckOverride(), VoltMod::Schema::CBeam::EndPos(), VoltMod::Schema::CBeam::EndWidth(), VoltMod::Schema::CCSPlayerPawn::EntitySpottedState(), VoltMod::Schema::CVoteController::ExecuteCommandTimer(), VoltMod::Schema::CCSPlayerPawn::EyeAngles(), VoltMod::Schema::CBaseEntity::Flags(), VoltMod::Schema::CCSPlayerPawnBase::FlashDuration(), VoltMod::Schema::CCSPlayerPawnBase::FlashMaxAlpha(), VoltMod::Schema::CCSGameRulesProxy::GameRules(), VoltMod::Schema::CCSWeaponBaseVData::GearSlot(), VoltMod::Schema::CCSCustomHudLayout::GlobalLayoutState(), VoltMod::Schema::CBaseEntity::GravityScale(), VoltMod::Schema::CBaseEntity::GroundEntity(), VoltMod::Schema::CBaseEntity::Health(), VoltMod::Schema::CVoteController::HighestCountIndex(), VoltMod::Schema::CCSPlayerController::InGameMoneyServices(), VoltMod::Schema::CCSCustomHudLayoutState::InputCaptureEnabled(), VoltMod::Schema::CCSWeaponBaseVData::IsFullAuto(), VoltMod::Schema::CBasePlayerController::IsHLTV(), VoltMod::Schema::CCSPlayerPawn::IsScoped(), VoltMod::Schema::CVoteController::IsYesNoVote(), VoltMod::Schema::CBasePlayerPawn::ItemServices(), VoltMod::Schema::CSPerRoundStats_t::Kills(), VoltMod::Schema::CPlayer_WeaponServices::LastWeapon(), VoltMod::Schema::CCSPlayerPawn::LastWeaponFireUsercmd(), VoltMod::Schema::CCSCustomHudLayout::Layout(), VoltMod::Schema::CBaseEntity::LifeState(), VoltMod::Schema::CCSPlayerController_ActionTrackingServices::MatchStats(), VoltMod::Schema::CBaseEntity::MaxHealth(), VoltMod::Schema::CPlayer_MovementServices::Maxspeed(), VoltMod::Schema::CModelState::ModelName(), VoltMod::Schema::CSkeletonInstance::ModelState(), VoltMod::Schema::CBasePlayerPawn::MovementServices(), VoltMod::Schema::CBaseEntity::MoveTypeRaw(), VoltMod::Schema::CPlayer_WeaponServices::MyWeapons(), VoltMod::Schema::CBaseCombatCharacter::MyWearables(), VoltMod::Schema::CCSWeaponBaseVData::Name(), VoltMod::Schema::CBasePlayerWeapon::NextPrimaryAttackTick(), VoltMod::Schema::CBasePlayerWeapon::NextSecondaryAttackTick(), VoltMod::Schema::NotifyComponentOwner(), VoltMod::Schema::CPlayer_ObserverServices::ObserverMode(), VoltMod::Schema::CBasePlayerPawn::ObserverServices(), VoltMod::Schema::CPlayer_ObserverServices::ObserverTarget(), VoltMod::Schema::CCSPlayerPawn::OnGroundLastTick(), VoltMod::Schema::CVoteController::OnlyTeamToVote(), VoltMod::Schema::CBaseEntity::OwnerEntity(), VoltMod::Schema::CCSCustomHudLayout::PanelIds(), VoltMod::Schema::CCSPlayerController::PawnHasHelmet(), VoltMod::Schema::CBasePlayerController::PawnRef(), VoltMod::Schema::CVoteController::PlayerHoldingVote(), VoltMod::Schema::CCSCustomHudLayout::PlayerLayoutStates(), VoltMod::Schema::CBasePlayerController::PlayerName(), VoltMod::Schema::CVoteController::PlayerOverrideForVote(), VoltMod::Schema::CCSPlayerController::PlayerPawn(), VoltMod::Schema::CVoteController::PotentialIssues(), VoltMod::Schema::CVoteController::PotentialVotes(), VoltMod::Schema::CCSPlayer_AimPunchServices::PredictableBaseAngle(), VoltMod::Schema::CCSPlayer_AimPunchServices::PredictableBaseAngleVel(), VoltMod::Schema::CCSPlayer_AimPunchServices::PredictableBaseTick(), VoltMod::Schema::CCSPlayer_AimPunchServices::PredictableBaseTickInterpAmount(), ReadAt(), VoltMod::Schema::CBaseModelEntity::RenderColor(), VoltMod::Schema::CBaseModelEntity::RenderMode(), VoltMod::Schema::CVoteController::ResetVoteTimer(), VoltMod::Schema::CCSGameRules::RoundStartTime(), VoltMod::Schema::CCSGameRules::RoundTime(), VoltMod::Schema::CBodyComponent::SceneNode(), VoltMod::Schema::CCSPlayerController::Score(), VoltMod::Schema::CBaseEntity::SetAbsVelocity(), VoltMod::Schema::CCSPlayerController_InGameMoneyServices::SetAccount(), VoltMod::Schema::CVoteController::SetActiveIssueIndex(), VoltMod::Schema::CPlayer_WeaponServices::SetActiveWeapon(), VoltMod::Schema::CBaseEntity::SetActualMoveType(), VoltMod::Schema::CCSPlayerPawn::SetArmorValue(), VoltMod::Schema::CCSPlayerController::SetClan(), VoltMod::Schema::VPhysicsCollisionAttribute_t::SetCollisionFunctionMask(), VoltMod::Schema::CBasePlayerPawn::SetControllerRef(), VoltMod::Schema::CParticleSystem::SetControlPointRef(), VoltMod::Schema::CCSPlayer_MovementServices::SetDuckAmount(), VoltMod::Schema::CCSPlayer_MovementServices::SetDucked(), VoltMod::Schema::CCSPlayer_MovementServices::SetDuckOverride(), VoltMod::Schema::CBeam::SetEndPos(), VoltMod::Schema::CBeam::SetEndWidth(), VoltMod::Schema::CCSPlayerPawn::SetEyeAngles(), VoltMod::Schema::CBaseEntity::SetFlags(), VoltMod::Schema::CCSPlayerPawnBase::SetFlashDuration(), VoltMod::Schema::CCSPlayerPawnBase::SetFlashMaxAlpha(), VoltMod::Schema::CBaseEntity::SetGravityScale(), VoltMod::Schema::CBaseEntity::SetGroundEntity(), VoltMod::Schema::CBaseEntity::SetHealth(), VoltMod::Schema::CVoteController::SetHighestCountIndex(), VoltMod::Schema::CCSCustomHudLayoutState::SetInputCaptureEnabled(), VoltMod::Schema::CBasePlayerController::SetIsHLTV(), VoltMod::Schema::CCSPlayerPawn::SetIsScoped(), VoltMod::Schema::CVoteController::SetIsYesNoVote(), VoltMod::Schema::CPlayer_WeaponServices::SetLastWeapon(), VoltMod::Schema::CCSPlayerPawn::SetLastWeaponFireUsercmd(), VoltMod::Schema::CCSCustomHudLayout::SetLayout(), VoltMod::Schema::CBaseEntity::SetLifeState(), VoltMod::Schema::CBaseEntity::SetMaxHealth(), VoltMod::Schema::CPlayer_MovementServices::SetMaxspeed(), VoltMod::Schema::CBaseEntity::SetMoveTypeRaw(), VoltMod::Schema::CBasePlayerWeapon::SetNextPrimaryAttackTick(), VoltMod::Schema::CBasePlayerWeapon::SetNextSecondaryAttackTick(), VoltMod::Schema::CPlayer_ObserverServices::SetObserverMode(), VoltMod::Schema::CPlayer_ObserverServices::SetObserverTarget(), VoltMod::Schema::CCSPlayerPawn::SetOnGroundLastTick(), VoltMod::Schema::CVoteController::SetOnlyTeamToVote(), VoltMod::Schema::CBaseEntity::SetOwnerEntity(), VoltMod::Schema::CCSPlayerController::SetPawnHasHelmet(), VoltMod::Schema::CBasePlayerController::SetPawnRef(), VoltMod::Schema::CVoteController::SetPlayerHoldingVote(), VoltMod::Schema::CCSCustomHudLayout::SetPlayerLayoutStates(), VoltMod::Schema::CBasePlayerController::SetPlayerName(), VoltMod::Schema::CVoteController::SetPlayerOverrideForVote(), VoltMod::Schema::CCSPlayerController::SetPlayerPawn(), VoltMod::Schema::CVoteController::SetPotentialVotes(), VoltMod::Schema::CCSPlayer_AimPunchServices::SetPredictableBaseAngle(), VoltMod::Schema::CCSPlayer_AimPunchServices::SetPredictableBaseAngleVel(), VoltMod::Schema::CCSPlayer_AimPunchServices::SetPredictableBaseTick(), VoltMod::Schema::CCSPlayer_AimPunchServices::SetPredictableBaseTickInterpAmount(), VoltMod::Schema::CBaseModelEntity::SetRenderColor(), VoltMod::Schema::CBaseModelEntity::SetRenderMode(), VoltMod::Schema::CCSGameRules::SetRoundStartTime(), VoltMod::Schema::CCSGameRules::SetRoundTime(), VoltMod::Schema::CCSPlayerController::SetScore(), VoltMod::Schema::CCSPlayerPawn::SetShotsFired(), VoltMod::Schema::EntitySpottedState_t::SetSpotted(), VoltMod::Schema::EntitySpottedState_t::SetSpottedByMask(), VoltMod::Schema::CCollisionProperty::SetSurroundType(), VoltMod::Schema::CBaseEntity::SetTeamNum(), VoltMod::Schema::CCSPlayerPawn::SetVelocityModifier(), VoltMod::Schema::CPlayer_CameraServices::SetViewEntity(), VoltMod::Schema::CBaseModelEntity::SetViewOffset(), VoltMod::Schema::CVoteController::SetVoteOptionCount(), VoltMod::Schema::CVoteController::SetVotesCast(), VoltMod::Schema::CBeam::SetWidth(), VoltMod::Schema::CCSPlayerBase_CameraServices::SetZoomOwner(), VoltMod::Schema::CCSPlayerPawn::ShotsFired(), VoltMod::Schema::EntitySpottedState_t::Spotted(), VoltMod::Schema::EntitySpottedState_t::SpottedByMask(), VoltMod::Schema::CBaseEntity::SubclassIdAddress(), VoltMod::Schema::CCollisionProperty::SurroundType(), VoltMod::Schema::CBaseEntity::TeamNum(), VoltMod::Schema::CCSPlayerPawn::VelocityModifier(), VoltMod::Schema::CPlayer_CameraServices::ViewEntity(), VoltMod::Schema::CBaseModelEntity::ViewOffset(), VoltMod::Schema::CVoteController::VoteOptionCount(), VoltMod::Schema::CVoteController::VoteOptions(), VoltMod::Schema::CVoteController::VotesCast(), VoltMod::Schema::CBasePlayerPawn::WeaponServices(), VoltMod::Schema::CCSWeaponBaseVData::WeaponType(), VoltMod::Schema::CBeam::Width(), WriteAt(), and VoltMod::Schema::CCSPlayerBase_CameraServices::ZoomOwner().

◆ ModifierClass()

std::string_view VoltMod::ModifierClass ( std::string & out,
std::string_view block,
std::string_view name )
static

<block>--<name>, built in out.

Definition at line 14 of file ScreenEntity.cpp.

Referenced by VoltMod::ScreenEntity::WriteModifier().

◆ ModuleAt()

HMODULE VoltMod::ModuleAt ( const void * address)
static

The loaded module whose image holds address, without taking a reference to it.

Definition at line 27 of file Loader.windows.cpp.

◆ Name()

template<class E>
std::string_view VoltMod::Name ( E value)
constexprnoexcept

Identifier of value, or an empty view when it is not a declared enumerator.

Definition at line 33 of file EnumNames.hpp.

Referenced by VoltMod::PluginLoader::Defer(), VoltMod::Schema::DescribeType(), DriverName(), VoltMod::Runtime::Runtime(), and UsagePlaceholderKey().

◆ NameIs()

bool VoltMod::NameIs ( uintptr_t address,
std::string_view wanted )
static

Definition at line 143 of file VtableLookup.cpp.

References IsReadableAddress(), and ReadWord().

Referenced by CollectBases().

◆ NavPhysics()

EngineNavPhysics * VoltMod::NavPhysics ( void *& table)
static

Definition at line 68 of file Trace.cpp.

Referenced by VoltMod::Trace::Box(), and VoltMod::Trace::Line().

◆ NextWord()

std::string_view VoltMod::NextWord ( std::string_view & line)
static

Take the next bare or quoted word off the front of line.

Definition at line 19 of file GameSearchPaths.cpp.

References Blank.

Referenced by GameSearchPaths().

◆ NoGameRules()

Status VoltMod::NoGameRules ( )
static

Definition at line 15 of file Rounds.cpp.

References VoltMod::Error::NotReady().

Referenced by VoltMod::Rounds::End(), and VoltMod::Rounds::SetTime().

◆ NotSourceXml()

Error VoltMod::NotSourceXml ( std::string_view layout)
static

Definition at line 10 of file LayoutPath.cpp.

References VoltMod::Error::Invalid().

Referenced by VoltMod::LayoutPath::Parse().

◆ ObserverTarget()

◆ OffsetLocal()

Vector VoltMod::OffsetLocal ( const Vector & origin,
const QAngle & angles,
const Vector & forwardLeftUp )

The point forwardLeftUp away from origin along the axes of angles, such as a muzzle on a turret that turns and pitches about origin.

Definition at line 36 of file Math.cpp.

References AngleToAxes(), VoltMod::Axes::Forward, VoltMod::Axes::Left, and VoltMod::Axes::Up.

◆ OnConnect()

bool VoltMod::OnConnect ( void * config,
InterfaceFactory engineFactory )
static

Definition at line 154 of file Loader.cpp.

References g_connect, and g_start.

Referenced by Patch().

◆ OnDisconnect()

void VoltMod::OnDisconnect ( void * config)
static

Definition at line 182 of file Loader.cpp.

References g_disconnect, and StopHost().

Referenced by Patch().

◆ OnInit()

InitReturnVal_t VoltMod::OnInit ( void * server)
static

Definition at line 160 of file Loader.cpp.

References g_init, and StartHost().

Referenced by Patch().

◆ OnlyHit()

std::optional< TraceHit > VoltMod::OnlyHit ( const Result< TraceHit > & trace)
static

◆ OnShutdown()

void VoltMod::OnShutdown ( void * server)
static

Definition at line 175 of file Loader.cpp.

References g_shutdown, and StopHost().

Referenced by Patch().

◆ OpenConnection()

void VoltMod::OpenConnection ( AnyConnection & connection,
Driver driver,
const DatabaseConfig & config )

Opens a driver connection into connection. Throws what the driver throws, whose text can hold the password.

Definition at line 125 of file OpenConnection.cpp.

References VoltMod::DatabaseConfig::connectTimeoutSec, InMemory, MariaDb, MariaDbSettings(), VoltMod::DatabaseConfig::path, Postgres, PostgresSettings(), Sqlite, and SqliteSettings().

◆ OpenLibrary()

void * VoltMod::OpenLibrary ( const std::filesystem::path & path)
static

Definition at line 49 of file SharedLibrary.cpp.

Referenced by VoltMod::SharedLibrary::Open().

◆ OpenModule()

void * VoltMod::OpenModule ( const std::filesystem::path & path)

Null on failure, with the reason in LastError.

Definition at line 8 of file Loader.linux.cpp.

Referenced by LoadNextServer(), and StartHost().

◆ operator|()

GameDataSection VoltMod::operator| ( GameDataSection left,
GameDataSection right )
constexpr

Definition at line 18 of file GameDataLocation.hpp.

◆ Opposite()

Team VoltMod::Opposite ( Team team)
constexpr

The other playing team; Team::None for a team that does not play.

Definition at line 24 of file Team.hpp.

References CT, None, and T.

Referenced by VoltMod::Pawn::GiveItem().

◆ OptionalsTrail()

template<class... A>
bool VoltMod::OptionalsTrail ( )
consteval

Whether every optional argument in A trails the required ones.

Definition at line 239 of file Args.hpp.

◆ OriginalSlot()

const void * VoltMod::OriginalSlot ( void * table,
int index,
const OriginalSlotLookup & originalSlots )
static

Definition at line 64 of file GameDataScanner.cpp.

◆ OwnerSlot()

int VoltMod::OwnerSlot ( void * movementServices)
static

The slot of the player whose pawn owns movementServices, or -1.

Definition at line 16 of file PlayerCommands.cpp.

References VoltMod::Schema::CBasePlayerPawn::ControllerRef(), VoltMod::EntityRef::Handle, IsValidSlot(), and VoltMod::Schema::CPlayer_MovementServices::OwnerEntity().

◆ OwnPath()

std::filesystem::path VoltMod::OwnPath ( )

This module's own file.

Definition at line 24 of file Loader.linux.cpp.

Referenced by GameDir(), and StartHost().

◆ PageCount()

int VoltMod::PageCount ( int items,
int perPage )
constexpr

Returns the number of pages needed for items, with at least one page.

Definition at line 14 of file MenuModel.hpp.

Referenced by VoltMod::MenuCursor::JumpPage(), and RenderMenuHtml().

◆ Parse()

template<class E>
std::optional< E > VoltMod::Parse ( std::string_view name)
constexprnoexcept

The enumerator spelled name, or nullopt.

Case-insensitive: enumerators are PascalCase, but the text being parsed is almost always a lowercase config value ("observe", "grants"), and a case-sensitive match would send every such call back to a hand-written chain. Pair it with value_or to supply the fallback.

Definition at line 46 of file EnumNames.hpp.

Referenced by VoltMod::InstalledPlugins::Discover(), and ParseDriver().

◆ ParseAddonList()

std::vector< uint64_t > VoltMod::ParseAddonList ( std::string_view field)

Split a join message's comma-separated addons field, skipping malformed entries.

Definition at line 226 of file DownloadQueue.cpp.

References ParseUInt64(), and SplitAddonList().

Referenced by AppendToAddonList(), and VoltMod::DownloadQueue::DecideJoinMessage().

◆ ParseDriver()

std::optional< Driver > VoltMod::ParseDriver ( std::string_view name)
inline

Parse a config driver value ("postgres", "mariadb", "sqlite"); nullopt for anything else.

Definition at line 21 of file Driver.hpp.

References Parse().

Referenced by CheckConfig().

◆ ParseDuration()

int VoltMod::ParseDuration ( std::string_view text)

Parse a human duration string into seconds. Accepts a bare integer (seconds) or an integer with a unit suffix: s seconds, m minutes, h hours, d days, w weeks (case-insensitive). The literals 0, perm, and permanent mean "permanent" (returns 0). Surrounding whitespace is ignored. This is the single canonical duration grammar; Time::ParseDuration delegates here. Returns -1 on parse failure or int overflow, 0 for permanent, otherwise seconds.

Definition at line 35 of file Strings.cpp.

Referenced by BindDuration(), and VoltMod::Validation::ParseDurations().

◆ ParseInt64()

std::optional< int64_t > VoltMod::ParseInt64 ( std::string_view text)

text as an int64_t, or nullopt unless it is entirely digits (with an optional sign).

Definition at line 13 of file Strings.cpp.

Referenced by BindInt(), BindPlayerOrSteamId(), BindSteamId(), and ParseTargetToken().

◆ ParseMigrationVersion()

std::optional< int > VoltMod::ParseMigrationVersion ( std::string_view filename)
inline

Leading NNNN version of a migration filename, or nullopt when it has none.

Definition at line 40 of file Migrator.hpp.

Referenced by RunMigrations().

◆ ParsePattern()

std::vector< PatternByte > VoltMod::ParsePattern ( const std::string & pattern)

Parse a pattern like 48 8B ? ? 05 into bytes and wildcards.

Returns
the bytes, or empty when a token is neither a hex byte nor ?. That is reported here and leaves the caller dropping the signature, rather than searching for something the author did not write.

Definition at line 11 of file BytePattern.cpp.

References VoltMod::Log::Error().

Referenced by FindPatternEx().

◆ ParseSslMode()

std::optional< PostgresSslMode > VoltMod::ParseSslMode ( std::string_view name)
static

Definition at line 35 of file OpenConnection.cpp.

References VoltMod::SslModeName::Name, and SslModes.

Referenced by CheckConfig(), MariaDbSettings(), and PostgresSettings().

◆ ParseTargetToken()

◆ ParseUInt64()

std::optional< uint64_t > VoltMod::ParseUInt64 ( std::string_view text)

text as a uint64_t, or nullopt unless it is entirely digits. A leading - is rejected rather than wrapped, which is the whole reason this is not ParseInt64 with a cast.

Definition at line 24 of file Strings.cpp.

Referenced by BindU64(), ParseAddonList(), and RemoveFromAddonList().

◆ Patch()

void VoltMod::Patch ( const char * name,
void * object )
static

◆ Perform()

HttpResult VoltMod::Perform ( const HttpRequest & request,
const std::atomic_bool & stopped )
static

◆ PickDialect()

Dialect VoltMod::PickDialect ( Driver driver)
inline

The spellings driver wants.

Definition at line 71 of file Migrator.hpp.

References MariaDb, Postgres, and Sqlite.

Referenced by ResolveDialect().

◆ PlatformColumn()

template<class TEntry>
const auto & VoltMod::PlatformColumn ( const TEntry & entry)

Definition at line 80 of file GameDataDocument.hpp.

Referenced by ColumnValue().

◆ PlatformModuleName()

std::string VoltMod::PlatformModuleName ( std::string_view moduleName)

◆ PluginDir()

std::string VoltMod::PluginDir ( std::string_view plugin)

"addons/voltmod/plugins/<plugin>". Pure string building, so safe at static init.

Definition at line 20 of file Paths.cpp.

Referenced by PluginFile().

◆ PluginFile()

std::string VoltMod::PluginFile ( std::string_view plugin,
std::string_view relative )

"addons/voltmod/plugins/<plugin>/<relative>".

Definition at line 25 of file Paths.cpp.

References PluginDir().

Referenced by LibraryPath(), VoltMod::ServerAssets::Mount(), and VoltMod::Runtime::PluginFile().

◆ PostgresSettings()

◆ PostUserMessage()

bool VoltMod::PostUserMessage ( Interfaces & interfaces,
NetMessageInfo_t *& cached,
std::string_view partialName,
IRecipientFilter & filter,
const std::function< bool(CNetMessage *)> & fill )

Send one user message: resolve its type, allocate it, let fill populate it, post it to filter, and free it.

The free has to pair with the allocate on every exit path, including the one where the protobuf cast fails. Getting that wrong leaks a net message per send, which is why every sender goes through here instead of repeating the sequence.

Parameters
cachedthe caller's cache of the resolved message type, filled on the first call. Message types are stable for the process, so this is resolved once per sender.
partialNamematched with FindNetworkMessagePartial, e.g. "TextMsg" or "VoteStart". Partial rather than exact because a registered message is named with its id appended ("CUserMessageTextMsg [124]"), so INetworkMessages::FindNetworkMessage matches nothing at all - there is no name a caller could pass it that would.
fillreturns false to abandon the send; the message is still freed.
Returns
whether the message was posted.

Definition at line 11 of file NetMessage.cpp.

References VoltMod::Interfaces::GameEventSystem, and VoltMod::Interfaces::NetworkMessages.

Referenced by VoltMod::Messages::Shake().

◆ PrimaryLocator()

std::pair< uint32_t, const uint8_t * > VoltMod::PrimaryLocator ( const PeRtti & rtti,
std::string_view className )
static

Definition at line 133 of file VtableLookup.windows.cpp.

References FindLocator(), and FindTypeDescriptor().

Referenced by FindBaseInRtti(), and FindVirtualTableInRtti().

◆ QueryRegion()

std::optional< MemoryRegion > VoltMod::QueryRegion ( const void * address)
static

Definition at line 134 of file SigScanner.cpp.

Referenced by IsExecutableAddress(), and IsReadableAddress().

◆ RaiseCommand()

void VoltMod::RaiseCommand ( CallbackList< IPluginEvents::PlayerCommandFn > & listeners,
int slot,
const PlayerInput & input )
static

◆ RandomIndex()

std::size_t VoltMod::RandomIndex ( std::size_t count)

A uniformly random index in [0, count), or 0 when count is 0.

The framework's single source of randomness, so features that need a random pick (@random targeting, a random menu entry) do not each seed their own generator - or fall back to something like the tick counter, which repeats within a frame.

Game-thread only; the generator is not synchronised.

Definition at line 7 of file Random.cpp.

Referenced by VoltMod::EngineArgBinder::Resolve().

◆ ReadAllText()

Result< std::string > VoltMod::ReadAllText ( std::string_view path)

Read path (resolved via ResolvePath) into a string.

Binary mode: the bytes reach the caller exactly as written, so no text-mode line-ending translation can alter an offset or split a UTF-8 sequence.

Returns
ErrorCode::NotFound when the file cannot be opened.

Definition at line 12 of file File.cpp.

References VoltMod::Error::NotFound(), and ResolvePath().

Referenced by VoltMod::ConVars::ExecuteFile(), GameBuild(), VoltMod::Translations::Load(), VoltMod::Json::ReadFile(), and RunMigrations().

◆ ReadAt() [1/2]

template<typename T>
T VoltMod::ReadAt ( const uint8_t * address)
static

Definition at line 50 of file VtableLookup.windows.cpp.

References T.

◆ ReadAt() [2/2]

template<typename T>
T VoltMod::ReadAt ( void * base,
std::ptrdiff_t offset )
noexcept

Read the value of type T located offset bytes into base.

Definition at line 28 of file MemoryAccess.hpp.

References MemberPtr().

Referenced by FindBaseInRtti(), and FindLocator().

◆ ReadFile()

std::string VoltMod::ReadFile ( const std::filesystem::path & path)
static

Definition at line 57 of file Loader.cpp.

Referenced by LoadNextServer().

◆ ReadOriginalSlot()

const void * VoltMod::ReadOriginalSlot ( void ** vtable,
int index )
inline

What vtable's index held before a hook patched it, or nullptr.

Definition at line 21 of file Detours.hpp.

References KHook::__exported__khook.

Referenced by VoltMod::Host::Start().

◆ ReadU32()

uint32_t VoltMod::ReadU32 ( uintptr_t address)
static

Definition at line 47 of file VtableLookup.cpp.

Referenced by BaseCount().

◆ ReadWord()

uintptr_t VoltMod::ReadWord ( uintptr_t address)
static

◆ Ref()

EntityRef VoltMod::Ref ( const CEntityInstance * entity)
static

Definition at line 42 of file Trace.cpp.

Referenced by ToHit().

◆ RefuseUnsatisfied()

void VoltMod::RefuseUnsatisfied ( const PluginsByName & plugins,
RefusalsByName & refused )
static

◆ Rel32ReadInBounds()

bool VoltMod::Rel32ReadInBounds ( uintptr_t moduleBase,
size_t moduleSize,
uintptr_t matchAddress,
int ripOffset )
constexprnoexcept

Whether the four-byte displacement at matchAddress + ripOffset fits entirely within the mapped image. Invalid and overflowing offsets return false before any read occurs.

Definition at line 37 of file RelativeAddress.hpp.

References Rel32Site(), and Rel32Size.

Referenced by ResolveRelativeAddress().

◆ Rel32Site()

uintptr_t VoltMod::Rel32Site ( uintptr_t matchAddress,
int ripOffset )
constexprnoexcept

Definition at line 19 of file RelativeAddress.hpp.

Referenced by Rel32ReadInBounds(), and ResolveRelativeAddress().

◆ Rel32Target()

uintptr_t VoltMod::Rel32Target ( uintptr_t site,
int32_t displacement,
int ripSize = Rel32Size )
constexprnoexcept

Resolve displacement from site. ripSize is the distance from the site to the end of the instruction and defaults to the four-byte displacement width.

Definition at line 28 of file RelativeAddress.hpp.

References Rel32Size.

Referenced by ResolveRelativeAddress().

◆ RemoveFromAddonList()

void VoltMod::RemoveFromAddonList ( std::string & field,
const std::vector< uint64_t > & ids )

Remove one entry per id in ids, keeping the other entries verbatim.

Definition at line 262 of file DownloadQueue.cpp.

References ParseUInt64(), and SplitAddonList().

◆ Render()

std::string VoltMod::Render ( std::string_view message,
MessageKind kind )
static

Definition at line 38 of file Messages.cpp.

References Chat, and EnsureColorPrefix().

Referenced by VoltMod::Messages::Broadcast(), and VoltMod::Messages::Send().

◆ RenderCaptureOverlay()

std::string VoltMod::RenderCaptureOverlay ( const std::string & menuTitle,
std::string_view prompt )

Renders the chat-input capture overlay shown while a player is typing a value.

Definition at line 219 of file CenterHtmlRender.cpp.

References VoltMod::Palette::Accent, VoltMod::Strings::EscapeHtml(), VoltMod::Palette::TextDefault, and VoltMod::Palette::TextMuted.

◆ RenderFooter()

std::string VoltMod::RenderFooter ( bool isSubmenu,
bool isPaginated,
bool selectedRowSteps,
int slot,
Translations & translations )

The footer HTML for a menu: the key hints.

Parameters
isSubmenuTrue if this menu is a submenu (shows "Back" hint), false if it's a root menu (shows "Close" hint).
isPaginatedTrue if the menu has multiple pages of items (shows page navigation hints)
selectedRowStepsTrue when A/D steps the selected row's value rather than paging (shows "Change"/"Confirm" hints).
slotPlayer slot used to look up the nav-label translations.
translationsTable the nav labels are looked up in.
Returns
The generated HTML string for the menu footer.

Definition at line 53 of file CenterHtmlRender.cpp.

References VoltMod::Palette::Accent, FooterChunk(), VoltMod::Translations::GetOr(), and VoltMod::Palette::Highlight.

Referenced by RenderMenuHtml().

◆ RenderHeader()

◆ RenderItems()

◆ RenderMenuHtml()

std::string VoltMod::RenderMenuHtml ( const Menu * menu,
const CenterHtmlView & view,
Translations & translations )

◆ ReplaceAll()

std::string VoltMod::ReplaceAll ( const std::string & str,
const std::string & from,
const std::string & to )
static

Definition at line 159 of file Strings.cpp.

Referenced by VoltMod::Strings::SubstituteTokens().

◆ ResolveDialect()

Result< std::string > VoltMod::ResolveDialect ( std::string_view sql,
Driver driver )
inline

Substitute every dialect placeholder in sql for driver.

A placeholder is @NAME@ or @NAME(args)@ with NAME in [A-Z_], the same rule the CLI's renderer uses; any other @, such as one in an address literal, is ordinary text. An unknown placeholder fails rather than leaving a hole in a statement.

Definition at line 95 of file Migrator.hpp.

References VoltMod::Dialect::AutoIncrementKey, VoltMod::Dialect::EpochNow, VoltMod::Dialect::False, VoltMod::Dialect::InsertIfAbsent, VoltMod::Error::Invalid(), VoltMod::Dialect::NeedsConflictClause, PickDialect(), and VoltMod::Dialect::True.

Referenced by RunMigrations().

◆ ResolveEngineInterfaces()

◆ ResolvePath()

std::filesystem::path VoltMod::ResolvePath ( std::string_view relativePath)

a relative path against the base directory. If the path is already absolute, returns it as-is.

Parameters
relativePathThe relative path to resolve.
Returns
The resolved absolute path.

Definition at line 14 of file Paths.cpp.

References g_baseDir.

Referenced by Installed(), LibraryPath(), VoltMod::Translations::Load(), VoltMod::ServerAssets::Mount(), ReadAllText(), RunMigrations(), SqliteSettings(), WriteAllText(), and VoltMod::Schema::WriteSchemaDump().

◆ ResolveRelativeAddress()

uintptr_t VoltMod::ResolveRelativeAddress ( const Image & module,
uintptr_t matchAddress,
int ripOffset,
int ripSize = Rel32Size )

Resolve the 32-bit displacement at matchAddress + ripOffset relative to the instruction end.

Returns
0 when the displacement is not wholly inside the module.

Definition at line 108 of file SigScanner.cpp.

References VoltMod::Image::Base, Rel32ReadInBounds(), Rel32Site(), Rel32Target(), and VoltMod::Image::Size.

◆ RestIsLast()

template<class... A>
bool VoltMod::RestIsLast ( )
consteval

Whether at most one Args::Rest appears in A, as the final argument. A Rest eats the remainder of the line, so anything after it could never be reached.

Definition at line 260 of file Args.hpp.

References Rest.

◆ RootElement()

std::string VoltMod::RootElement ( std::string_view layout)
static

The root element id of layout; a layout ScreenManager::Create refuses never shows anyway.

Definition at line 13 of file PlayerScreens.cpp.

References VoltMod::LayoutPath::Parse().

Referenced by VoltMod::PlayerScreens::PlayerScreens().

◆ RowText()

◆ Rtti()

PeRtti VoltMod::Rtti ( const Image & module)
static

◆ RunCommand()

HookResult< void > VoltMod::RunCommand ( PluginRegistry & registry,
std::string_view name,
const CCommand & arguments,
int slot )
static

Offer a command to the plugins, and keep it from the engine when one consumes it.

Definition at line 34 of file EngineHooks.cpp.

References VoltMod::HookResult< Ret >::Block(), VoltMod::PluginRegistry::RaiseConsoleCommand(), and Text().

Referenced by VoltMod::EngineHooks::EngineHooks().

◆ RunMigrations()

MigrationResult VoltMod::RunMigrations ( Database & db,
std::string_view dir,
const MigrationOptions & options = {} )

Apply the NNNN_*.sql files in dir newer than the database's version, in order, each in its own transaction under a lock. ResolveDialect fills their placeholders for the live driver. A missing directory is a no-op; on failure the database stays at the last applied version.

Definition at line 57 of file Migrator.cpp.

References VoltMod::MigrationResult::Applied, ApplyMigration(), VoltMod::MigrationResult::CurrentVersion, VoltMod::Log::Error(), VoltMod::Database::GetDriver(), VoltMod::MigrationOptions::HistoryTable, HistoryTableDdl(), VoltMod::Log::Info(), IsMariaDb, IsPostgres, IsSqlite, IsValidTableName(), VoltMod::MigrationOptions::LockKey, ParseMigrationVersion(), ReadAllText(), ResolveDialect(), ResolvePath(), VoltMod::Database::Run(), SplitStatements(), VoltMod::MigrationResult::Success, and VoltMod::Log::Warn().

◆ Rva()

uint64_t VoltMod::Rva ( const Image & module,
const void * address )
static

Definition at line 20 of file GameDataScanner.cpp.

◆ SameFileName()

bool VoltMod::SameFileName ( std::string_view left,
std::string_view right )
static

Definition at line 22 of file Image.windows.cpp.

◆ SameKey()

bool VoltMod::SameKey ( std::string_view left,
std::string_view right )
static

Definition at line 11 of file GameSearchPaths.cpp.

Referenced by GameSearchPaths().

◆ Scan()

Result< ScanResult > VoltMod::Scan ( std::string_view moduleName,
const std::string & pattern )
static

◆ SceneNode()

Schema::CGameSceneNode VoltMod::SceneNode ( const Entity & entity)
static

Definition at line 60 of file Entity.cpp.

Referenced by VoltMod::Entity::Angles(), and VoltMod::Entity::Origin().

◆ SetBaseDir()

void VoltMod::SetBaseDir ( const std::filesystem::path & baseDir)

Set the base directory for path resolution (the host's csgo directory). Must be called during initialization before any file loading.

Parameters
baseDirThe base directory path to use for resolving relative paths.

Definition at line 9 of file Paths.cpp.

References g_baseDir.

Referenced by VoltMod::Host::Start().

◆ SetStr()

void VoltMod::SetStr ( CUtlString & out,
std::string_view text )
static

Assigned in place: CUtlString allocates inside tier0, the allocator the engine frees with.

Definition at line 25 of file ScreenEntitySetters.cpp.

◆ SetWeapon()

void VoltMod::SetWeapon ( IGameEvent & event,
std::string_view weapon )
static

Definition at line 32 of file Damage.cpp.

◆ SplitAddonList()

std::vector< std::string_view > VoltMod::SplitAddonList ( std::string_view field)
static

The comma-separated entries of field, verbatim; none for an empty field.

Definition at line 203 of file DownloadQueue.cpp.

Referenced by ParseAddonList(), and RemoveFromAddonList().

◆ SplitStatements()

std::vector< std::string > VoltMod::SplitStatements ( std::string_view sql)
inline

Split a migration file into single statements: -- line comments are stripped, a ; outside a single-quoted literal ends a statement, and blank statements are dropped. One statement per ; - procedure bodies are not supported, because MariaDB and SQLite run raw SQL one statement at a time.

Definition at line 168 of file Migrator.hpp.

Referenced by RunMigrations().

◆ SqliteSettings()

sqlpp::sqlite3::connection_config VoltMod::SqliteSettings ( const DatabaseConfig & config)
static

Definition at line 70 of file OpenConnection.cpp.

References InMemory, VoltMod::DatabaseConfig::path, and ResolvePath().

Referenced by OpenConnection().

◆ StartHost()

void VoltMod::StartHost ( )
static

Definition at line 120 of file Loader.cpp.

References FindExport(), g_start, g_stopHost, HostFile, HostStartName, HostStopName, LastError(), OpenModule(), and OwnPath().

Referenced by OnInit().

◆ StopHost()

void VoltMod::StopHost ( )
static

Definition at line 167 of file Loader.cpp.

References g_stopHost.

Referenced by OnDisconnect(), and OnShutdown().

◆ Store()

template<class T>
std::optional< ArgError > VoltMod::Store ( std::expected< T, ArgError > parsed,
std::vector< BoundArg > & bound )
static

Store parsed, or return its error. Each binder above returns its own argument type.

Definition at line 123 of file ArgBinding.cpp.

Referenced by BindArgs().

◆ SwapSlot()

template<class Fn>
Fn VoltMod::SwapSlot ( void * object,
int index,
Fn replacement )
static

Definition at line 36 of file Loader.cpp.

Referenced by Patch().

◆ TableAfter()

void * VoltMod::TableAfter ( const PeRtti & rtti,
const uint8_t * locator )
static

Definition at line 126 of file VtableLookup.windows.cpp.

References End(), and FindValue().

Referenced by FindBaseInRtti(), and FindVirtualTableInRtti().

◆ TargetKey()

ArgError VoltMod::TargetKey ( const TargetFailure & failure,
const std::string & token )
static

The reply key and tokens for a target that did not resolve.

Definition at line 10 of file ArgBinding.cpp.

References Ambiguous, BotNotAllowed, VoltMod::TargetFailure::Count, DeadNotAllowed, VoltMod::TargetFailure::Error, Immune, MultiNotAllowed, and NoMatch.

Referenced by BindPlayerOrSteamId(), BindTarget(), and BindTargets().

◆ Text()

std::string_view VoltMod::Text ( const char * text)
static

The engine passes null for an absent string.

Definition at line 28 of file EngineHooks.cpp.

Referenced by ClientAddress(), VoltMod::EngineHooks::EngineHooks(), and RunCommand().

◆ TimerOn()

PendingCommit::Timer VoltMod::TimerOn ( Scheduler & scheduler)
static

Definition at line 12 of file MenuStack.cpp.

References VoltMod::Scheduler::Delay().

Referenced by VoltMod::MenuStack::MenuStack().

◆ ToHit()

TraceHit VoltMod::ToHit ( const CGameTrace & trace)
static

Definition at line 51 of file Trace.cpp.

References Ref().

Referenced by VoltMod::Trace::Box(), and VoltMod::Trace::Line().

◆ TokenizeOneCommand()

bool VoltMod::TokenizeOneCommand ( std::string_view command,
CCommand & args )
static

Tokenizes command into args when it is exactly one non-empty command.

Definition at line 69 of file Controller.cpp.

Referenced by VoltMod::Controller::ExecuteCommand().

◆ ToResult()

HttpResult VoltMod::ToResult ( cpr::Response && response)
static

Definition at line 22 of file HttpClient.cpp.

Referenced by Perform().

◆ TurnToward()

float VoltMod::TurnToward ( float current,
float target,
float maxStep )

current turned toward target by at most maxStep degrees, the short way round.

Definition at line 55 of file Math.cpp.

References AngleDelta().

◆ TypeDescriptorMatches()

bool VoltMod::TypeDescriptorMatches ( const PeRtti & rtti,
int32_t rva,
std::span< const std::string > names )
static

Definition at line 90 of file VtableLookup.windows.cpp.

References AtRva(), and TypeDescriptorName.

Referenced by FindBaseInRtti().

◆ Unbound() [1/2]

std::unexpected< Error > VoltMod::Unbound ( std::string reason)
static

◆ Unbound() [2/2]

std::unexpected< Error > VoltMod::Unbound ( std::string reason)
static

Definition at line 10 of file ModuleSymbols.cpp.

References VoltMod::Error::NotFound().

◆ Upsert()

template<class Conn, class Update, class Statement>
void VoltMod::Upsert ( Conn & conn,
const Update & update,
const Statement & insert )

Update by a natural key, inserting only when nothing matched: the portable upsert, since the three drivers disagree on ON CONFLICT / ON DUPLICATE KEY.

Not atomic, so the key needs a UNIQUE constraint to turn a race between two servers into one failed job rather than a duplicate row. Relies on Database setting CLIENT_FOUND_ROWS, which makes MariaDB count matched rows instead of changed ones.

Definition at line 61 of file Connection.hpp.

◆ UsagePlaceholderKey()

std::string VoltMod::UsagePlaceholderKey ( ArgKind kind)
static

Translation key for an argument kind's usage placeholder.

Definition at line 30 of file CommandRouter.cpp.

References Name().

◆ ValidateDescriptor()

Status VoltMod::ValidateDescriptor ( const PluginDescriptor * descriptor,
std::string_view hostVersion )

◆ VirtualIndex()

int VoltMod::VirtualIndex ( const void * function)
static

The vtable index function dispatches through, or -1 when it is not virtual.

Definition at line 33 of file ScriptBindings.cpp.

References IsReadableAddress().

Referenced by FindScriptBinding().

◆ WarnLeaks()

void VoltMod::WarnLeaks ( std::string_view name,
const LeakReport & leaks )
static

◆ WatchCommands()

◆ WatchPresses()

Subscription VoltMod::WatchPresses ( IPluginEvents & events,
ScreenManager & screens )
static

◆ WhenEnabled()

std::function< void(int, MenuSurface &)> VoltMod::WhenEnabled ( EnabledCondition enabled,
std::function< void(int, MenuSurface &)> action )
static

◆ WrapIndex()

int VoltMod::WrapIndex ( int value,
int count )
constexpr

Wraps value into [0, count), including when value is negative.

Definition at line 20 of file MenuModel.hpp.

Referenced by VoltMod::MenuCursor::JumpPage(), VoltMod::ChoiceState::Step(), and VoltMod::MenuCursor::Step().

◆ WriteAllText()

Status VoltMod::WriteAllText ( std::string_view path,
std::string_view text )

Write text to path (resolved via ResolvePath), creating its directory.

Binary mode, so the file is byte-identical on every platform.

Definition at line 24 of file File.cpp.

References VoltMod::Error::Invalid(), and ResolvePath().

Referenced by VoltMod::Schema::WriteDumpFile(), and WriteGameDataRecord().

◆ WriteAt()

template<typename T>
void VoltMod::WriteAt ( void * base,
std::ptrdiff_t offset,
const T & value )
noexcept

Write value to the field of type T located offset bytes into base.

Definition at line 35 of file MemoryAccess.hpp.

References MemberPtr().

◆ WriteGameDataRecord()

void VoltMod::WriteGameDataRecord ( const GameDataRecord & resolved)

Write resolved to addons/voltmod/gamedata/dumps/resolved.json once per build; failures only log.

Definition at line 37 of file GameDataRecord.cpp.

References VoltMod::GameDataRecord::Build, GameBuild(), VoltMod::Log::Info(), VoltMod::Json::ReadFile(), VoltMod::Log::Warn(), WriteAllText(), and VoltMod::Json::WritePretty().

Referenced by VoltMod::GameDataTable::GameDataTable().

◆ YawToForward()

Vector VoltMod::YawToForward ( float yaw)

The level unit vector heading yaw degrees.

Definition at line 16 of file Math.cpp.

References DegreesPerRadian.

Variable Documentation

◆ AllTeams

int VoltMod::AllTeams = -1
staticconstexpr

Definition at line 25 of file Vote.cpp.

Referenced by VoltMod::Vote::Start().

◆ BaseEntrySize

size_t VoltMod::BaseEntrySize = 2 * sizeof(void*)
staticconstexpr

Definition at line 121 of file VtableLookup.cpp.

Referenced by BaseCount(), and CollectBases().

◆ BaseMemberOffset

size_t VoltMod::BaseMemberOffset = 0x08
staticconstexpr

Definition at line 27 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti().

◆ BaseSize

size_t VoltMod::BaseSize = 0x18
staticconstexpr

Definition at line 29 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti().

◆ BaseVirtualOffset

size_t VoltMod::BaseVirtualOffset = 0x0C
staticconstexpr

Definition at line 28 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti().

◆ Blank

std::string_view VoltMod::Blank = " \t\r"
staticconstexpr

Definition at line 9 of file GameSearchPaths.cpp.

Referenced by NextWord().

◆ CenterHtmlKeepAliveMs

int64_t VoltMod::CenterHtmlKeepAliveMs = 250
inlineconstexpr

How often an unchanged center-HTML page is sent again: CS2 drops it on death, a team switch and HUD updates.

Definition at line 17 of file CenterHtml.hpp.

Referenced by VoltMod::CenterHtml::Show().

◆ CenterHtmlRowsPerPage

int VoltMod::CenterHtmlRowsPerPage = 5
inlineconstexpr

Rows one center-HTML page holds. A renderer limit, not a menu-model limit.

Definition at line 13 of file CenterHtmlRender.hpp.

Referenced by RenderMenuHtml().

◆ ClassAbsent

int32_t VoltMod::ClassAbsent = 0
staticconstexpr

EHudPanelClassStatus_t values.

Definition at line 17 of file ScreenEntitySetters.cpp.

◆ ClassPresent

int32_t VoltMod::ClassPresent = 1
staticconstexpr

Definition at line 18 of file ScreenEntitySetters.cpp.

◆ CommandUsage

std::string_view VoltMod::CommandUsage
staticconstexpr
Initial value:
=
"volt version | list | status [name] | load <name> | unload <name> | reload <name> | "
"log <name> <info|warn|error>"

Definition at line 15 of file VoltCommand.cpp.

Referenced by VoltMod::VoltCommand::VoltCommand().

◆ ControllerClass [1/2]

std::string_view VoltMod::ControllerClass = "cs_player_controller"
staticconstexpr

Definition at line 20 of file EntitySystem.cpp.

◆ ControllerClass [2/2]

std::string_view VoltMod::ControllerClass = "vote_controller"
staticconstexpr

Definition at line 19 of file Vote.cpp.

◆ DegreesPerRadian

float VoltMod::DegreesPerRadian = 180.0f / std::numbers::pi_v<float>
inlineconstexpr

Definition at line 17 of file Math.hpp.

Referenced by AngleTo(), VoltMod::Axes::ToAngles(), and YawToForward().

◆ DownloadTimeoutSeconds

double VoltMod::DownloadTimeoutSeconds = 30.0
staticconstexpr

How soon a client must reconnect for its addon to count as downloaded.

Definition at line 23 of file WorkshopDownloads.cpp.

Referenced by VoltMod::WorkshopDownloads::OnClientConnected().

◆ EnumCount

template<class E>
std::size_t VoltMod::EnumCount = magic_enum::enum_count<E>()
inlineconstexpr

How many enumerators E declares.

Definition at line 53 of file EnumNames.hpp.

Referenced by EnumIndex().

◆ EveryoneSlot

int VoltMod::EveryoneSlot = -1
inlineconstexpr

The slot value meaning everyone: a layout's global state rather than one player's.

Definition at line 10 of file Slot.hpp.

◆ ForgetAfterSeconds

double VoltMod::ForgetAfterSeconds = 12.0 * 60.0 * 60.0
staticconstexpr

A player back within this long is not asked to download again.

Definition at line 27 of file WorkshopDownloads.cpp.

Referenced by VoltMod::WorkshopDownloads::OnClientDisconnected().

◆ g_baseDir

std::filesystem::path VoltMod::g_baseDir
static

Definition at line 7 of file Paths.cpp.

Referenced by ResolvePath(), and SetBaseDir().

◆ g_connect

bool(* VoltMod::g_connect) (void *config, InterfaceFactory engineFactory) ( void * config,
InterfaceFactory engineFactory ) = nullptr
static

Definition at line 30 of file Loader.cpp.

Referenced by OnConnect(), and Patch().

◆ g_disconnect

void(* VoltMod::g_disconnect) (void *config) ( void * config) = nullptr
static

Definition at line 31 of file Loader.cpp.

Referenced by OnDisconnect(), and Patch().

◆ g_dispatcher

KHookForwarder VoltMod::g_dispatcher
static

Definition at line 24 of file Loader.cpp.

◆ g_gameDir

std::string VoltMod::g_gameDir
static

Definition at line 25 of file Loader.cpp.

Referenced by LoadNextServer().

◆ g_host

Host VoltMod::g_host
static

Definition at line 131 of file Host.cpp.

Referenced by VoltMod_HostStart(), and VoltMod_HostStop().

◆ g_init

InitReturnVal_t(* VoltMod::g_init) (void *server) ( void * server) = nullptr
static

Definition at line 32 of file Loader.cpp.

Referenced by OnInit(), and Patch().

◆ g_shutdown

void(* VoltMod::g_shutdown) (void *server) ( void * server) = nullptr
static

Definition at line 33 of file Loader.cpp.

Referenced by OnShutdown(), and Patch().

◆ g_start

LoaderHandoff VoltMod::g_start {.HookDispatcher = &g_dispatcher}
static

Definition at line 26 of file Loader.cpp.

Referenced by LoadNextServer(), OnConnect(), Patch(), and StartHost().

◆ g_stopHost

HostStopFn VoltMod::g_stopHost = nullptr
static

Definition at line 27 of file Loader.cpp.

Referenced by StartHost(), and StopHost().

◆ GameDataPath

std::string_view VoltMod::GameDataPath = "addons/voltmod/gamedata/gamedata.jsonc"
staticconstexpr

Definition at line 36 of file Host.cpp.

Referenced by VoltMod::Host::Start().

◆ GlowStateAlwaysOn

int VoltMod::GlowStateAlwaysOn = 3
staticconstexpr

Definition at line 12 of file EntitySystemSpawn.cpp.

◆ GlowTeamAny

int VoltMod::GlowTeamAny = -1
staticconstexpr

Definition at line 11 of file EntitySystemSpawn.cpp.

◆ HierarchyBaseCount

size_t VoltMod::HierarchyBaseCount = 0x08
staticconstexpr

Definition at line 24 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti().

◆ HierarchyBaseList

size_t VoltMod::HierarchyBaseList = 0x0C
staticconstexpr

Definition at line 25 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti().

◆ HierarchySize

size_t VoltMod::HierarchySize = 0x10
staticconstexpr

Definition at line 26 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti().

◆ HoldFireStep

int VoltMod::HoldFireStep = 12
staticconstexpr

Definition at line 25 of file Pawn.cpp.

Referenced by HoldFireTick().

◆ HoldFireTicks

int VoltMod::HoldFireTicks = 24
staticconstexpr

Definition at line 24 of file Pawn.cpp.

Referenced by HoldFireTick().

◆ HostFile

std::string_view VoltMod::HostFile = VOLTMOD_HOST_FILE
inlineconstexpr

Definition at line 18 of file Loader.hpp.

Referenced by StartHost().

◆ HostStartName

const char* VoltMod::HostStartName = "VoltMod_HostStart"
inlineconstexpr

Definition at line 26 of file LoaderHandoff.hpp.

Referenced by StartHost().

◆ HostStopName

const char* VoltMod::HostStopName = "VoltMod_HostStop"
inlineconstexpr

Definition at line 27 of file LoaderHandoff.hpp.

Referenced by StartHost().

◆ InMemory

std::string_view VoltMod::InMemory = ":memory:"
staticconstexpr

Definition at line 33 of file OpenConnection.cpp.

Referenced by OpenConnection(), and SqliteSettings().

◆ IsMariaDb

template<class Conn>
bool VoltMod::IsMariaDb = std::same_as<std::remove_cvref_t<Conn>, MariaDbConnection>
inlineconstexpr

Definition at line 31 of file Connection.hpp.

Referenced by RunMigrations().

◆ IsOptionalArg

template<class T>
bool VoltMod::IsOptionalArg = false
inlineconstexpr

Whether T is an Args::Opt.

Definition at line 191 of file Args.hpp.

◆ IsOptionalArg< Args::Opt< T > >

template<class T>
bool VoltMod::IsOptionalArg< Args::Opt< T > > = true
inlineconstexpr

Definition at line 193 of file Args.hpp.

◆ IsPostgres

template<class Conn>
bool VoltMod::IsPostgres = std::same_as<std::remove_cvref_t<Conn>, PostgresConnection>
inlineconstexpr

Dialect tests for the if constexpr branches of a job body run against auto& conn.

Definition at line 28 of file Connection.hpp.

Referenced by Insert(), and RunMigrations().

◆ IsSqlite

template<class Conn>
bool VoltMod::IsSqlite = std::same_as<std::remove_cvref_t<Conn>, SqliteConnection>
inlineconstexpr

Definition at line 34 of file Connection.hpp.

Referenced by RunMigrations().

◆ kBreadcrumbSeparator

std::string_view VoltMod::kBreadcrumbSeparator = " › "
staticconstexpr

Definition at line 10 of file MenuStack.cpp.

◆ KeySeparator

char VoltMod::KeySeparator = '\x1f'
staticconstexpr

Separates the parts of a key; not legal in an element id or a variable name.

Definition at line 7 of file WriteCache.cpp.

◆ LibrarySuffix

std::string_view VoltMod::LibrarySuffix = ".so"
staticconstexpr

Definition at line 20 of file PluginLoader.cpp.

Referenced by LibraryPath().

◆ LocatorHierarchy

size_t VoltMod::LocatorHierarchy = 0x10
staticconstexpr

Definition at line 21 of file VtableLookup.windows.cpp.

Referenced by FindBaseInRtti().

◆ LocatorOffset

size_t VoltMod::LocatorOffset = 0x04
staticconstexpr

Definition at line 19 of file VtableLookup.windows.cpp.

Referenced by FindLocator().

◆ LocatorSelf

size_t VoltMod::LocatorSelf = 0x14
staticconstexpr

Definition at line 22 of file VtableLookup.windows.cpp.

Referenced by FindLocator().

◆ LocatorSize

size_t VoltMod::LocatorSize = 0x18
staticconstexpr

Definition at line 23 of file VtableLookup.windows.cpp.

Referenced by FindLocator().

◆ LocatorTypeDescriptor

size_t VoltMod::LocatorTypeDescriptor = 0x0C
staticconstexpr

Definition at line 20 of file VtableLookup.windows.cpp.

Referenced by FindLocator().

◆ ManifestName

std::string_view VoltMod::ManifestName = "plugin.json"
staticconstexpr

Definition at line 45 of file InstalledPlugins.cpp.

Referenced by VoltMod::InstalledPlugins::Discover().

◆ MaxBases [1/2]

uint32_t VoltMod::MaxBases = 64
staticconstexpr

Definition at line 124 of file VtableLookup.cpp.

Referenced by BaseCount(), and FindBaseInRtti().

◆ MaxBases [2/2]

uint32_t VoltMod::MaxBases = 1024
staticconstexpr

Definition at line 30 of file VtableLookup.windows.cpp.

◆ MaxDepth

int VoltMod::MaxDepth = 32
staticconstexpr

Definition at line 125 of file VtableLookup.cpp.

Referenced by CollectBases().

◆ MaxDownloadAttempts

int VoltMod::MaxDownloadAttempts = 3
staticconstexpr

Offers of one addon before a declining client is dropped.

Definition at line 25 of file WorkshopDownloads.cpp.

◆ MaxIndicesPerPlayer

int VoltMod::MaxIndicesPerPlayer = 24
staticconstexpr

Definition at line 16 of file Visibility.cpp.

Referenced by AddHandleVector(), and AddIndex().

◆ MaxPlayers

◆ MaxQueuedJobs

size_t VoltMod::MaxQueuedJobs = 4096
staticconstexpr

Jobs beyond this are refused while the database stalls.

Definition at line 10 of file Client.cpp.

◆ MaxScale

float VoltMod::MaxScale = 3.0f
staticconstexpr

Definition at line 46 of file Entity.cpp.

Referenced by VoltMod::Entity::SetScale().

◆ MaxWaiting

size_t VoltMod::MaxWaiting = 64
staticconstexpr

Requests beyond this many waiting fail at once.

Definition at line 20 of file HttpClient.cpp.

Referenced by VoltMod::HttpClient::Send().

◆ MaxWorkers

size_t VoltMod::MaxWorkers = 4
staticconstexpr

Definition at line 18 of file HttpClient.cpp.

Referenced by VoltMod::HttpClient::Send().

◆ MinScale

float VoltMod::MinScale = 0.05f
staticconstexpr

Definition at line 45 of file Entity.cpp.

Referenced by VoltMod::Entity::SetScale().

◆ NoIssue

int VoltMod::NoIssue = -1
staticconstexpr

Definition at line 24 of file Vote.cpp.

◆ NoOption

int VoltMod::NoOption = 1
staticconstexpr

Definition at line 29 of file Vote.cpp.

Referenced by VoltMod::Vote::TryCastBallot().

◆ OutlineRenderAmount

int VoltMod::OutlineRenderAmount = 1
staticconstexpr

Definition at line 14 of file EntitySystemSpawn.cpp.

◆ PlatformDir

std::string_view VoltMod::PlatformDir = VOLTMOD_BIN_DIR
inlineconstexpr

Definition at line 17 of file Loader.hpp.

Referenced by LoadNextServer().

◆ PlatformName

std::string_view VoltMod::PlatformName = "linux"
inlineconstexpr

Definition at line 76 of file GameDataDocument.hpp.

Referenced by ColumnValue().

◆ PluginEntryName

const char* VoltMod::PluginEntryName = "VoltMod_Plugin"
inlineconstexpr

The one symbol the host resolves in a plugin library. A new name whenever the descriptor's layout changes, so an older library is never read.

Definition at line 36 of file PluginDescriptor.hpp.

Referenced by ValidateDescriptor().

◆ PropSpawnFlags

int VoltMod::PropSpawnFlags = 256
staticconstexpr

Definition at line 11 of file GlowVision.cpp.

◆ ReconnectBackoff

auto VoltMod::ReconnectBackoff = std::chrono::seconds(5)
staticconstexpr

After a failed connect, jobs fail at once for this long.

Definition at line 12 of file Client.cpp.

◆ Rel32Size

int VoltMod::Rel32Size = 4
inlineconstexpr

Definition at line 17 of file RelativeAddress.hpp.

Referenced by Rel32ReadInBounds(), and Rel32Target().

◆ ServerFile

std::string_view VoltMod::ServerFile = "libserver.so"
inlineconstexpr

Definition at line 22 of file Loader.hpp.

Referenced by LoadNextServer().

◆ SightMask

uint64_t VoltMod::SightMask = CONTENTS_SOLID | CONTENTS_BLOCK_LOS
staticconstexpr

Windows are see-through and clips are invisible, so neither hides a player.

Definition at line 16 of file Trace.cpp.

Referenced by Mask().

◆ SourceExtension

std::string_view VoltMod::SourceExtension = ".xml"
staticconstexpr

Definition at line 8 of file LayoutPath.cpp.

Referenced by VoltMod::LayoutPath::Name(), and VoltMod::LayoutPath::Parse().

◆ SslModes

SslModeName VoltMod::SslModes[]
staticconstexpr
Initial value:
= {
{"disable", PostgresSslMode::disable}, {"allow", PostgresSslMode::allow},
{"prefer", PostgresSslMode::prefer}, {"require", PostgresSslMode::require},
{"verify-ca", PostgresSslMode::verify_ca}, {"verify-full", PostgresSslMode::verify_full},
}

Definition at line 23 of file OpenConnection.cpp.

Referenced by ParseSslMode().

◆ StringTableCap

int VoltMod::StringTableCap = 1024
staticconstexpr

CS2 refuses to intern past this many entries per table; stop short so a runaway caller cannot fill them.

Definition at line 21 of file ScreenEntitySetters.cpp.

◆ StringTableHeadroom

int VoltMod::StringTableHeadroom = 64
staticconstexpr

Definition at line 22 of file ScreenEntitySetters.cpp.

◆ SurfacesMask

uint64_t VoltMod::SurfacesMask = CONTENTS_SOLID | CONTENTS_WINDOW | CONTENTS_PASS_BULLETS | CONTENTS_SKY
staticconstexpr

Definition at line 17 of file Trace.cpp.

Referenced by Mask().

◆ TargetSentToClients

int VoltMod::TargetSentToClients = 1
staticconstexpr

Definition at line 16 of file EntitySystemSpawn.cpp.

Referenced by VoltMod::EntitySystem::SpawnLine().

◆ TlsModes

PostgresSslMode VoltMod::TlsModes[]
staticconstexpr
Initial value:
= {PostgresSslMode::require, PostgresSslMode::verify_ca,
PostgresSslMode::verify_full}

The modes MariaDB, which takes a bool, reads as "the connection must use TLS".

Definition at line 30 of file OpenConnection.cpp.

Referenced by MariaDbSettings().

◆ TypeDescriptorName

size_t VoltMod::TypeDescriptorName = 0x10
staticconstexpr

Definition at line 18 of file VtableLookup.windows.cpp.

Referenced by FindTypeDescriptor(), and TypeDescriptorMatches().

◆ TypeInfoBase

size_t VoltMod::TypeInfoBase = 2 * sizeof(void*)
staticconstexpr

Definition at line 117 of file VtableLookup.cpp.

Referenced by CollectBases(), and HasSingleBase().

◆ TypeInfoBaseList

size_t VoltMod::TypeInfoBaseList = 3 * sizeof(void*)
staticconstexpr

Definition at line 120 of file VtableLookup.cpp.

Referenced by BaseCount(), and CollectBases().

◆ TypeInfoCount

size_t VoltMod::TypeInfoCount = TypeInfoFlags + sizeof(uint32_t)
staticconstexpr

Definition at line 119 of file VtableLookup.cpp.

Referenced by BaseCount().

◆ TypeInfoFlags

size_t VoltMod::TypeInfoFlags = 2 * sizeof(void*)
staticconstexpr

Definition at line 118 of file VtableLookup.cpp.

Referenced by BaseCount().

◆ UserMessageName

const char* VoltMod::UserMessageName = "CSVCMsg_UserMessage"
staticconstexpr

Definition at line 21 of file ButtonPresses.cpp.

◆ VirtualBaseFlag

uintptr_t VoltMod::VirtualBaseFlag = 1
staticconstexpr

Definition at line 122 of file VtableLookup.cpp.

Referenced by CollectBases().

◆ VoteFailedMessage

std::string_view VoltMod::VoteFailedMessage = "CCSUsrMsg_VoteFailed"
staticconstexpr

Definition at line 34 of file Vote.cpp.

◆ VotePassMessage

std::string_view VoltMod::VotePassMessage = "CCSUsrMsg_VotePass"
staticconstexpr

Definition at line 33 of file Vote.cpp.

◆ VoteStartMessage

std::string_view VoltMod::VoteStartMessage = "CCSUsrMsg_VoteStart"
staticconstexpr

Definition at line 32 of file Vote.cpp.

◆ WarningIntervalSeconds

int64_t VoltMod::WarningIntervalSeconds = 10
staticconstexpr

Definition at line 22 of file ButtonPresses.cpp.

Referenced by VoltMod::ButtonPresses::ButtonPresses().

◆ YesNoIssueIndex

int VoltMod::YesNoIssueIndex = 2
staticconstexpr

Definition at line 23 of file Vote.cpp.

Referenced by VoltMod::Vote::Start().

◆ YesOption

int VoltMod::YesOption = 0
staticconstexpr

Definition at line 28 of file Vote.cpp.

Referenced by VoltMod::Vote::TryCastBallot().