Skip to content

Fix get_rpc_config() missing return configurations #106705

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

Closed
wants to merge 1 commit into from

Conversation

dragonhunt02
Copy link

Fixes bug #105675 (comment) introduced by #96024

GDScript RPC configurations (set by @rpc annotations) are now returned by get_rpc_config() call.

Internal interface is kept stable by adding an optional parameter defaulting to false.
Exposed GDScript get_rpc_config() defaults to true, so default behaviour is changed to return attached GDScript configs too.

@dragonhunt02 dragonhunt02 requested review from a team as code owners May 22, 2025 03:30
@fire fire requested a review from a team May 22, 2025 04:59
@AThousandShips AThousandShips added bug regression topic:multiplayer cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release labels May 22, 2025
@AThousandShips AThousandShips added this to the 4.5 milestone May 22, 2025
@akien-mga akien-mga changed the title Fix get_rpc_config() missing return configurations Fix get_rpc_config() missing return configurations May 22, 2025
@dragonhunt02
Copy link
Author

Commits are squashed now

@Faless
Copy link
Collaborator

Faless commented May 26, 2025

Internal interface is kept stable by adding an optional parameter defaulting to false.

Adding a default parameter breaks the API for extensions (as reported by the check), so this would need a compatibility method.

I'm not sure I fully understand the issue, it appears that #96024 was changed after the initial review, and changed both the const-ness and the name, resulting in a somewhat more confusing API.

We should re-evaluate the original change and see what we can do about that.

@dragonhunt02
Copy link
Author

dragonhunt02 commented May 27, 2025

@Faless Thanks for your review. I read your new PR and the purpose of Node::get_node_rpc_config seems clear now in documentation.

From a Node, this gets functions with @rpc annotation

get_script().get_rpc_config()

this gets RPCs set with rpc_config()

get_node_rpc_config()

I think a utility method to get available rpcs of both Node and its Script could be useful still.
I may consider opening a different PR as enhancement in future.

Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived bug cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release topic:multiplayer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants