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

What each player, or everyone, was last sent on one screen, so an unchanged write is skipped. More...

#include <WriteCache.hpp>

Public Member Functions

bool Changed (int slot, WriteKind kind, std::string_view elementId, std::string_view name, std::string_view value)
bool ClassChanged (int slot, std::string_view elementId, std::string_view className, bool on)
bool IsClassOn (int slot, std::string_view elementId, std::string_view className)
bool CursorChanged (int slot, bool shown)
bool IsFirstFailure (int slot)
void Invalidate (int slot)
void RemoveSlot (int slot)
void ResetCursor (int slot)
void Clear ()

Detailed Description

What each player, or everyone, was last sent on one screen, so an unchanged write is skipped.

A networked layout stays on screen without re-sending, so this turns a full redraw into writes for only what changed. SDK-free for its tests.

Definition at line 26 of file WriteCache.hpp.

Member Function Documentation

◆ Changed()

bool VoltMod::WriteCache::Changed ( int slot,
WriteKind kind,
std::string_view elementId,
std::string_view name,
std::string_view value )

True when value differs from what slot (or EveryoneSlot) was last sent, remembering it.

Definition at line 34 of file WriteCache.cpp.

Referenced by ClassChanged().

◆ ClassChanged()

bool VoltMod::WriteCache::ClassChanged ( int slot,
std::string_view elementId,
std::string_view className,
bool on )

Changed for className on elementId turned on or off.

Definition at line 59 of file WriteCache.cpp.

References Changed(), VoltMod::Class, and VoltMod::ClassValue().

◆ Clear()

void VoltMod::WriteCache::Clear ( )

A new entity has been told nothing.

Definition at line 125 of file WriteCache.cpp.

◆ CursorChanged()

bool VoltMod::WriteCache::CursorChanged ( int slot,
bool shown )

True when shown differs from the cursor state slot was last sent, remembering it.

Definition at line 76 of file WriteCache.cpp.

◆ Invalidate()

void VoltMod::WriteCache::Invalidate ( int slot)

After a failed write, so the next one goes through. The failure still logs once.

Definition at line 100 of file WriteCache.cpp.

◆ IsClassOn()

bool VoltMod::WriteCache::IsClassOn ( int slot,
std::string_view elementId,
std::string_view className )

True when slot (or EveryoneSlot) was last sent className on for elementId.

Definition at line 64 of file WriteCache.cpp.

References VoltMod::Class, and VoltMod::ClassValue().

◆ IsFirstFailure()

bool VoltMod::WriteCache::IsFirstFailure ( int slot)

True the first time it is asked for slot, so a failure that repeats every frame logs once.

Definition at line 88 of file WriteCache.cpp.

◆ RemoveSlot()

void VoltMod::WriteCache::RemoveSlot ( int slot)

Another player took slot.

Definition at line 112 of file WriteCache.cpp.

◆ ResetCursor()

void VoltMod::WriteCache::ResetCursor ( int slot)

The game reset slot's cursor.

Definition at line 117 of file WriteCache.cpp.


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