Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing multiplayer_peer stops already spawned nodes from replicating #87184

Closed
Faless opened this issue Jan 14, 2024 · 0 comments · Fixed by #87185
Closed

Changing multiplayer_peer stops already spawned nodes from replicating #87184

Faless opened this issue Jan 14, 2024 · 0 comments · Fixed by #87185

Comments

@Faless
Copy link
Collaborator

Faless commented Jan 14, 2024

Originally posted by @masterthdev in #80701 (comment)

Changing MultiplayerAPI.multiplayer_peer resets tracked nodes too. After restarting server using code below, MultiplayerSpawners stop replicating existing nodes.

multiplayer.multiplayer_peer.close()
var peer := ENetMultiplayerPeer.new()
peer.create_server(port)
multiplayer.multiplayer_peer  = peer

When a client joins after restarting server, host logs these errors for each old node:

E 0:00:22:0468   _make_spawn_packet: Condition "!nid" is true. Returning: ERR_UNCONFIGURED
  <C++ Source>   modules/multiplayer/scene_replication_interface.cpp:479 @ _make_spawn_packet()
E 0:00:22:0468   _send_raw: Condition "!p_buffer || p_size < 1" is true. Returning: ERR_INVALID_PARAMETER
  <C++ Source>   modules/multiplayer/scene_replication_interface.cpp:462 @ _send_raw()
@Faless Faless changed the title Changing MultiplayerAPI.multiplayer_peer resets tracked nodes too. After restarting server using code below, MultiplayerSpawners stop replicating existing nodes. Changing multiplayer_peer stops replicating spawned nodes Jan 14, 2024
@Faless Faless added this to the 4.3 milestone Jan 14, 2024
@Faless Faless changed the title Changing multiplayer_peer stops replicating spawned nodes Changing multiplayer_peer stops already spawned nodes from replicating Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant