Namespace Engine::Multiplayer¶
Namespace List > Engine > Multiplayer
Classes¶
| Type | Name |
|---|---|
| struct | ENetContext |
| class | MultiplayerPlugin Interface for plugins. |
| struct | NetSnapshot One timestamped transform sample received from the server. |
| class | NetworkHostResource |
| class | PacketRegistryResource stores the hash of a packet name |
| class | PacketRouterResource |
| struct | PlayerInformation |
| struct | PlayerInputState Server-side store of the latest input for every connected player. |
| struct | PlayerSlotState Maps connected players to a color slot (0-based). |
| struct | PredictedInput |
| class | ReplicationPlugin Registers NetworkComponent andReplicationSystem so entities can declare how they replicate across the network. |
| class | ReplicationSystem Declarative networking foundation. |
| struct | ScriptVariableState Per-entity fields replicated automatically by ReplicationSystem . |
| struct | YourPlayerId |
Public Types¶
| Type | Name |
|---|---|
| typedef std::vector< std::byte > | Buffer |
Public Attributes¶
| Type | Name |
|---|---|
| PacketTypeID | Connect = 2 |
| PacketTypeID | Disconnect = 3 |
| PacketTypeID | MaxPacketId = 0xFFFF |
| PacketTypeID | Ping = 0 |
| PacketTypeID | UserDefinedStart = 200 |
Public Functions¶
| Type | Name |
|---|---|
| void | ApplyReplicatedScriptVariables (Registry & registry, std::size_t networkId, Entity entity, const glz::generic::object_t & vars) Applies a replicated "vars" object on a client. |
| PacketTypeID | HashPacketName (const std::string_view name) Deterministic hash using the packet name std lib hash is implementation defined so a windows binary would not match a linux one. |
| bool | ReadScriptVariables (Registry & registry, Entity entity, const std::vector< std::string > & fields, glz::generic::object_t & out) Reads registered fields from an entity's loaded script table. |
| void | ResolvePendingScriptVariables (Registry & registry, Entity entity, std::size_t networkId) Applies pending values after a script registers with Net.sync. |
| bool | WriteScriptVariables (Registry & registry, Entity entity, const glz::generic::object_t & vars) Writes replicated fields into an entity's loaded script table. |
Public Types Documentation¶
typedef Buffer¶
Types used for the serializer/deserializer (glaze binary payloads).
Public Attributes Documentation¶
variable Connect¶
variable Disconnect¶
variable MaxPacketId¶
variable Ping¶
variable UserDefinedStart¶
Public Functions Documentation¶
function ApplyReplicatedScriptVariables¶
Applies a replicated "vars" object on a client.
void Engine::Multiplayer::ApplyReplicatedScriptVariables (
Registry & registry,
std::size_t networkId,
Entity entity,
const glz::generic::object_t & vars
)
Writes immediately when the script has registered; otherwise keeps the values pending until Net.sync runs during the script's onCreate.
function HashPacketName¶
Deterministic hash using the packet name std lib hash is implementation defined so a windows binary would not match a linux one.
function ReadScriptVariables¶
Reads registered fields from an entity's loaded script table.
bool Engine::Multiplayer::ReadScriptVariables (
Registry & registry,
Entity entity,
const std::vector< std::string > & fields,
glz::generic::object_t & out
)
Returns:
true when the entity has a loaded ScriptComponent, even if some fields were missing (missing fields are omitted from out).
function ResolvePendingScriptVariables¶
Applies pending values after a script registers with Net.sync.
void Engine::Multiplayer::ResolvePendingScriptVariables (
Registry & registry,
Entity entity,
std::size_t networkId
)
function WriteScriptVariables¶
Writes replicated fields into an entity's loaded script table.
bool Engine::Multiplayer::WriteScriptVariables (
Registry & registry,
Entity entity,
const glz::generic::object_t & vars
)
Returns:
true when the table was available and updated.
The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/ENetContext.hpp