mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2025-01-02 18:17:36 +01:00
make protocol version cache expire faster
This commit is contained in:
parent
bf0cb84ac7
commit
5bc033cf40
@ -109,7 +109,7 @@ or registry synchronization (fabric-registry-sync mod).
|
||||
similar in the server it may use the translated version, differently than multiconnect which uses -1 version,
|
||||
which may get the native server version.
|
||||
- It may hold your handshake for up to 10 seconds.
|
||||
- The auto-detected version is cached for 100 seconds.
|
||||
- The auto-detected version is cached for 30 seconds.
|
||||
|
||||
|
||||
### How can I set the version for specific servers?:
|
||||
|
@ -33,7 +33,7 @@ import java.util.logging.Level;
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ProtocolAutoDetector {
|
||||
private static LoadingCache<InetSocketAddress, CompletableFuture<ProtocolVersion>> SERVER_VER = CacheBuilder.newBuilder()
|
||||
.expireAfterAccess(100, TimeUnit.SECONDS)
|
||||
.expireAfterWrite(30, TimeUnit.SECONDS)
|
||||
.build(CacheLoader.from((address) -> {
|
||||
CompletableFuture<ProtocolVersion> future = new CompletableFuture<>();
|
||||
|
||||
|
@ -33,7 +33,7 @@ import java.util.logging.Level;
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ProtocolAutoDetector {
|
||||
private static LoadingCache<InetSocketAddress, CompletableFuture<ProtocolVersion>> SERVER_VER = CacheBuilder.newBuilder()
|
||||
.expireAfterAccess(100, TimeUnit.SECONDS)
|
||||
.expireAfterWrite(30, TimeUnit.SECONDS)
|
||||
.build(CacheLoader.from((address) -> {
|
||||
CompletableFuture<ProtocolVersion> future = new CompletableFuture<>();
|
||||
|
||||
|
@ -33,7 +33,7 @@ import java.util.logging.Level;
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ProtocolAutoDetector {
|
||||
private static LoadingCache<InetSocketAddress, CompletableFuture<ProtocolVersion>> SERVER_VER = CacheBuilder.newBuilder()
|
||||
.expireAfterAccess(100, TimeUnit.SECONDS)
|
||||
.expireAfterWrite(30, TimeUnit.SECONDS)
|
||||
.build(CacheLoader.from((address) -> {
|
||||
CompletableFuture<ProtocolVersion> future = new CompletableFuture<>();
|
||||
|
||||
|
@ -33,7 +33,7 @@ import java.util.logging.Level;
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ProtocolAutoDetector {
|
||||
private static LoadingCache<InetSocketAddress, CompletableFuture<ProtocolVersion>> SERVER_VER = CacheBuilder.newBuilder()
|
||||
.expireAfterAccess(100, TimeUnit.SECONDS)
|
||||
.expireAfterWrite(30, TimeUnit.SECONDS)
|
||||
.build(CacheLoader.from((address) -> {
|
||||
CompletableFuture<ProtocolVersion> future = new CompletableFuture<>();
|
||||
|
||||
|
@ -33,7 +33,7 @@ import java.util.logging.Level;
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ProtocolAutoDetector {
|
||||
private static LoadingCache<InetSocketAddress, CompletableFuture<ProtocolVersion>> SERVER_VER = CacheBuilder.newBuilder()
|
||||
.expireAfterAccess(100, TimeUnit.SECONDS)
|
||||
.expireAfterWrite(30, TimeUnit.SECONDS)
|
||||
.build(CacheLoader.from((address) -> {
|
||||
CompletableFuture<ProtocolVersion> future = new CompletableFuture<>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user