Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-10-05 09:40:06 +02:00
Use Channel instead of SocketChannel
For better compatibility with third party software.
Dieser Commit ist enthalten in:
Ursprung
6457ff315f
Commit
85ab5d7741
@ -1,10 +1,10 @@
|
|||||||
package us.myles.ViaVersion.api.data;
|
package us.myles.ViaVersion.api.data;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelHandler;
|
import io.netty.channel.ChannelHandler;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.socket.SocketChannel;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
@ -21,14 +21,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class UserConnection {
|
public class UserConnection {
|
||||||
/**
|
|
||||||
* The channel of the user.
|
|
||||||
* /!\ In some unofficial platforms this is a client channel
|
|
||||||
*
|
|
||||||
* TODO - Weak this field to {@link io.netty.channel.Channel}?
|
|
||||||
*/
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private final SocketChannel channel;
|
private final Channel channel;
|
||||||
Map<Class, StoredObject> storedObjects = new ConcurrentHashMap<>();
|
Map<Class, StoredObject> storedObjects = new ConcurrentHashMap<>();
|
||||||
private boolean active = true;
|
private boolean active = true;
|
||||||
private boolean pendingDisconnect = false;
|
private boolean pendingDisconnect = false;
|
||||||
@ -44,8 +38,8 @@ public class UserConnection {
|
|||||||
private int warnings = 0;
|
private int warnings = 0;
|
||||||
|
|
||||||
|
|
||||||
public UserConnection(SocketChannel socketChannel) {
|
public UserConnection(Channel channel) {
|
||||||
this.channel = socketChannel;
|
this.channel = channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren