mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-18 15:07:43 +01:00
Convert to Netty 5, sans ByteBuf -> Buffer migration
Since `ByteBuf` is everywhere in the codebase, moving to the `Buffer` interface will be the most difficult part of the migration. The main causality is the HAProxy support, which seems to have not been pushed up to Maven Central or Sonatype snapshots.
This commit is contained in:
@@ -19,7 +19,7 @@ license {
|
||||
|
||||
dependencies {
|
||||
implementation "com.google.guava:guava:${guavaVersion}"
|
||||
implementation "io.netty:netty-handler:${nettyVersion}"
|
||||
implementation "io.netty:netty5-handler:${nettyVersion}"
|
||||
implementation "org.checkerframework:checker-qual:${checkerFrameworkVersion}"
|
||||
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.velocitypowered.natives.compression;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import java.util.zip.DataFormatException;
|
||||
|
||||
class CompressorUtils {
|
||||
|
||||
@@ -23,7 +23,7 @@ import static com.velocitypowered.natives.compression.CompressorUtils.ZLIB_BUFFE
|
||||
import static com.velocitypowered.natives.compression.CompressorUtils.ensureMaxSize;
|
||||
|
||||
import com.velocitypowered.natives.util.BufferPreference;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.zip.DataFormatException;
|
||||
import java.util.zip.Deflater;
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.velocitypowered.natives.compression;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.velocitypowered.natives.util.BufferPreference;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import java.util.zip.DataFormatException;
|
||||
|
||||
public class LibdeflateVelocityCompressor implements VelocityCompressor {
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.velocitypowered.natives.compression;
|
||||
|
||||
import com.velocitypowered.natives.Disposable;
|
||||
import com.velocitypowered.natives.Native;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import java.util.zip.DataFormatException;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.velocitypowered.natives.encryption;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.velocitypowered.natives.util.BufferPreference;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import java.security.GeneralSecurityException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.velocitypowered.natives.encryption;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.velocitypowered.natives.util.BufferPreference;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import java.security.GeneralSecurityException;
|
||||
import javax.crypto.SecretKey;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.velocitypowered.natives.encryption;
|
||||
|
||||
import com.velocitypowered.natives.Disposable;
|
||||
import com.velocitypowered.natives.Native;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
|
||||
public interface VelocityCipher extends Disposable, Native {
|
||||
void process(ByteBuf source);
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
package com.velocitypowered.natives.util;
|
||||
|
||||
import com.velocitypowered.natives.Native;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBufAllocator;
|
||||
|
||||
public class MoreByteBufUtils {
|
||||
private MoreByteBufUtils() {
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
package com.velocitypowered.natives.util;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import io.netty5.buffer.Unpooled;
|
||||
import java.util.function.BooleanSupplier;
|
||||
|
||||
public class NativeConstraints {
|
||||
|
||||
@@ -24,9 +24,9 @@ import static org.junit.jupiter.api.condition.OS.LINUX;
|
||||
|
||||
import com.velocitypowered.natives.util.BufferPreference;
|
||||
import com.velocitypowered.natives.util.Natives;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBufUtil;
|
||||
import io.netty5.buffer.Unpooled;
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -22,9 +22,9 @@ import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.junit.jupiter.api.condition.OS.LINUX;
|
||||
|
||||
import com.velocitypowered.natives.util.Natives;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBufUtil;
|
||||
import io.netty5.buffer.Unpooled;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.util.Random;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
Reference in New Issue
Block a user