Skip to content

sync #10

Closed
robinbraemer wants to merge 29 commits into
robinbraemer:dev/3.0.0from
PaperMC:dev/3.0.0
Closed

sync #10
robinbraemer wants to merge 29 commits into
robinbraemer:dev/3.0.0from
PaperMC:dev/3.0.0

Conversation

@robinbraemer
Copy link
Copy Markdown
Owner

No description provided.

RealBauHD and others added 29 commits December 27, 2025 13:41
* Provide an IDE pattern hint for plugin IDs

* order my imports the right way
- Reset buffer reader index on exception to prevent memory leaks when packet decoding fails.
* Implement MiniMessage Velocity translations

* Implemented migration from old language format

* Updated year in default translations

* Fixed compilation

* Use MiniMessageTranslationStore

* Simplify MiniMessageTranslationsMigration#shouldMigrate

* Added support to named placeholders

* Updated translation arguments to MiniMessage translation placeholders
…rty to allow overriding default legacy chat max length
* Add max length to more config phase packets

* Ensure all packets during non-play state are known

* Limit maximum size of play inbound packet queue

Co-authored-by: Dwarslooper <dwarslooper2910@gmx.de>

* Fix checkstyle

---------

Co-authored-by: Dwarslooper <dwarslooper2910@gmx.de>
…ACKPRESSURE_LOG to all writabilityChanged() implementations. (#1745)
* 26.1-snapshot-10

* 26.1-snapshot-11

* 26.1-pre-1

* 26.1-pre-2

* 26.1-pre-3

* 26.1-rc-1

* 26.1-rc-2

* 26.1
robinbraemer added a commit to minekube/gate that referenced this pull request Apr 1, 2026
Port packet ID mappings from Velocity for the new Minecraft 26.1 version.

Synced from: robinbraemer/Velocity#10
robinbraemer added a commit to minekube/gate that referenced this pull request Apr 1, 2026
* fix: Modern Forge (FML2/FML3) proxy support and LoginPluginMessage codec

Fix several bugs preventing Forge 1.13-1.20.1 clients from connecting
through Gate to modded backend servers:

- Fix LoginPluginMessage to use raw bytes instead of length-prefixed
  encoding, matching the Minecraft protocol spec and LoginPluginResponse.
  This also fixes Velocity forwarding version negotiation which silently
  fell back to v1.
- Add FML2/FML3 marker detection in handshake connection type. Forge
  1.13-1.20.1 clients use these tokens instead of FORGE.
- Preserve FML2/FML3 tokens in ModernToken() when connecting to backend.
- Add BungeeForge extraData property to legacy and BungeeGuard forwarding
  so backend servers with BungeeForge can identify Forge clients.
- Add omitempty to Property.Signature JSON tag to avoid empty signatures
  in forwarded properties.

Closes #613

* test: add Forge e2e tests verifying FML2/FML3 proxy flow

Add end-to-end tests that simulate the full Forge client connection
flow: handshake detection → backend token preservation → legacy
forwarding with BungeeForge extraData → LoginPluginMessage decoding.

These tests confirm that all bugs from #613 are caught (verified by
running against pre-fix code where they all fail) and fixed.

* feat: add Minecraft 26.1 (protocol 775) support

Port packet ID mappings from Velocity for the new Minecraft 26.1 version.

Synced from: robinbraemer/Velocity#10

* feat: add ServerIdHash to LoginEvent

Port server ID hash from Velocity's LoginEvent so plugins can access
the hash sent to Mojang during online-mode authentication.

* fix: add pre-sizing caps and queue limits to prevent memory exhaustion

Port security hardening from Velocity:
- Cap pre-allocation of arrays decoded from untrusted packet data to
  32768 entries (ReadStringArray, ReadVarIntArray, ReadIntArray,
  AvailableCommands wireNodes) to prevent memory bombs
- Add negative length validation to ReadStringArray
- Add max queue length (1024 packets) to PlayPacketQueue to prevent
  unbounded memory growth from malicious or buggy peers

* fix: cap pre-allocation in more packet decode methods

Cap slice/map pre-allocations from untrusted VarInt lengths in:
- playerinfo.Remove: cap UUID slice allocation
- CustomReportDetails: cap map allocation
- KnownPacks: cap slice allocation for clientbound direction

* test: add tests for 26.1 packet IDs, reader caps, and queue limit

- Test all 28 packet ID mappings for Minecraft 26.1 (serverbound + clientbound)
- Test ReadStringArray, ReadVarIntArray, ReadIntArray negative length rejection
- Test capped allocation prevents OOM from huge untrusted lengths
- Test roundtrip encode/decode for string and varint arrays
- Test PlayPacketQueue max limit and nil safety

* refactor: simplify pre-alloc caps and fix naming

- Export MaxPreAllocSize constant and use it everywhere instead of
  hardcoded 1<<15 magic numbers
- Harden ReadKeyArray and ReadProperties with same pre-alloc cap
  (missed in initial hardening pass)
- Rename ServerIdHash to ServerIDHash per Go naming conventions

* style: go fmt

* fix: check error returns in tests (lint)

* fix: use %g format for float32 quota.OPS in validation error
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.