|
VoltMod
C++23 framework for CS2 server plugins
|
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 () |
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.
| 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.
| 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().
| 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().
| void VoltMod::CenterHtml::StopAll | ( | ) |
Definition at line 51 of file CenterHtml.cpp.
References VoltMod::MaxPlayers, and Stop().