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 CursorChanged (int slot, bool shown)
 
bool IsFirstFailure (int slot)
 
void Invalidate (int slot)
 
void RemoveSlot (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 28 of file WriteCache.cpp.

References VoltMod::ReadFile().

Referenced by VoltMod::ScreenEntity::WriteClass(), and VoltMod::ScreenEntity::WriteText().

◆ Clear()

void VoltMod::WriteCache::Clear ( )

A new entity has been told nothing.

Definition at line 94 of file WriteCache.cpp.

References VoltMod::PerSlot< T >::ResetAll().

Referenced by VoltMod::ScreenEntity::Remove().

◆ 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 53 of file WriteCache.cpp.

References VoltMod::ReadFile().

Referenced by VoltMod::ScreenEntity::WriteCursor().

◆ 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 77 of file WriteCache.cpp.

References VoltMod::ReadFile().

◆ 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 65 of file WriteCache.cpp.

References VoltMod::ReadFile().

◆ RemoveSlot()

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

Another player took slot.

Definition at line 89 of file WriteCache.cpp.

References VoltMod::ReadFile(), and VoltMod::PerSlot< T >::Reset().

Referenced by VoltMod::ScreenEntity::ScreenEntity().


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