|
VoltMod
C++23 framework for CS2 server plugins
|
Framework services for one load and unload cycle. More...
#include <Runtime.hpp>
Public Member Functions | |
| Runtime (IPluginContext &host, UnsafeServices &unsafe, PlayerLanguages &languages) | |
| ~Runtime () | |
| Runtime (const Runtime &)=delete | |
| Runtime & | operator= (const Runtime &)=delete |
| void | OnGameFrame () |
| std::string | PluginFile (std::string_view relative) const |
| Subscription | UsePanorama (PanoramaMenuLayout &layout) |
Framework services for one load and unload cycle.
Members are declared in dependency order, and each engine service does its setup when built; a feature that did not bind says why in its Available() and in LoadReport. Screens follow the hook tiers so their hooks are removed first.
Definition at line 56 of file Runtime.hpp.
| VoltMod::Runtime::Runtime | ( | IPluginContext & | host, |
| UnsafeServices & | unsafe, | ||
| PlayerLanguages & | languages | ||
| ) |
host, unsafe and languages outlive the runtime; the plugin module opened unsafe first.
Definition at line 38 of file Runtime.cpp.
References VoltMod::ListenForCommands(), and VoltMod::ReadFile().
| VoltMod::Runtime::~Runtime | ( | ) |
Definition at line 68 of file Runtime.cpp.
References VoltMod::Log::DeliverPending(), Http, and VoltMod::HttpClient::Stop().
| void VoltMod::Runtime::OnGameFrame | ( | ) |
Drive the scheduler. Called once per frame from the GameFrame hook.
Definition at line 136 of file Runtime.cpp.
References VoltMod::Log::DeliverPending(), and VoltMod::Scheduler::OnGameFrame().
| std::string VoltMod::Runtime::PluginFile | ( | std::string_view | relative | ) | const |
"addons/voltmod/plugins/<PluginName>/<relative>".
Definition at line 75 of file Runtime.cpp.
References VoltMod::PluginFile(), PluginName, and VoltMod::ReadFile().
| Subscription VoltMod::Runtime::UsePanorama | ( | PanoramaMenuLayout & | layout | ) |
Draw menus on layout for players who have it, center HTML for the rest, while the returned Subscription lives. Hold it below layout, which the menu refers to. A player still downloading a required addon gets center HTML.
Definition at line 80 of file Runtime.cpp.
References AddonManager, ChatInput, Freeze, Menus, Policy, VoltMod::MenuRouter::Prefer(), VoltMod::ReadFile(), VoltMod::PanoramaMenu::Services::Scheduler, Scheduler, Screens, Slots, and Translations.
| MultiAddonManager VoltMod::Runtime::AddonManager |
Definition at line 160 of file Runtime.hpp.
Referenced by UsePanorama().
| CenterHtmlMenu VoltMod::Runtime::CenterHtml |
Definition at line 167 of file Runtime.hpp.
| VoltMod::ChatInput VoltMod::Runtime::ChatInput {Scheduler, Slots} |
The next chat line from a player, for menu prompts.
Definition at line 141 of file Runtime.hpp.
Referenced by UsePanorama().
| VoltMod::ClientConVars VoltMod::Runtime::ClientConVars {Unsafe.Interfaces, Unsafe.Bindings, Slots} |
Ask a client for one of its own convars.
Definition at line 149 of file Runtime.hpp.
| VoltMod::Clock VoltMod::Runtime::Clock {Unsafe.Interfaces} |
Definition at line 120 of file Runtime.hpp.
| VoltMod::CommandManager VoltMod::Runtime::Commands |
Definition at line 179 of file Runtime.hpp.
| VoltMod::ConVars VoltMod::Runtime::ConVars {Unsafe.Interfaces} |
Definition at line 110 of file Runtime.hpp.
| VoltMod::Damage VoltMod::Runtime::Damage {Entities, Unsafe.Bindings, Unsafe.Interfaces, GameEvents} |
Definition at line 154 of file Runtime.hpp.
| EntitySystem VoltMod::Runtime::Entities {Unsafe.Interfaces, Unsafe.Bindings} |
Schema field offsets resolve themselves, per process rather than per load - see Field.
Definition at line 101 of file Runtime.hpp.
| ServiceExchange VoltMod::Runtime::Exchange |
Definition at line 162 of file Runtime.hpp.
| VoltMod::MenuFreeze VoltMod::Runtime::Freeze {Entities, Scheduler, Slots} |
Holds players still while a menu is open. Disabled by default.
Definition at line 165 of file Runtime.hpp.
Referenced by UsePanorama().
| VoltMod::GameEvents VoltMod::Runtime::GameEvents {Unsafe.Interfaces, Unsafe.Bindings} |
Definition at line 116 of file Runtime.hpp.
| HttpClient VoltMod::Runtime::Http {Scheduler} |
HTTP client. Completions are replayed on the game thread.
Definition at line 182 of file Runtime.hpp.
Referenced by ~Runtime().
| VoltMod::LoadReport VoltMod::Runtime::LoadReport |
Definition at line 83 of file Runtime.hpp.
| VoltMod::Map VoltMod::Runtime::Map {Unsafe.Interfaces, ConVars} |
Map validation and level changes. The current map is captured from StartupServer, so it is empty after a late load until the next map change.
Definition at line 114 of file Runtime.hpp.
| MenuRouter VoltMod::Runtime::Menus {CenterHtml} |
Routes menus to center HTML or a plugin-preferred surface.
Definition at line 177 of file Runtime.hpp.
Referenced by UsePanorama().
| VoltMod::Messages VoltMod::Runtime::Messages {Unsafe.Interfaces, GameEvents, Translations} |
Definition at line 118 of file Runtime.hpp.
| VoltMod::Movement VoltMod::Runtime::Movement |
Per-player usercmds from the host's RunCommand hook, listened to while subscribed.
Definition at line 135 of file Runtime.hpp.
| VoltMod::NetChannels VoltMod::Runtime::NetChannels {Unsafe.Interfaces} |
Per-client latency and replicated userinfo cvars.
Definition at line 126 of file Runtime.hpp.
| PlayerManager VoltMod::Runtime::Players {Slots, &Entities} |
Definition at line 103 of file Runtime.hpp.
| const std::string VoltMod::Runtime::PluginName |
The plugin's plugin.json name and directory under addons/voltmod/plugins/.
Definition at line 69 of file Runtime.hpp.
Referenced by PluginFile().
| VoltMod::Policy VoltMod::Runtime::Policy {Players} |
Plugin-supplied permission, targeting and reply rules, and the one gate that applies them (Policy::Authorize). HasPermission asks whichever plugin publishes IPermissions until a plugin sets its own.
Definition at line 108 of file Runtime.hpp.
Referenced by UsePanorama().
| VoltMod::Precache VoltMod::Runtime::Precache |
Resources for the next map's session manifest.
Definition at line 123 of file Runtime.hpp.
| VoltMod::Rounds VoltMod::Runtime::Rounds {Entities, Unsafe.Bindings, Clock} |
The round timer, and ending the current round with a winner.
Definition at line 132 of file Runtime.hpp.
| VoltMod::Scheduler VoltMod::Runtime::Scheduler |
Per-frame delivery, timers, and delayed work. Pending timers are discarded on destruction; their callbacks may capture only members declared above Scheduler.
Definition at line 93 of file Runtime.hpp.
Referenced by UsePanorama().
| VoltMod::ScreenManager VoltMod::Runtime::Screens |
Definition at line 158 of file Runtime.hpp.
Referenced by UsePanorama().
| SlotEvents VoltMod::Runtime::Slots |
Definition at line 87 of file Runtime.hpp.
Referenced by UsePanorama().
| StatusService VoltMod::Runtime::Status |
Definition at line 85 of file Runtime.hpp.
| VoltMod::Teleport VoltMod::Runtime::Teleport {Entities, Unsafe.Bindings} |
Definition at line 143 of file Runtime.hpp.
| VoltMod::TextMessages VoltMod::Runtime::TextMessages {Unsafe.Interfaces} |
Chat, center and alert lines on their way to the clients.
Definition at line 146 of file Runtime.hpp.
| VoltMod::Trace VoltMod::Runtime::Trace {Unsafe.Bindings} |
Line and box traces for sight and reachability questions.
Definition at line 129 of file Runtime.hpp.
| VoltMod::Translations VoltMod::Runtime::Translations |
Definition at line 95 of file Runtime.hpp.
Referenced by UsePanorama().
| UnsafeServices& VoltMod::Runtime::Unsafe |
The opt-in engine-access tier (Interfaces, Bindings), resolved before any service.
Definition at line 98 of file Runtime.hpp.
| const std::string VoltMod::Runtime::Version |
The plugin's plugin.json version.
Definition at line 71 of file Runtime.hpp.
| VoltMod::Visibility VoltMod::Runtime::Visibility {Entities, Unsafe.Bindings, Slots} |
Which clients receive which entities.
Definition at line 138 of file Runtime.hpp.
| VoltMod::Vote VoltMod::Runtime::Vote {Unsafe.Interfaces, Entities, Players, GameEvents, Scheduler} |
The game's yes/no vote panel.
Definition at line 152 of file Runtime.hpp.
| VoltMod::WeaponDrop VoltMod::Runtime::WeaponDrop {Entities, Unsafe.Bindings} |
Definition at line 156 of file Runtime.hpp.