3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 23:30:26 +01:00

Remove deprecated members

Dieser Commit ist enthalten in:
xDark 2020-07-31 14:17:31 +03:00
Ursprung 6379936f32
Commit 76bef13377

Datei anzeigen

@ -3,7 +3,6 @@ package com.velocitypowered.proxy.network;
import com.velocitypowered.proxy.util.concurrent.VelocityNettyThreadFactory; import com.velocitypowered.proxy.util.concurrent.VelocityNettyThreadFactory;
import io.netty.channel.ChannelFactory; import io.netty.channel.ChannelFactory;
import io.netty.channel.EventLoopGroup; import io.netty.channel.EventLoopGroup;
import io.netty.channel.ReflectiveChannelFactory;
import io.netty.channel.epoll.Epoll; import io.netty.channel.epoll.Epoll;
import io.netty.channel.epoll.EpollDatagramChannel; import io.netty.channel.epoll.EpollDatagramChannel;
import io.netty.channel.epoll.EpollEventLoopGroup; import io.netty.channel.epoll.EpollEventLoopGroup;
@ -20,22 +19,16 @@ import java.util.concurrent.ThreadFactory;
import java.util.function.BiFunction; import java.util.function.BiFunction;
enum TransportType { enum TransportType {
NIO("NIO", NioServerSocketChannel::new, NioServerSocketChannel.class, NIO("NIO", NioServerSocketChannel::new,
NioSocketChannel::new, NioSocketChannel.class, NioSocketChannel::new,
NioDatagramChannel::new, NioDatagramChannel.class, NioDatagramChannel::new,
(name, type) -> new NioEventLoopGroup(0, createThreadFactory(name, type))), (name, type) -> new NioEventLoopGroup(0, createThreadFactory(name, type))),
EPOLL("epoll", EpollServerSocketChannel::new, EpollServerSocketChannel.class, EPOLL("epoll", EpollServerSocketChannel::new,
EpollSocketChannel::new, EpollSocketChannel.class, EpollSocketChannel::new,
EpollDatagramChannel::new, EpollDatagramChannel.class, EpollDatagramChannel::new,
(name, type) -> new EpollEventLoopGroup(0, createThreadFactory(name, type))); (name, type) -> new EpollEventLoopGroup(0, createThreadFactory(name, type)));
final String name; final String name;
@Deprecated
final Class<? extends ServerSocketChannel> serverSocketChannelClass;
@Deprecated
final Class<? extends SocketChannel> socketChannelClass;
@Deprecated
final Class<? extends DatagramChannel> datagramChannelClass;
final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory; final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory;
final ChannelFactory<? extends SocketChannel> socketChannelFactory; final ChannelFactory<? extends SocketChannel> socketChannelFactory;
final ChannelFactory<? extends DatagramChannel> datagramChannelFactory; final ChannelFactory<? extends DatagramChannel> datagramChannelFactory;
@ -43,34 +36,16 @@ enum TransportType {
TransportType(final String name, TransportType(final String name,
final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory, final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory,
final Class<? extends ServerSocketChannel> serverSocketChannelClass,
final ChannelFactory<? extends SocketChannel> socketChannelFactory, final ChannelFactory<? extends SocketChannel> socketChannelFactory,
final Class<? extends SocketChannel> socketChannelClass,
final ChannelFactory<? extends DatagramChannel> datagramChannelFactory, final ChannelFactory<? extends DatagramChannel> datagramChannelFactory,
final Class<? extends DatagramChannel> datagramChannelClass,
final BiFunction<String, Type, EventLoopGroup> eventLoopGroupFactory) { final BiFunction<String, Type, EventLoopGroup> eventLoopGroupFactory) {
this.name = name; this.name = name;
this.serverSocketChannelClass = serverSocketChannelClass;
this.socketChannelClass = socketChannelClass;
this.datagramChannelClass = datagramChannelClass;
this.serverSocketChannelFactory = serverSocketChannelFactory; this.serverSocketChannelFactory = serverSocketChannelFactory;
this.socketChannelFactory = socketChannelFactory; this.socketChannelFactory = socketChannelFactory;
this.datagramChannelFactory = datagramChannelFactory; this.datagramChannelFactory = datagramChannelFactory;
this.eventLoopGroupFactory = eventLoopGroupFactory; this.eventLoopGroupFactory = eventLoopGroupFactory;
} }
@Deprecated
TransportType(final String name,
final Class<? extends ServerSocketChannel> serverSocketChannelClass,
final Class<? extends SocketChannel> socketChannelClass,
final Class<? extends DatagramChannel> datagramChannelClass,
final BiFunction<String, Type, EventLoopGroup> eventLoopGroupFactory) {
this(name, new ReflectiveChannelFactory<>(serverSocketChannelClass), serverSocketChannelClass,
new ReflectiveChannelFactory<>(socketChannelClass), socketChannelClass,
new ReflectiveChannelFactory<>(datagramChannelClass), datagramChannelClass,
eventLoopGroupFactory);
}
@Override @Override
public String toString() { public String toString() {
return this.name; return this.name;