diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-07-30 02:14:37 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-08-09 16:34:40 +0200 |
commit | 9fcf3b5a9c3036d7eaad02feaef85160abb7a075 (patch) | |
tree | 0a0063d16e0bf1f2281c4587fa6274484dd596d8 /scene/resources/default_theme/default_theme.cpp | |
parent | 9798d08ac2abcfcef79b3dd3cbae8d7c283c58d7 (diff) |
[Net] Basic extensible MultiplayerAPI spawn/despawn.
`PackedScene`s can be configured to be spawnable via a new
`MultiplayerAPI.spawnable_config` method.
They can be configured either to be spawned automatically when coming
from the server or to always require verification.
Another method, `MultiplayerAPI.send_spawn` lets you request a spawn on
the remote peers.
When a peer receive a spawn request:
- If it comes from the server and the scene is configured as
`SPAWN_MODE_SERVER`:
- Spawn the scene (instantiate it, add it to tree).
- Emit signal `network_spawn`.
- Else:
- Emit signal `network_spawn_request`.
In a similar way, `despawn`s are handled automatically in
`SPAWN_MODE_SERVER`.
In `SPAWN_MODE_SERVER`, when a new client connects it will also receive,
from the server all the spawned (and not yet despawned) instances.
Diffstat (limited to 'scene/resources/default_theme/default_theme.cpp')
0 files changed, 0 insertions, 0 deletions