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

Fix MultiplayerAPI initialization, clear, set_network_peer. #25010

Merged
merged 2 commits into from
Jan 15, 2019

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Jan 15, 2019

rpc_sender_id is now correctly initialized to 0 so get_rpc_sender_id() work reliably even if called before receiving any RPC.
root_node is initialized to NULL (fix crashes when incorrectly using the MultiplayerAPI).
clear function now resets the packet cache size to free more memory when not running.

The call to set_network_peer is now ignored if the peer that's beeing set is the same as the currently set one:
A GDScript call to multiplayer.network_peer.some_prop = true seems to transalte to:

var temp = multiplayer.network_peer
temp.some_prop = true
multiplayer.network_peer = temp

(@vnen @reduz is that expected?)

Which caused the MultiplayerAPI to be resetted.

rpc_sender_id is now correctly initialized to 0 so get_rpc_sender_id()
work reliably even if called before receiving any RPC.
root_node is initialized to NULL (fix crashes when incorrectly using the
MultiplayerAPI).
clear function now resets the packet cache size to free more memory when
not running.
A GDScript call to:
`multiplayer.network_peer.some_prop = true`
seems to transalte to:
```
var temp = multiplayer.network_peer
temp.some_prop = true
multiplayer.network_peer = temp
```
Which caused the MultiplayerAPI to be resetted.
The call to set_network_peer is now ignored if the peer that's beeing
set is the same as the currently set one.
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akien-mga akien-mga merged commit d8cca33 into godotengine:master Jan 15, 2019
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants