From 0f2e007eff236e9b020bd80545e4b82e2ec360f7 Mon Sep 17 00:00:00 2001 From: s809 <43530948+s809@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:29:06 +0500 Subject: [PATCH] Fix config descriptions & clean up --- .../distanthorizons/core/config/Config.java | 29 +++------- .../core/level/AbstractDhServerLevel.java | 2 - .../AbstractFullDataNetworkRequestQueue.java | 6 +-- .../assets/distanthorizons/lang/en_us.json | 53 +++++++++++++------ 4 files changed, 44 insertions(+), 46 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java index 709b185e3..bd8f2191b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java @@ -1546,15 +1546,9 @@ public class Config public static ConfigEntry maxGenerationRequestDistance = new ConfigEntry.Builder() .setServersideShortName("maxGenerationRequestDistance") - .setMinDefaultMax(32, 1024, 4096) + .setMinDefaultMax(256, 4096, 4096) .comment("" + - "Defines the distance players will receive real-time updates for if enabled. \n" + - "\n" + - "Note: \n" + - "This setting does not prevent players from generating farther out. \n" + - "If you want to limit performance impact, change rate limits \n" + - "and thread count/runtime ratio settings instead. \n" + - "It also does not affect the visuals on clients. \n" + + "Defines the distance allowed to generate around the player." + "") .setPerformance(EConfigEntryPerformance.HIGH) .build(); @@ -1573,13 +1567,7 @@ public class Config .setServersideShortName("realTimeUpdateDistanceRadius") .setMinDefaultMax(32, 256, 4096) .comment("" + - "Defines the distance players will receive real-time updates for if enabled. \n" + - "\n" + - "Note: \n" + - "This setting does not prevent players from generating farther out. \n" + - "If you want to limit performance impact, change rate limits \n" + - "and thread count/runtime ratio settings instead. \n" + - "It also does not affect the visuals on clients. \n" + + "Defines the distance the player will receive updates around." + "") .setPerformance(EConfigEntryPerformance.HIGH) .build(); @@ -1605,15 +1593,10 @@ public class Config public static ConfigEntry maxSyncOnLoadRequestDistance = new ConfigEntry.Builder() .setServersideShortName("maxSyncOnLoadRequestDistance") - .setMinDefaultMax(32, 1024, 4096) + .setMinDefaultMax(256, 4096, 4096) .comment("" + - "Defines the distance players will receive real-time updates for if enabled. \n" + - "\n" + - "Note: \n" + - "This setting does not prevent players from generating farther out. \n" + - "If you want to limit performance impact, change rate limits \n" + - "and thread count/runtime ratio settings instead. \n" + - "It also does not affect the visuals on clients. \n" + + "Defines the distance allowed to be synchronized around the player. \n" + + "Should be the same or larger than maxGenerationRequestDistance in most cases." + "") .setPerformance(EConfigEntryPerformance.HIGH) .build(); diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhServerLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhServerLevel.java index efcc0022f..df537730b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhServerLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhServerLevel.java @@ -253,8 +253,6 @@ public abstract class AbstractDhServerLevel extends AbstractDhLevel implements I } private void queueLodSyncForRequestMessage(ServerPlayerState serverPlayerState, FullDataSourceRequestMessage message, ServerPlayerState.RateLimiterSet rateLimiterSet) { - - if (!serverPlayerState.sessionConfig.getSynchronizeOnLoad()) { message.sendResponse(new RequestRejectedException("Operation is disabled in config.")); diff --git a/core/src/main/java/com/seibel/distanthorizons/core/multiplayer/client/AbstractFullDataNetworkRequestQueue.java b/core/src/main/java/com/seibel/distanthorizons/core/multiplayer/client/AbstractFullDataNetworkRequestQueue.java index 525f8db17..5c1d2b6c0 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/multiplayer/client/AbstractFullDataNetworkRequestQueue.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/multiplayer/client/AbstractFullDataNetworkRequestQueue.java @@ -71,8 +71,6 @@ public abstract class AbstractFullDataNetworkRequestQueue implements IDebugRende private final SupplierBasedRateLimiter rateLimiter = new SupplierBasedRateLimiter<>(this::getRequestRateLimit); - private DhBlockPos2D lastTargetPos = new DhBlockPos2D(0, 0); - //=============// @@ -146,8 +144,6 @@ public abstract class AbstractFullDataNetworkRequestQueue implements IDebugRende return false; } - this.lastTargetPos = targetPos; - // queue requests until the queue is full while (this.getInProgressTaskCount() < this.getWaitingTaskCount() && this.getInProgressTaskCount() < this.getRequestRateLimit() @@ -376,7 +372,7 @@ public abstract class AbstractFullDataNetworkRequestQueue implements IDebugRende { renderer.renderBox(new DebugRenderer.Box(mapEntry.getKey(), -32f, 64f, 0.05f, mapEntry.getValue().networkDataSourceFuture != null ? Color.red - : DhSectionPos.getChebyshevSignedBlockDistance(mapEntry.getKey(), this.lastTargetPos) <= this.getMaxRequestDistance() * 16 ? Color.gray + : DhSectionPos.getChebyshevSignedBlockDistance(mapEntry.getKey(), Objects.requireNonNull(this.level.getTargetPosForGeneration())) <= this.getMaxRequestDistance() * 16 ? Color.gray : Color.darkGray )); } diff --git a/core/src/main/resources/assets/distanthorizons/lang/en_us.json b/core/src/main/resources/assets/distanthorizons/lang/en_us.json index a2940b8c9..e8c777f16 100644 --- a/core/src/main/resources/assets/distanthorizons/lang/en_us.json +++ b/core/src/main/resources/assets/distanthorizons/lang/en_us.json @@ -669,34 +669,55 @@ "Server", - "distanthorizons.config.server.realTimeUpdateDistanceRadiusInChunks": - "Realtime update Radius In Chunks", - "distanthorizons.config.server.realTimeUpdateDistanceRadiusInChunks.@tooltip": - "Defines the how far away players will receive real-time updates for if enabled.", + "distanthorizons.config.server.sendLevelKeys": + "Send Level Keys", + "distanthorizons.config.server.sendLevelKeys.@tooltip": + "Makes the server send level keys for each world.\nDisable this if you use alternative ways to send level keys.", + "distanthorizons.config.server.levelKeyPrefix": - "Level Key Prefix", + "Level Key Prefix", "distanthorizons.config.server.levelKeyPrefix.@tooltip": - "Prefix of the level keys sent to the clients.", + "Prefix of the level keys sent to the clients.\nIf the mod is running behind a proxy, each backend should use a unique value.\nIf this value is empty, level key will be based on the server's seed hash.", + "distanthorizons.config.server.generationRequestRateLimit": - "Rate Limit for Generation Requests", + "Rate Limit for Generation Requests", "distanthorizons.config.server.generationRequestRateLimit.@tooltip": - "How many LOD generation requests per second should a client send? \nAlso limits the amount of player's requests allowed to stay in the server's queue.", + "How many LOD generation requests per second should a client send?\nAlso limits the number of client requests allowed to stay in the server's queue.", + + "distanthorizons.config.server.maxGenerationRequestDistance": + "Max Generation Request Distance", + "distanthorizons.config.server.maxGenerationRequestDistance.@tooltip": + "Defines the distance allowed to generate around the player.", + "distanthorizons.config.server.enableRealTimeUpdates": - "Enable Real-time Updates", + "Enable Real-time Updates", "distanthorizons.config.server.enableRealTimeUpdates.@tooltip": - "If true, clients will receive real-time LOD updates for chunks outside the client's render distance.", + "If true, clients will receive real-time LOD updates for chunks outside the client's render distance.", + + "distanthorizons.config.server.realTimeUpdateDistanceRadiusInChunks": + "Real-time Update Radius in Chunks", + "distanthorizons.config.server.realTimeUpdateDistanceRadiusInChunks.@tooltip": + "Defines the distance the player will receive updates around.", + "distanthorizons.config.server.synchronizeOnLoad": - "Synchronize LODs on Load", + "Synchronize LODs on Load", "distanthorizons.config.server.synchronizeOnLoad.@tooltip": - "If true, clients will receive updated LODs on join if any changes occurred since last join.", + "If true, clients will receive updated LODs when joining or loading new LODs.", + "distanthorizons.config.server.syncOnLoadRateLimit": - "Rate Limit for Sync on Load", + "Rate Limit for Sync on Load", "distanthorizons.config.server.syncOnLoadRateLimit.@tooltip": - "How many LOD sync requests per second should a client send? \nAlso limits the amount of player's requests allowed to stay in the server's queue.", + "How many LOD sync requests per second should a client send?\nAlso limits the number of client's requests allowed to stay in the server's queue.", + + "distanthorizons.config.server.maxSyncOnLoadRequestDistance": + "Max Sync on Load Request Distance", + "distanthorizons.config.server.maxSyncOnLoadRequestDistance.@tooltip": + "Defines the distance allowed to be synchronized around the player.\nShould be the same or larger than maxGenerationRequestDistance in most cases.", + "distanthorizons.config.server.maxDataTransferSpeed": - "Maximum Data Transfer Speed, KB/s", + "Maximum Data Transfer Speed, KB/s", "distanthorizons.config.server.maxDataTransferSpeed.@tooltip": - "Maximum speed for uploading LODs to the clients, in KB/s.\nValue of 0 disables the limit.", + "Maximum speed for uploading LODs to the clients, in KB/s.\nValue of 0 disables the limit.",