Commit Graph

1610 Commits

Author SHA1 Message Date
Shane Freeder
a6d97e28ad Validate compression claim 2026-04-13 13:39:57 +01:00
booky
339a4c1887 Fix some small protocol inconsistencies (#1772) 2026-04-12 20:18:42 +01:00
Shane Freeder
e834af9cf1 Increase max ratio
Older versions of the game, and creative mode, send itemstacks to the server
when dealing with itemstacks, annoying, the compression algo used is good at
backreferencing, which means that compressed data can balloon pretty well.

64 should more than cover most cases of legit data, we could probably be more
harsh here, but this is likely a fine balance between avoiding bombs and not
erring out on legit data.
2026-04-09 19:04:02 +01:00
Shane Freeder
affc1d6e08 Extend debug logging to client play/config handlers 2026-04-09 19:03:33 +01:00
R00tB33rMan
6ce432e4ae Handle configuration/transition-phase disconnects as connection errors to prevent bricking older client versions (#1753) 2026-04-09 15:50:01 +01:00
Harold
b1a1b8bda3 use outbound only queueing when reentering configuration (#1747)
* use outbound only queueing and guard serverbound forwarding during reconfiguration
2026-04-08 23:27:02 +01:00
Shane Freeder
6f01587318 Appease checkstyle 2026-04-08 21:19:27 +01:00
Shane Freeder
308ce6d992 Merge branch 'cat/limits' into dev/3.0.0 2026-04-08 21:12:52 +01:00
Shane Freeder
9890c429c6 Add compression ratio limiter 2026-04-08 21:12:41 +01:00
Shane Freeder
0219993c8a Add basic packet limiter 2026-04-08 20:41:45 +01:00
Shane Freeder
f6d48c90f9 reduce clientbound compression limits 2026-04-08 20:41:09 +01:00
Aaron
d11511c184 Minecraft 26.1 (#1739)
* 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
2026-03-21 23:14:28 -05:00
Wouter Gritter
99bd030996 Implement missing writabilityChanged() and add backlog logging with BACKPRESSURE_LOG to all writabilityChanged() implementations. (#1745) 2026-03-18 18:23:01 +00:00
booky
5017f8c9f2 Add more protocol safeguards (#1743)
* 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>
2026-03-18 12:04:31 +00:00
Nassim Jahnke
e8b64aa6c0 Add two more pre-sizing checks 2026-03-15 09:04:34 +01:00
Nassim Jahnke
470cd7a9d2 checkstyle 2026-03-15 08:44:31 +01:00
Nassim Jahnke
0783b1d4e4 Add remaining pre-sizing checks 2026-03-15 08:39:32 +01:00
Riley Park
e0db25664f Revert "Add various missing jd, bump remaining deps (#1718)"
This reverts commit 7d0c002f89.
2026-03-03 07:22:59 -08:00
Wouter Gritter
c2fd3c07ac Introduce SchedulerBackend to fix VelocitySchedulerTest intermittent failure (#1728) 2026-02-11 16:21:03 -05:00
Rocco
2535751cd9 Add server-id hash to LoginEvent (#1027) 2026-02-10 19:59:34 +01:00
Nassim Jahnke
7e01491e2f Promote build channel to stable 2026-01-31 11:34:51 +01:00
R00tB33rMan
7d0c002f89 Add various missing jd, bump remaining deps (#1718) 2026-01-29 14:31:50 +01:00
Riley Park
5320aae5d9 fix #1695: add "velocity.legacyChatMaxServerboundLength" system property to allow overriding default legacy chat max length 2026-01-25 21:20:47 -08:00
Emil
fe8dc5eaa2 fix: TranslatableMapper not using fallback translation (#1716) 2026-01-25 15:56:55 -05:00
Adrian
eb2bea79ba Implement MiniMessage Velocity translations (#1108)
* 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
2026-01-25 14:06:03 -05:00
Adrian
75ecb64159 Update minimum Java version to 21 (#1649) 2026-01-25 19:22:54 +01:00
Nassim Jahnke
d69431a08e Update dependencies (#1717) 2026-01-25 19:13:08 +01:00
Nassim Jahnke
7e4f37b5f5 Bump version to 3.5.0-SNAPSHOT 2026-01-25 18:53:56 +01:00
mason
3022793418 Fix ByteBuf memory leak in MinecraftVarintFrameDecoder (#1715)
- Reset buffer reader index on exception to prevent memory leaks when packet decoding fails.
2026-01-21 18:56:22 +00:00
Shane Freeder
372a3b28bd Conformity 2026-01-08 17:13:08 +00:00
Shane Freeder
a03bd884aa Restrict empty packet frames from clients 2026-01-08 16:53:58 +00:00
SzymON/OFF
a046f70075 Fix exception message formatting in command invocation (#1687) 2025-11-09 19:59:06 +00:00
ZX夏夜之风
75d68115ef feat: PlayerChannelUnregisterEvent (#1686)
* feat: PlayerChannelUnregisterEvent

* style: fix checkstyle issues
2025-11-09 11:34:58 -05:00
Adrian
b6b6b20fe9 Generate a new forwarding secret file if the file is deleted (#1671)
* Generate a new forwarding secret file if the file is deleted

This allows to generate a new forwarding secret simply by deleting the file if required.
The file will only be generated if the forwarding secret is not configured through a system property

resolves #1670

* Add file creation message
2025-10-23 11:13:36 -05:00
Dylan Sperrer
f75b512837 Moved pre-1.19.1 command argument validation so it prints the faulty identifier (#1675) 2025-10-21 12:45:04 -05:00
Adrian
7412aca81c Fixed sending ServerData packets if the description component from the backend server is null (#1673) 2025-10-20 19:51:47 -05:00
Adrian
02cf349075 Fixed disconnecting players in the middle of a backend server reconfiguration (#1669) 2025-10-19 09:43:40 -05:00
Andrew Steinborn
67b988e6d2 Update all localizations to use the current year 2025-10-18 18:58:21 -04:00
Andrew Steinborn
d2c13c2a4c Provide encode buffer hint 2025-10-18 17:36:39 -04:00
Andrew Steinborn
498a38cf74 Re-enable adaptive allocator
Recent Netty versions have improved the adaptive allocator, and we shouldn't be seeing the OOM issues others were noticing before. Let's re-enable it.

As for the buffer resizing issue, the upstream issue netty/netty#14912 is long fixed. I think we *should* pre-allocate the buffers beforehand much more aggressively, but that has to be future work.
2025-10-18 16:40:54 -04:00
Shane Freeder
38a0a7ed27 use correct string length for newer MC versions (Fixes #1629) (#1668) 2025-10-18 21:22:26 +01:00
Andrew Steinborn
70c3eabdb1 Minor optimizations for MinecraftCompressorAndLengthEncoder and friends
No need to bounce around changing the writer index, we can just set the value directly.

Also pull out the handshake checks into a separate function, to improve inlining.
2025-10-18 16:15:22 -04:00
okx-code
4cd3b68697 Fix players disconnecting when updating boss bars (#1656)
* Fix 1.20.2+ clients disconnecting when updating boss bars

On 1.20.2, the Minecraft client started clearing boss bars after the login packet, which meant that the ProxyServer#showBossbar API would result in the player getting kicked if the boss bar they were previously shown was updated after switching servers.

Therefore, I have added BossBarManager which drops boss bar packets once the client enters the configure phase to ensure that they do not disconnect, and then re-adds the boss bar once the client enters the login phase.

This ensures that clients do not receive boss bar updates for boss bars that they don't exist and causing them to disconnect. I have also taken care to ensure that this logic only applies on 1.20.2 and up, as it is not necessary for older clients.

---------

Co-authored-by: Adrian Gonzales <adriangonzalesval@gmail.com>
2025-10-16 23:12:57 -05:00
Emil
1140fc65ba fix: Enable EMIT_CLICK_URL_HTTPS on component serializers (#1665) 2025-10-14 13:10:57 -05:00
Ross
5753548b44 Fix SimpleCommand suggestion offset (#1664)
* Fix command suggestion offset

* fix length error

* add test

* checkstyle

---------

Co-authored-by: Ross <2086824-trashp@users.noreply.gitlab.com>
2025-10-13 14:41:33 -05:00
Ross
806b386cdb Fix command suggestion offset (#1662) 2025-10-11 21:11:44 -05:00
Timon Seidel
c8c27af7c3 feat: Add primitive support for sound api (#1422)
* feat: Add primitive support for sound api

* change to fail silently

fix: implement the correct playSound method
fix: bumped "since" version

* chore: update 1.21.5

* chore: enforce adventure's policy of not throwing exceptions on unsupported actions

* feat: allow sounds to be played from other players (on the same server)

* chore(fix): add missing getters/setters in packets

* chore: update 1.21.6
chore: added own notes to playSound method, as adventure moved them to the Sound class

* chore: cleanup

* fix: ignore invalid sound source
fix: sound source error on wrong version

* chore: prettify key writing

* Implement missing Player#playSound(Sound)

* Reverted Player#playSound(Sound) implementation

Also, improved documentation related to #playSound mehtods

* chore(jd): mark dialog operations unsupported

* chore: update 1.21.9

---------

Co-authored-by: Adrian Gonzales <adriangonzalesval@gmail.com>
2025-09-29 09:22:19 -05:00
Aaron
ba01492790 Minecraft 1.21.9 (#1651)
* 1.21.9-pr1
- not tested yet

* 1.21.9-pre2

* feat: forward code of conduct packets in CONFIG state

* 1.21.9

---------

Co-authored-by: Emilxyz <12966472+Emilxyz@users.noreply.github.com>
2025-09-27 12:15:02 -05:00
Joo200
ec793a9fdb Log console command executions (#1137) 2025-09-24 00:50:05 -05:00
DartCZ
37f622f226 feat: add ProxyPreShutdownEvent before players are disconnected (#1626)
* feat: delay player disconnect until ProxyShutdownEvent completes

* fix: added back empty line

* feat: added ProxyPreShutdownEvent

* feat: CR changes

* chore: fixed license, annotated with Beta annotation

* Update proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java

Co-authored-by: Timon Seidel <timong.seidel@gmail.com>

* Update proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java

Co-authored-by: Timon Seidel <timong.seidel@gmail.com>

* chore: consolidated log message

* Update proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java

Co-authored-by: Timon Seidel <timong.seidel@gmail.com>

* Update proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java

Co-authored-by: powercas_gamer <cas@mizule.dev>

* Update api/src/main/java/com/velocitypowered/api/event/proxy/ProxyPreShutdownEvent.java

Co-authored-by: powercas_gamer <cas@mizule.dev>

* feat: make ProxyPreShutdownEvent timeout configurable via system property

* fix: cs

* Document velocity.pre-shutdown-timeout system property

---------

Co-authored-by: Timon Seidel <timong.seidel@gmail.com>
Co-authored-by: powercas_gamer <cas@mizule.dev>
Co-authored-by: Adrian Gonzales <adriangonzalesval@gmail.com>
2025-09-22 22:27:25 +01:00