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 is broken in 4.4 dev2 #96889

Closed
jeadhz opened this issue Sep 12, 2024 · 15 comments · Fixed by #96915
Closed

RPC is broken in 4.4 dev2 #96889

jeadhz opened this issue Sep 12, 2024 · 15 comments · Fixed by #96915

Comments

@jeadhz
Copy link

jeadhz commented Sep 12, 2024

Tested versions

Only in 4.4 dev2
In 4.4 dev 1 or 4.3 it doesn't happen

System information

Windows 10, Godot 4.4-dev2

Issue description

This is happening in dev2 (dev1 is fine):
Screenshot (10)
There are 2 issues:

  1. RPC node checksum is failing (don't know why)
  2. All RPCs are being called with 0 or sometimes 1 argument

This is what happens in 4.4 dev1 and 4.3:
Screenshot (11)
As you can see, no errors and the project runs fine

ps: I don't know if this may have something to do with it but the editor's autocompletion for @rpc is broken

Steps to reproduce

Use a project with networking features in 4.4 dev2

  1. Run 2 instances of the game
  2. In one, host the game (there should be no errors yet)
  3. Join the game in the second one and there's where all errors should appear

Minimal reproduction project (MRP)

n/a

@QJPG
Copy link

QJPG commented Sep 12, 2024

I'm also having the same problem. I used "rpc_config" to try to fix it and it didn't work.

@akien-mga akien-mga changed the title RPC is broken in 4.2 dev2 RPC is broken in 4.4 dev2 Sep 12, 2024
@akien-mga akien-mga added this to the 4.4 milestone Sep 12, 2024
@akien-mga akien-mga moved this from Unassessed to Release Blocker in 4.x Release Blockers Sep 12, 2024
@Cykyrios
Copy link
Contributor

I tested on one of my projects, having the same issue. git bisect says this was introduced in 154049c.

@akien-mga
Copy link
Member

CC @rune-scape @godotengine/network

@akien-mga
Copy link
Member

This may have been fixed by #96586 after dev2, could you check in the latest master branch?

@Cykyrios
Copy link
Contributor

Cykyrios commented Sep 12, 2024

I can still reproduce this in v4.4.dev.custom_build [2c136e6].
Edit: I see a few more commits made their way into master, so still reproducible in 18cdfb8.

@Faless
Copy link
Collaborator

Faless commented Sep 12, 2024

Can someone provide a minimal reproduction project? I tried setting up one, but wasn't able reproduce the issue in dev2.

@Mopzilla
Copy link

also having this issue on my project

@Faless
Copy link
Collaborator

Faless commented Sep 12, 2024

I was able to reproduce on a bigger project, I think I understand what's going on, I'm working on a fix.

@QJPG
Copy link

QJPG commented Sep 12, 2024

I created a very simple example to test this error. On the first attempts nothing happened, but after testing more than a few times it started printing error messages.

extends Control

@rpc("authority", "call_remote", "reliable")
func _send_hello(_msg : String) -> void:
	print(_msg)

@rpc("authority")
func _alternative_send_hello(_msg : String) -> void:
	print( _msg)


func _ready() -> void:
	$Host.button_down.connect(func():
		var enet := ENetMultiplayerPeer.new()
		enet.create_server(8081)
		multiplayer.multiplayer_peer = enet
		
		await multiplayer.peer_connected
		print(multiplayer.get_peers())
		_send_hello.rpc("Hello")
		)
	
	$Conn.button_down.connect(func():
		var enet := ENetMultiplayerPeer.new()
		enet.create_client("127.0.0.1", 8081)
		multiplayer.multiplayer_peer = enet
		
		await multiplayer.connected_to_server
		
		print('Connected! Waiting for message...'))

I started two separate instances and when the other one connected, it would automatically receive a message from the server. In other projects, using this version, the error occurred because it called an RPC function that was not the one being called by the script.

image
image

@Faless
Copy link
Collaborator

Faless commented Sep 12, 2024

I've opened #96915 which fixes the issue (at least in my tests, including the one mentioned by @QJPG ).

@Cykyrios
Copy link
Contributor

This fixes the issue on my end as well, thank you!

@jeadhz
Copy link
Author

jeadhz commented Sep 12, 2024

I will check if it fixes the issue in couple of hours when I get home. In the meantime, thank you guys and @Faless for being so fast to solve this issue! (commenting this from GitHub mobile)

@stfufane
Copy link

Hey there, just tested the 4.4 dev2, got the bug, pulled the branch from @Faless and everything is working again, thanks for the great reaction :)

@jeadhz
Copy link
Author

jeadhz commented Sep 13, 2024

I spent the last 4 hours trying to compile Godot but for some strange reason I am not able to compile it (I'm new to C++, git and visual studio)
Big thanks to @stfufane and @Cykyrios for testing it, based on their comments I will say the issue was fixed

@RedMser
Copy link
Contributor

RedMser commented Sep 13, 2024

I spent the last 4 hours trying to compile Godot but for some strange reason I am not able to compile it (I'm new to C++, git and visual studio) Big thanks to stfufane and Cykyrios for testing it, based on their comments I will say the issue was fixed

@jeadhz If you're interested, you can try downloading an artifact build from GitHub, by selecting "Checks" at the top of the PR and clicking on the top entry in the list on the left. Here's a direct link: https://github.com/godotengine/godot/actions/runs/10833526572 scroll to the bottom for the different platforms

... or since it's merged now, wait until the next dev build :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Release Blocker
Development

Successfully merging a pull request may close this issue.

8 participants