Add netplay state-message types to reliable channel protocol #1
Labels
No Label
blocked
bounced
in-progress
in-review
manual-only
needs-guidance
netplay
p1
p2
p3
rust
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: pbwraith/gopher64-netplay#1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Repo: gopher64-netplay (fork of https://github.com/gopher64/gopher64)
Context: Full scope doc at upstream analysis — see commit history. Netplay uses GGRS over WebRTC (matchbox_socket), reliable channel carries
NetplayMessage { name, data }in 16KB chunks. Savestates serialize full Device via postcard + compress.Goal: Extend the reliable channel protocol with new message types for state transfer.
Background:
src/netplay.rshassend_save/receive_savesendingNetplayMessage { name, data }in 16KB chunks (lines 72-111)Acceptance:
"netplay_state","netplay_state_ready","resync_state","resync_ready"send_netplay_state(netplay, data)/receive_netplay_state(netplay) -> Vec<u8>that reuse the existing chunkedsend_message/process_reliable_messagesmachinery (no new transport code)send_ready(netplay, name)/wait_for_ready(netplay, name)with 10s timeout likereceive_messageincoming_messageuntil a full postcard message parsesVerification:
cargo testpasses with new tests. All existing netplay tests stay green.Implementing lane 4 — PR ready for manual review.
PR: #14 — #14 (base
main, headissue-1, state open, mergeable)Commit:
891d12c— "netplay: add state-message types to reliable channel protocol (#1)" (258+/34-, 1 file: src/netplay.rs)What changed:
NETPLAY_STATE_MESSAGE("netplay_state"),NETPLAY_STATE_READY_MESSAGE("netplay_state_ready"),RESYNC_STATE_MESSAGE("resync_state"),RESYNC_READY_MESSAGE("resync_ready").encode_message_chunks/decode_message/decode_packets(16 KiB chunks, accumulate intoincoming_messageuntil a full postcard message parses) — existing transport reused, no new transport code.send_netplay_state/receive_netplay_state, plus ack helperssend_ready/wait_for_ready(10 s timeout, same pattern asreceive_message, extracted towait_for_message; input-delay/disconnect side effects preserved).Tests (
cargo test --lib, local worktree build): 4 passed / 0 failedstate_message_constants_match_protocollarge_payload_round_trips_through_chunked_codec(5 MB)ready_ack_send_receive_within_timeoutmissing_ack_times_out_with_standard_panicgit diff --checkclean. (Note: this WSL box needs local-only build tweaks in build.rs/.cargo to compile; those are intentionally NOT part of this PR.)