![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
The ordered list of what replicates, agreed by both ends before play. More...
#include <schema.h>
Public Member Functions | |
| template<typename T> | |
| void | replicate (std::string name) |
Add T to what replicates. | |
| const std::vector< NetType > & | types () const |
| Everything registered, in wire order. | |
| int | indexOf (std::string_view name) const |
Wire index of name, or -1. | |
| uint32_t | fingerprint () const |
| A number that differs when the lists differ, or the codecs' layout does. | |
| std::string | describe () const |
| Every name in order, for the log line that follows a refusal. | |
| void | clear () |
| Drops everything. | |
Static Public Member Functions | |
| static NetSchema & | get () |
| The registry every end consults. Filled by ScriptModule::setupNetwork, read thereafter. | |
Static Public Attributes | |
| static constexpr size_t | MAX_TYPES = 32 |
| Most component types one game may replicate. | |
The ordered list of what replicates, agreed by both ends before play.
A component's wire identity is its index, so both ends must build the same list in order; a fingerprint mismatch is refused at join. Rebuilt by ScriptModule::setupNetwork: the engine's types, then the project's from the module's vkmSetupNetwork export.
| void Vkm::Engine::NetSchema::replicate | ( | std::string | name | ) |
| int Vkm::Engine::NetSchema::indexOf | ( | std::string_view | name | ) | const |
Wire index of name, or -1.
A linear search, so not for a per-entity path.
| name | The registered name. |
| uint32_t Vkm::Engine::NetSchema::fingerprint | ( | ) | const |
A number that differs when the lists differ, or the codecs' layout does.
Over order, names and the quantiser's steps and widths. Catches honest mismatches; not a security measure.
| std::string Vkm::Engine::NetSchema::describe | ( | ) | const |
Every name in order, for the log line that follows a refusal.
|
inline |
Drops everything.
For a game module being (re)loaded. Never mid-session: renumbering would decode every snapshot against the wrong type.
|
staticconstexpr |
Most component types one game may replicate.
One bit each in a snapshot entry's 32-bit mask.