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

Mention Multiplayer.get_remote_sender_id's 0 after await #87610

Merged

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Jan 26, 2024

Closes #86719

It does not hurt to be more explicit. I considered adding a visual example but this looks good enough.

@Mickeon Mickeon requested a review from a team as a code owner January 26, 2024 11:31
@@ -34,7 +34,7 @@
<return type="int" />
<description>
Returns the sender's peer ID for the RPC currently being executed.
[b]Note:[/b] If not inside an RPC this method will return 0.
[b]Note:[/b] This method returns [code]0[/code] when called outside of an RPC. As such, the original peer ID may be lost when code execution is delayed (such as with GDScript's [code]await[/code] keyword).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternative take of the same line:

Suggested change
[b]Note:[/b] This method returns [code]0[/code] when called outside of an RPC. As such, the original peer ID may be lost when code execution is delayed (such as with GDScript's [code]await[/code] keyword).
[b]Note:[/b] This method returns [code]0[/code] when called outside of an RPC. Delaying code execution (such as with GDScript's [code]await[/code] keyword) may bring the RPC out of context.

Copy link
Member

Choose a reason for hiding this comment

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

I prefer the current one.

@akien-mga akien-mga merged commit 7515549 into godotengine:master Mar 10, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Mickeon Mickeon deleted the documentation-MultiplayerAPI-peer-id branch March 10, 2024 20:53
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.

multiplayer.get_remote_sender_id() returns 0 in an rpc after 'await'
3 participants