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

The button id a custom HUD Button press carries, read out of a user message's msg_data. More...

#include <ButtonPressMessage.hpp>

Static Public Member Functions

static Result< ButtonPressMessage > Parse (std::string_view bytes)
 

Public Attributes

std::string ButtonId
 field 2, length-delimited: the Button's id attribute
 

Detailed Description

The button id a custom HUD Button press carries, read out of a user message's msg_data.

Hand-parsed: the body is not a registered message and the SDK's protos do not declare it, so there is nothing to reflect on. Every other field is skipped, so a field CS2 adds later does not stop the id from being read. SDK-free for its tests.

Definition at line 17 of file ButtonPressMessage.hpp.

Member Function Documentation

◆ Parse()

Result< ButtonPressMessage > VoltMod::ButtonPressMessage::Parse ( std::string_view  bytes)
static

Error::Invalid when the bytes are not well-formed protobuf, a length runs past the end, or the button id is missing or carries the wrong wire type.

Definition at line 83 of file ButtonPressMessage.cpp.

References VoltMod::Error::Invalid(), VoltMod::ReadFile(), VoltMod::ReadVarint(), VoltMod::SkipField(), and VoltMod::WireLengthDelimited.

Member Data Documentation

◆ ButtonId

std::string VoltMod::ButtonPressMessage::ButtonId

field 2, length-delimited: the Button's id attribute

Definition at line 23 of file ButtonPressMessage.hpp.


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