10#include <entity2/entitysystem.h>
12#include <igamesystem.h>
13#include <inetchannelinfo.h>
14#include <interfaces/interfaces.h>
18#include <tier1/bufferstring.h>
19#include <tier1/convar.h>
70 KHook::GetVtableIndex(&IGameSystem::OnBuildGameSessionManifest),
75 registry.RaiseBuildGameSessionManifest(
event->m_pResourceManifest);
104 _beforeServerStartup();
106 DisconnectEveryone();
127 _afterClientDisconnected(
static_cast<int64_t>(
xuid));
178 _beforeClientConnected(
static_cast<int64_t>(
xuid));
182void EngineHooks::DisconnectEveryone()
EngineHooks(PluginRegistry ®istry, const EngineInterfaces &engine, std::function< void()> beforeFrame, std::function< void()> beforeServerStartup, std::function< void(int64_t)> beforeClientConnected, std::function< void(int64_t)> afterClientDisconnected)
A hook before-handler's verdict.
static HookResult Block(Ret value)
The loaded plugins and the engine events raised on them, one per process.
void RaiseClientSettingsChanged(int slot)
void RaiseCheckTransmit(CCheckTransmitInfo **infoList, int infoCount)
void RaiseClientConnected(int slot, int64_t steamId, std::string_view name, std::string_view address)
void RaiseServerStartup(std::string_view mapName)
void RaiseClientFullyConnected(int slot)
void RaiseClientDisconnected(int slot)
bool IsConnected(int slot) const
Owns one registration and releases it on destruction.
void Add(Subscription subscription)
void Error(std::format_string< Args... > fmt, Args &&... args)
void Info(std::format_string< Args... > fmt, Args &&... args)
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.
@ Text
Not selectable; a caption or a summary line.
static HookResult< bool > AdmitClient(PluginRegistry ®istry, int slot, uint64_t xuid, std::string_view name, CBufferString *rejectReason)
static std::string ReadFile(const std::filesystem::path &path)
static HookResult< void > RunCommand(PluginRegistry ®istry, std::string_view name, const CCommand &arguments, int slot)
constexpr bool IsValidSlot(int slot)
static std::string_view ClientAddress(IVEngineServer2 *server, CPlayerSlot slot)
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.
static Result< Subscription > HookSessionManifest(PluginRegistry ®istry)
void * FindVirtualTable(std::string_view moduleName, std::string_view className)
std::expected< T, Error > Result