1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

[MP] New default multiplayer_peer acting as server.

Adds a OfflineMultiplayerPeer class which behaves like a server with no
connected peers.

Use OfflineMultiplayerPeer as default for SceneMultiplayer.

This means that the SceneTree will act as the multiplayer authority by
default.
Calls to is_server will return true, and calls to get_unique_id will
return TARGET_PEER_SERVER.
This commit is contained in:
Fabio Alessandrelli
2022-11-15 10:24:20 +01:00
parent 8aafcf9d2a
commit b19c1a2e4f
4 changed files with 39 additions and 0 deletions

View File

@@ -661,6 +661,7 @@ SceneMultiplayer::SceneMultiplayer() {
replicator = Ref<SceneReplicationInterface>(memnew(SceneReplicationInterface(this)));
rpc = Ref<SceneRPCInterface>(memnew(SceneRPCInterface(this)));
cache = Ref<SceneCacheInterface>(memnew(SceneCacheInterface(this)));
set_multiplayer_peer(Ref<OfflineMultiplayerPeer>(memnew(OfflineMultiplayerPeer)));
}
SceneMultiplayer::~SceneMultiplayer() {