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

fix: Send state ack's to sender instead of authority #378

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/netfox.extras/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.extras"
description="Game-specific utilities for Netfox"
author="Tamas Galffy and contributors"
version="1.21.1"
version="1.21.2"
script="netfox-extras.gd"
2 changes: 1 addition & 1 deletion addons/netfox.internals/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.internals"
description="Shared internals for netfox addons"
author="Tamas Galffy and contributors"
version="1.21.1"
version="1.21.2"
script="plugin.gd"
2 changes: 1 addition & 1 deletion addons/netfox.noray/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.noray"
description="Bulletproof your connectivity with noray integration for netfox"
author="Tamas Galffy and contributors"
version="1.21.1"
version="1.21.2"
script="netfox-noray.gd"
2 changes: 1 addition & 1 deletion addons/netfox/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox"
description="Shared internals for netfox addons"
author="Tamas Galffy and contributors"
version="1.21.1"
version="1.21.2"
script="netfox.gd"
6 changes: 3 additions & 3 deletions addons/netfox/rollback/rollback-synchronizer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ func _submit_full_state(state: Dictionary, tick: int):
_latest_state_tick = tick

if NetworkRollback.enable_diff_states:
_ack_full_state.rpc_id(get_multiplayer_authority(), tick)
_ack_full_state.rpc_id(sender, tick)

@rpc("any_peer", "unreliable_ordered", "call_remote")
func _submit_diff_state(diff_state: Dictionary, tick: int, reference_tick: int):
Expand All @@ -614,14 +614,14 @@ func _submit_diff_state(diff_state: Dictionary, tick: int, reference_tick: int):
# Reference tick missing, hope for the best
_logger.warning("Reference tick %d missing for %d", [reference_tick, tick])

var sender = multiplayer.get_remote_sender_id()
var reference_state = _states.get(reference_tick, {})
var is_valid_state := true

if (diff_state.is_empty()):
_latest_state_tick = tick
_states[tick] = reference_state
else:
var sender = multiplayer.get_remote_sender_id()
var sanitized = _sanitize_by_authority(diff_state, sender)

if not sanitized.is_empty():
Expand All @@ -635,7 +635,7 @@ func _submit_diff_state(diff_state: Dictionary, tick: int, reference_tick: int):

if NetworkRollback.enable_diff_states:
if is_valid_state and diff_ack_interval > 0 and tick > _next_diff_ack_tick:
_ack_diff_state.rpc_id(get_multiplayer_authority(), tick)
_ack_diff_state.rpc_id(sender, tick)
_next_diff_ack_tick = tick + diff_ack_interval

@rpc("any_peer", "reliable", "call_remote")
Expand Down
Loading