3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 13:30:17 +01:00
Commit graph

100 Commits

Autor SHA1 Nachricht Datum
Andrew Steinborn
3c41211163 Switch over to Error Prone (now with NullAway!)
There is one major change: we now have a separate artifact for the annotation processor.

As for NullAway, we are currently exempting the clientbound join game/respawn packets. They are ugly and need to be refactored.
2021-05-13 04:13:15 -04:00
Andrew Steinborn
cdc9ebf72d Fix merge issues 2021-05-09 03:56:26 -04:00
Andrew Steinborn
e49603ec0c Merge branch 'dev/1.1.0' into dev/2.0.0
# Conflicts:
#	api/src/main/java/com/velocitypowered/api/command/ConsoleCommandSource.java
#	api/src/main/java/com/velocitypowered/api/event/connection/ProxyPingEvent.java
#	api/src/main/java/com/velocitypowered/api/event/connection/ProxyQueryEvent.java
#	api/src/main/java/com/velocitypowered/api/event/lifecycle/ListenerBoundEvent.java
#	api/src/main/java/com/velocitypowered/api/event/lifecycle/ListenerCloseEvent.java
#	api/src/main/java/com/velocitypowered/api/event/lifecycle/ProxyInitializeEvent.java
#	api/src/main/java/com/velocitypowered/api/event/lifecycle/ProxyReloadEvent.java
#	api/src/main/java/com/velocitypowered/api/event/lifecycle/ProxyShutdownEvent.java
#	api/src/main/java/com/velocitypowered/api/event/player/DisconnectEvent.java
#	api/src/main/java/com/velocitypowered/api/event/player/LoginEvent.java
#	api/src/main/java/com/velocitypowered/api/event/player/PostLoginEvent.java
#	api/src/main/java/com/velocitypowered/api/event/player/PreLoginEvent.java
#	api/src/main/java/com/velocitypowered/api/event/query/package-info.java
#	api/src/main/java/com/velocitypowered/api/proxy/connection/InboundConnection.java
#	api/src/main/java/com/velocitypowered/api/proxy/connection/Player.java
#	api/src/main/java/com/velocitypowered/api/proxy/connection/ServerConnection.java
#	api/src/main/java/com/velocitypowered/api/proxy/player/ConnectionRequestBuilder.java
#	api/src/main/java/com/velocitypowered/api/util/MessagePosition.java
#	api/src/main/java/com/velocitypowered/api/util/bossbar/BossBar.java
#	api/src/main/java/com/velocitypowered/api/util/bossbar/BossBarColor.java
#	api/src/main/java/com/velocitypowered/api/util/bossbar/BossBarFlag.java
#	api/src/main/java/com/velocitypowered/api/util/bossbar/BossBarOverlay.java
#	api/src/main/java/com/velocitypowered/api/util/title/TextTitle.java
#	api/src/main/java/com/velocitypowered/api/util/title/Title.java
#	api/src/main/java/com/velocitypowered/api/util/title/Titles.java
#	api/src/main/java/com/velocitypowered/api/util/title/package-info.java
#	build.gradle
#	native/src/main/java/com/velocitypowered/natives/compression/Java11VelocityCompressor.java
#	proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/ConnectionManager.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/NettyPreconditions.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/PluginMessageUtil.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/ProtocolUtils.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/ServerChannelInitializerHolder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/buffer/ByteBufDataInput.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/buffer/ByteBufDataOutput.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/clientbound/ClientboundAvailableCommandsPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/clientbound/ClientboundBossBarPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/clientbound/ClientboundEncryptionRequestPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/clientbound/ClientboundJoinGamePacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/clientbound/ClientboundPlayerListItemPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/clientbound/ClientboundRespawnPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/clientbound/ClientboundTabCompleteResponsePacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/legacy/LegacyDisconnectPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/legacy/LegacyMinecraftPingVersion.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/serverbound/ServerboundClientSettingsPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/packet/serverbound/ServerboundTabCompleteRequestPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/AutoReadHolderHandler.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/GS4QueryHandler.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/LegacyPingDecoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/LegacyPingEncoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/MinecraftCipherDecoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/MinecraftCipherEncoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/MinecraftCompressDecoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/MinecraftCompressEncoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/MinecraftDecoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/MinecraftEncoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/MinecraftVarintFrameDecoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/MinecraftVarintLengthEncoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/pipeline/VarintByteDecoder.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/resolver/SeparatePoolInetNameResolver.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/FaviconSerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/GameProfileSerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/VelocityLegacyHoverEventSerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/ArgumentPropertyRegistry.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/ArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/ByteArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/DoubleArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/EmptyArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/FloatArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/GenericArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/IntegerArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/LongArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/ModArgumentProperty.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/ModArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/PassthroughProperty.java
#	proxy/src/main/java/com/velocitypowered/proxy/network/serialization/brigadier/StringArgumentPropertySerializer.java
#	proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/MinecraftPacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/Chat.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/Disconnect.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/EncryptionResponse.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/Handshake.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/HeaderAndFooter.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/KeepAlive.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LegacyHandshake.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LegacyPing.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginMessage.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LoginPluginResponse.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/PluginMessage.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ResourcePackRequest.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ResourcePackResponse.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ServerLogin.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ServerLoginSuccess.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/SetCompression.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/StatusPing.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/StatusRequest.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/StatusResponse.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TitlePacket.java
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/util/DeferredByteBufHolder.java
#	proxy/src/main/java/com/velocitypowered/proxy/util/bossbar/AdventureBossBarManager.java
#	proxy/src/main/java/com/velocitypowered/proxy/util/bossbar/VelocityBossBar.java
#	proxy/src/test/java/com/velocitypowered/proxy/event/MockEventManager.java
#	proxy/src/test/java/com/velocitypowered/proxy/network/PluginMessageUtilTest.java
#	proxy/src/test/java/com/velocitypowered/proxy/protocol/PacketRegistryTest.java
2021-04-16 04:02:01 -04:00
Andrew Steinborn
c747120b20
Relicense the Velocity proxy under the terms of GPLv3 (#448) 2021-03-31 16:04:06 -04:00
Andrew Steinborn
523b61e0c7 Make sure unit tests actually run(!) and fix command hints 2020-12-14 14:39:39 -05:00
Andrew Steinborn
58294595f3 Fix unit tests and correct several issues with hinting.
The packet registry tests are defunct, and will be rewritten at a future date.
2020-12-14 14:31:19 -05:00
Andrew Steinborn
5bd7b66bda Merge branch 'dev/1.1.0' into dev/2.0.0
# Conflicts:
#	build.gradle
#	native/src/main/java/com/velocitypowered/natives/compression/Java11VelocityCompressor.java
2020-11-17 04:49:32 -05:00
Andrew Steinborn
c140599a53 Better check for unfinished decompression 2020-11-17 04:48:52 -05:00
Andrew Steinborn
3d0cb50569 Better check for unfinished decompression 2020-11-17 04:48:20 -05:00
Andrew Steinborn
89e1a07448 Try and explicitly specify Java 8 in the modules. 2020-11-06 18:52:00 -05:00
Andrew Steinborn
91b295ead5 Further improve the inflate overflow checks in the Java 11 compressor native
This brings the Java compressor in line with our libdeflate one. Backport this from Velocity 2.0.0.
2020-11-05 17:22:19 -05:00
Andrew Steinborn
ace8f7673d Further improve the inflate overflow checks in the Java compressor native
This brings the Java compressor in line with our libdeflate one.
2020-11-05 17:18:41 -05:00
Andrew Steinborn
1f5b0e1e03 Fix a few minor issues with the Java 11 compressor 2020-11-05 17:07:49 -05:00
Andrew Steinborn
13a63eff76 Replace old Java compressor with Java 11 compressor 2020-11-05 16:50:57 -05:00
Andrew Steinborn
911aba1b45 Native cipher test should only be enabled on Linux 2020-10-27 01:53:43 -04:00
Andrew Steinborn
bf81d20ba7 Recompile natives for Linux aarch64 2020-10-27 01:48:25 -04:00
Andrew Steinborn
0f919d7163 Recompile natives for Linux x86_64
Debian 9 was used to compile the libdeflate native and OpenSSL 1.1.x crypto, CentOS for OpenSSL 1.0.x crypto only.
2020-10-27 01:44:14 -04:00
Andrew Steinborn
4ca996098c Merge branch 'dev/1.1.0' into further-native-tweaks
# Conflicts:
#	native/compile-linux.sh
2020-10-27 01:30:42 -04:00
Andrew Steinborn
5072e1085a Revert server list ping changes
They are broken with ping passthrough.
2020-10-06 11:05:36 -04:00
Andrew Steinborn
3bf252cf45 Start optimizing server list ping. 2020-10-04 15:30:28 -04:00
Andrew Steinborn
d2b65cb643 Fix velocity-natives module publishing, take 1 2020-09-23 01:05:50 -04:00
Andrew Steinborn
dc48eb97f9 Start publishing velocity-natives module
Note that this will remain internal API for Velocity and the publication of the module does not necessarily indicate that they will be stable.
2020-09-23 01:03:18 -04:00
Andrew Steinborn
6c348c994c Don't need to call memoryAddress() here as we do it later on anyway 2020-09-21 11:27:47 -04:00
Andrew Steinborn
bb31226e09 Clean up more cipher code and make it -Wall + -Werror clean 2020-09-16 00:07:52 -04:00
Andrew Steinborn
a49a77a7ef Working on improvements to natives. Not done yet. 2020-09-11 01:46:59 -04:00
Andrew Steinborn
5d287306c2 Small code cleanups 2020-09-01 03:25:15 -04:00
Andrew Steinborn
c47d25c88a Upgrade to Gradle 6.6 and use SpotBugs.
As a result, at least one real bug was fixed! Nice.
2020-08-21 19:09:04 -04:00
Andrew Steinborn
89f98ce57d Make Disposable interface implement Closeable 2020-07-29 05:34:15 -04:00
Andrew Steinborn
62703780e1 Fix a few areas of concern spotted by JITWatch 2020-06-27 21:33:05 -04:00
Andrew Steinborn
68e5b64c33 Don't contradict yourself. 2020-06-23 10:00:08 -04:00
Andrew Steinborn
43223548f4 Update outdated readme for natives. 2020-06-23 09:57:04 -04:00
Andrew Steinborn
9dda0ba9dd Commit the other aarch64 native recompiled on Debian 9 2020-06-23 07:55:41 -04:00
Andrew Steinborn
f00301e15b Add aarch64 natives compiled on Debian 9 2020-06-22 20:56:07 -04:00
Andrew Steinborn
676ce7b7fd Use compression native compiled on CentOS 7 2020-06-22 20:17:52 -04:00
Andrew Steinborn
1bb84f81df Rewrite native crypto to use OpenSSL
OpenSSL is much more portable and optimized (important for aarch64) and most systems already have a version.

Unfortunately, OpenSSL likes to break their ABI. Thankfully, Velocity's natives system is very flexible largely, so we can provide multiple versions of this crypto.

Versions of the dynamically-linked crypto were compiled on CentOS 7 (still supported until 2024, uses OpenSSL 1.0.x) and Debian 9 (the oldest distro including OpenSSL 1.1.0, whose LTS supports ends in 2022). The choice of distros was intended to cover most modern distributions (2014 and afterwards).

An ARM compilation (using Debian 9) will be published soon.
2020-06-22 20:14:46 -04:00
Andrew Steinborn
877f98b87a Fix typo in LibdeflateVelocityCompressor 2020-06-21 14:14:41 -04:00
Andrew Steinborn
f3d5c986da Add Velocity compression native for aarch64
This native has been compiled and tested on Ubuntu 18.04 aarch64 on AWS Graviton2.

The cipher native is at the moment unlikely to provide a performance boost as mbed TLS doesn't provide an accelerated AES extension.
2020-06-04 15:22:03 -04:00
Andrew Steinborn
31d1871bd5 Check for AARCH64. 2020-06-04 15:03:27 -04:00
Andrew Steinborn
bb69481f99 Lay down foundation for cross-architecture natives
We have dropped the rarely used kqueue and replaced it with the new Netty aarch64
native. In addition, lay down the foundation for other aarch64 natives.
2020-06-04 14:59:22 -04:00
Andrew Steinborn
ae8852dc9d Native tests should only run on Linux 2020-05-25 13:29:02 -04:00
Andrew Steinborn
793e938dd1 Drop macOS native support
This served a good purpose when I used macOS as a primary development system, but those days are gone (I use Linux now). The spirit of multiple variants is preserved by our special Java 11+ optimized compression.
2020-05-24 10:58:28 -04:00
Andrew Steinborn
b3bd773fea Switch out Cloudflare zlib for libdeflate.
libdeflate is significantly faster than vanilla zlib, zlib-ng, and Cloudflare zlib. It is also MIT-licensed (so no licensing concerns). In addition, it simplifies a lot of the native code (something that's been tricky to get right).

While we're at it, I have also taken the time to fine-time compression in Velocity in general. Thanks to this work, native compression only requires one JNI call, an improvement from the more than 2 (sometimes up to 5) that were possible before. This optimization also extends to the existing Java compressors, though they require potentially two JNI calls.
2020-05-24 10:56:26 -04:00
Andrew Steinborn
742b8d98cb Fix noexecstack for natives. 2020-05-20 04:55:55 -04:00
Andrew Steinborn
9edbef981c Uncomment compile lines from script 2020-02-18 01:35:54 -05:00
Andrew Steinborn
b3ac73a51e Use Cloudflare zlib for more aggressive optimizations 2020-02-18 01:34:39 -05:00
Andrew Steinborn
496027f7c1 Add AMD64-specific compile script 2020-02-18 01:15:33 -05:00
Andrew Steinborn
75359256b3 Introduce velocity.natives-tmpdir property for properly handling noexec /tmp 2019-11-29 14:27:27 -05:00
Andrew Steinborn
2f55912995 Graceful fallback when /tmp is amounted noexec on Linux
Fixes #260
2019-11-29 12:04:12 -05:00
Andrew Steinborn
af0903050d Make sure in-place AES respects reader index 2019-11-09 21:30:46 -05:00
Andrew Steinborn
d73496e8df Introduce zero memory-copy compression for regular Java native
The compression itself is zero-copy in most cases. However, the overhead
needed to copy a direct buffer into a heap buffer (and back) is still
present. If possible, use Linux for best performance.
2019-11-09 17:39:47 -05:00