Skip to content

Fix forest brawl error console: "Trying to check if client is synced from another client!"#311

Closed
TheYellowArchitect wants to merge 9 commits intofoxssake:mainfrom
TheYellowArchitect:fix-forest-brawl-error-console
Closed

Fix forest brawl error console: "Trying to check if client is synced from another client!"#311
TheYellowArchitect wants to merge 9 commits intofoxssake:mainfrom
TheYellowArchitect:fix-forest-brawl-error-console

Conversation

@TheYellowArchitect
Copy link
Copy Markdown
Contributor

@TheYellowArchitect TheYellowArchitect commented Oct 18, 2024

For as long I have been using netfox, there is a harmless console output, but it is annoying because it is an error and is the only error in the console:
debugger1
debugger2

This adds a simple if check. Because the signal after_client_sync is emitted only at the server via this RPC

@rpc("any_peer", "reliable", "call_remote")
func _submit_sync_success():
	var peer_id = multiplayer.get_remote_sender_id()
	
	if not _synced_clients.has(peer_id):
		_synced_clients[peer_id] = true
		after_client_sync.emit(multiplayer.get_remote_sender_id())

So that if check ends up in the same data flow but without printing an error.

@TheYellowArchitect TheYellowArchitect changed the title Fix forest brawl error console Fix forest brawl error console: "Trying to check if client is synced from another client!" Oct 18, 2024
@TheYellowArchitect TheYellowArchitect changed the title Fix forest brawl error console: "Trying to check if client is synced from another client!" Fix forest brawl error console: "Trying to check if client is synced from another client!" Oct 18, 2024
avatar.visible = false
while not NetworkTime.is_client_synced(id):
await NetworkTime.after_client_sync
if (multiplayer.is_server()):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would only hide the avatar on the server, but not for other clients.

@elementbound
Copy link
Copy Markdown
Contributor

Now that you raise this, I think we could open up this functionality to all clients, i.e. any client would be able to query who's synced and who's not. That way the gameplay code could stay as-is, the functionality would work well, and we'd get an extra (minor) feature 🙂

@elementbound
Copy link
Copy Markdown
Contributor

Closing in favor of #325, which also removes this error log.

elementbound added a commit that referenced this pull request Nov 11, 2024
Makes peer sync success public, so now every peer can check whether
another peer has completed their time sync handshake.

Supersedes #311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants