[PR #1650] [MERGED] Multiplayer: answer cookie requests, store cookies, follow transfer packets #3659

Closed
opened 2026-11-03 04:11:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1650
Author: @socksprox
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/proxy-transfers


📝 Commits (2)

  • 56560b4 Multiplayer: answer cookie requests, store cookies, follow transfer packets
  • 6b97107 Transfers: handshake with the TRANSFER intent, answer login cookie requests

📊 Changes

5 files changed (+233 additions, -17 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+8 -2)
📝 crates/horizon-client/src/game/remote.rs (+52 -3)
📝 crates/horizon-client/src/game/startup_menu.rs (+3 -1)
📝 crates/horizon-client/src/net.rs (+163 -9)
📝 crates/horizon-protocol/src/packets/play.rs (+7 -2)

📄 Description

🤖 Opened by an AI agent (Devin), not by the user themselves.

Closes #1643.

Summary

On proxy networks (BungeeCord, Velocity, ...), a server switch kicked the client: the packets involved were decoded as Unknown and dropped.

  • packets/play.rs: play-state cookie_request, store_cookie, transfer clientbound packets and serverbound cookie_response (the config-state types are reused — ClientboundCookieRequestPacket/StoreCookie/Transfer/ServerboundCookieResponsePacket are the same records in both states).
  • net.rs: Session.cookies — the serverCookies map (CommonListenerCookie); ClientboundCookieRequestPacket is now answered with the stored cookie in both configuration and play (handleRequestCookie), ClientboundStoreCookiePacket stores it (handleStoreCookie), and ClientboundTransferPacket emits a Transfer event before the connection ends.
  • remote.rs/game.rs: on disconnect with a pending transfer the game leaves cleanly and reconnects to the target address carrying the cookies (handleTransfer → ConnectScreen.startConnecting → TransferState), instead of showing the kick.

Stacked on the unmerged server-packs/boss-overlay work in the first commit (that work is already PRed separately as #1588/#1590 — this branch just had it in the working tree).

Test plan

  • cargo check -p horizon-client, cargo fmt --check, clippy via pr_ready.py --quick
  • cargo test -p horizon-protocol --lib (73 pass), cargo test -p horizon-client --lib -- net::/skins::
  • Live transfer on a real BungeeCord/Velocity network (not done — no such network available)

🤖 Generated with Devin


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1650 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/proxy-transfers` --- ### 📝 Commits (2) - [`56560b4`](https://github.com/horizon-rust/horizon/commit/56560b467a8fad3ffe02457691bd8486a1a77cb6) Multiplayer: answer cookie requests, store cookies, follow transfer packets - [`6b97107`](https://github.com/horizon-rust/horizon/commit/6b97107dc7ed8cc1ce6f5d76fcf932febf8b796d) Transfers: handshake with the TRANSFER intent, answer login cookie requests ### 📊 Changes **5 files changed** (+233 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+8 -2) 📝 `crates/horizon-client/src/game/remote.rs` (+52 -3) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+3 -1) 📝 `crates/horizon-client/src/net.rs` (+163 -9) 📝 `crates/horizon-protocol/src/packets/play.rs` (+7 -2) </details> ### 📄 Description > 🤖 Opened by an AI agent (Devin), not by the user themselves. Closes #1643. ## Summary On proxy networks (BungeeCord, Velocity, ...), a server switch kicked the client: the packets involved were decoded as `Unknown` and dropped. - `packets/play.rs`: play-state `cookie_request`, `store_cookie`, `transfer` clientbound packets and serverbound `cookie_response` (the config-state types are reused — `ClientboundCookieRequestPacket`/`StoreCookie`/`Transfer`/`ServerboundCookieResponsePacket` are the same records in both states). - `net.rs`: `Session.cookies` — the `serverCookies` map (`CommonListenerCookie`); `ClientboundCookieRequestPacket` is now answered with the stored cookie in both configuration and play (`handleRequestCookie`), `ClientboundStoreCookiePacket` stores it (`handleStoreCookie`), and `ClientboundTransferPacket` emits a `Transfer` event before the connection ends. - `remote.rs`/`game.rs`: on disconnect with a pending transfer the game leaves cleanly and reconnects to the target address carrying the cookies (`handleTransfer` → `ConnectScreen.startConnecting` → `TransferState`), instead of showing the kick. Stacked on the unmerged server-packs/boss-overlay work in the first commit (that work is already PRed separately as #1588/#1590 — this branch just had it in the working tree). #### Test plan - [x] `cargo check -p horizon-client`, `cargo fmt --check`, clippy via `pr_ready.py --quick` - [x] `cargo test -p horizon-protocol --lib` (73 pass), `cargo test -p horizon-client --lib -- net::`/`skins::` - [ ] Live transfer on a real BungeeCord/Velocity network (not done — no such network available) 🤖 Generated with Devin --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3659
No description provided.