diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-08-09 22:46:23 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-08-18 10:21:29 +0100 |
commit | d4dd859991205e6cecfa9a0553b89db47c983d0b (patch) | |
tree | e69020f0586cfecda02934dc95017373fddb2616 /main/main.cpp | |
parent | a03157928622b8c4048ede29cd6f1a40df893d1b (diff) |
[Net] MultiplayerReplicator with initial state.
Move the former "spawnables" functions to a dedicated
MultiplayerReplicator class.
Support custom overrides in replicator.
Spawn/despawn messages can now contain a state.
The state can be automatically encoded/decoded by passing the desired
object properties to `spawnable_config`.
You can use script properties to optimize the state representation.
2 Callables can be also specified to completely override the default
implementation for sending and receiving the spawn/despawn event.
(9 bytes overhead, and there's room for improvement here).
When using a custom implementation `spawn` and `despawn` can be called
with any Object, `send_spawn`/`send_despawn` can receive any Variant as
a state, and the path is not required.
Two new functions, `spawn` and `despawn`, convey the implementation
independent method for requesting a spawn/despawn of an Object, while
`send_spawn` and `send_despawn` represent the more low-level send event
for a Variant to be used by the custom implementations.
Diffstat (limited to 'main/main.cpp')
0 files changed, 0 insertions, 0 deletions