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

Rpc attributes do not work correctly with overloaded methods in C# #40700

Open
Beider opened this issue Jul 25, 2020 · 0 comments
Open

Rpc attributes do not work correctly with overloaded methods in C# #40700

Beider opened this issue Jul 25, 2020 · 0 comments

Comments

@Beider
Copy link

Beider commented Jul 25, 2020

Godot version:
3.2.2 Stable

OS/device including version:
Windows 10 64-bit

Issue description:
I have an overloaded method in my C# code that I tried to send an RPC message to, I had only the overloaded method with two parameters tagged for rpc.

    // With a [Remote] keyword here it works
    private void Log(String Text)
    {
        Log(Text, Colors.White);
    }

    [Remote]
    private void Log(String Text, Color Color)
    {
        LogText.Log(Text, Color);
        if (MDStatics.IsServer())
        {
            Rpc(nameof(Log), Text, Color);
        }
    }

As you can see it attempts to call itself, however when you don't have a [Remote] keyword on the Log(String Text) I get the following errors on my clients:

ERROR: RPC 'Log' is not allowed on node /root/AutomaticTestsMain from: 1. Mode is 0, master is 1.
   At: core/io/multiplayer_api.cpp:291
ERROR: RPC 'Log' is not allowed on node /root/AutomaticTestsMain from: 1. Mode is 0, master is 1.
   At: core/io/multiplayer_api.cpp:291

Steps to reproduce:
Setup a network connection between two clients, have an overloaded method where you only tag one of them with [Remote] and it should be fairly easy to reproduce.

Minimal reproduction project:
I do not have one as I am using a framework for all my networking which means extracting this and setting it up as a standalone project would be more work than I got time for at the moment.

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

No branches or pull requests

4 participants