VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::CenterHtml Class Reference

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...

#include <CenterHtml.hpp>

Public Member Functions

 CenterHtml (Messages &messages, Scheduler &scheduler, SlotEvents &slots)
void Show (int slot, int refreshMs, std::function< std::string(int slot)> render)
void Stop (int slot)
void StopAll ()

Detailed Description

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.

Definition at line 23 of file CenterHtml.hpp.

Constructor & Destructor Documentation

◆ CenterHtml()

VoltMod::CenterHtml::CenterHtml ( Messages & messages,
Scheduler & scheduler,
SlotEvents & slots )

slots stops a panel when its player leaves. All must outlive this.

Definition at line 12 of file CenterHtml.cpp.

Member Function Documentation

◆ Show()

void VoltMod::CenterHtml::Show ( int slot,
int refreshMs,
std::function< std::string(int slot)> render )

Render for slot every refreshMs and send what changed, replacing any panel shown.

Definition at line 16 of file CenterHtml.cpp.

References VoltMod::CenterHtmlKeepAliveMs, VoltMod::IsValidSlot(), VoltMod::Time::MonotonicMs(), and Stop().

◆ Stop()

void VoltMod::CenterHtml::Stop ( int slot)

Stop and clear the panel; safe when nothing is shown.

Definition at line 41 of file CenterHtml.cpp.

References VoltMod::IsValidSlot().

Referenced by Show(), and StopAll().

◆ StopAll()

void VoltMod::CenterHtml::StopAll ( )

Definition at line 51 of file CenterHtml.cpp.

References VoltMod::MaxPlayers, and Stop().


The documentation for this class was generated from the following files: