KeyValueBuffer

From Sven Co-op
Revision as of 17:00, 6 March 2025 by Outerbeast (talk | contribs) (Created page with "KeyValueBuffer is a class that contains key value pairs. The game uses 2 types of keyvalue buffers: an info string and physics string. The info string buffer contains settings...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

KeyValueBuffer is a class that contains key value pairs. The game uses 2 types of keyvalue buffers: an info string and physics string. The info string buffer contains settings sent from the client to the server, such as their current player model, name and more. The physics string buffer contains settings that the physics code accesses. It contains settings such as whether the long jump module is available. You should not maintain a handle to KeyValueBuffer instances. When you are done using it, make sure no references exist remain.

Two methods return a KeyValueBuffer instance:

KeyValueBuffer@ GetInfoKeyBuffer(edict_t@ pEdict)
KeyValueBuffer@ GetPhysicsKeyBuffer(edict_t@ pEdict)
These methods are accessible via the CEngineFuncs class.

Methods

Method Description
edict_t@ GetClient() const Gets the client that this buffer belongs to.
string GetValue(const string& in szKey) const Gets a key value.
void SetValue(const string& in szKey, const string& in szValue) const Sets a key value.
void RemoveValue(const string& in szKey) Removes a key value. If this is a physics key buffer, this will set the key to an empty string instead.