Compare commits

...

5 Commits

Author SHA1 Message Date
s809 338bfb9f9e Bump protocol version 2025-08-01 23:11:17 +05:00
s809 37cb00b8e2 Add isLocalChunkUseAllowed config value 2025-08-01 23:10:37 +05:00
s809 a05bd307f9 Reduce network logging by default 2025-07-27 23:21:13 +05:00
James Seibel d78a50ce49 up version number 2.3.4 -> 2.3.5 2025-07-19 14:59:14 -05:00
James Seibel 013eab9268 add space to self updater warning log 2025-07-19 14:57:22 -05:00
7 changed files with 36 additions and 12 deletions
@@ -40,6 +40,7 @@ public enum EDhApiLoggerMode
LOG_DEBUG_TO_CHAT_AND_FILE(Level.DEBUG, Level.DEBUG),
LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE(Level.INFO, Level.WARN),
LOG_ERROR_TO_CHAT_AND_INFO_TO_FILE(Level.INFO, Level.ERROR),
LOG_ERROR_TO_CHAT_AND_WARNING_TO_FILE(Level.ERROR, Level.WARN),
;
public final Level levelForFile;
@@ -31,14 +31,14 @@ public final class ModInfo
public static final String DEDICATED_SERVER_INITIAL_PATH = "dedicated_server_initial";
/** Incremented every time any packets are added, changed or removed, with a few exceptions. */
public static final int PROTOCOL_VERSION = 11;
public static final int PROTOCOL_VERSION = 12;
public static final String WRAPPER_PACKET_PATH = "message";
/** The internal mod name */
public static final String NAME = "DistantHorizons";
/** Human-readable version of NAME */
public static final String READABLE_NAME = "Distant Horizons";
public static final String VERSION = "2.3.4-b";
public static final String VERSION = "2.3.5-b-dev";
/** Returns true if the current build is an unstable developer build, false otherwise. */
public static final boolean IS_DEV_BUILD = VERSION.toLowerCase().contains("dev");
@@ -1520,7 +1520,7 @@ public class Config
public static ConfigEntry<EDhApiLoggerMode> logNetworkEvent = new ConfigEntry.Builder<EDhApiLoggerMode>()
.setChatCommandName("logging.logNetworkEvent")
.set(EDhApiLoggerMode.LOG_ERROR_TO_CHAT_AND_INFO_TO_FILE)
.set(EDhApiLoggerMode.LOG_ERROR_TO_CHAT_AND_WARNING_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about network operations. \n"
+ "This can be useful for debugging.")
@@ -1705,6 +1705,15 @@ public class Config
// Common
public static ConfigEntry<Boolean> allowLocalChunkUse = new ConfigEntry.Builder<Boolean>()
.setChatCommandName("common.allowLocalChunkUse")
.setAppearance(EConfigEntryAppearance.ONLY_IN_FILE)
.set(true)
.comment(""
+ "If true, clients will be able to update LODs using chunks they load."
+ "")
.build();
public static ConfigEntry<Integer> maxDataTransferSpeed = new ConfigEntry.Builder<Integer>()
.setChatCommandName("common.maxDataTransferSpeed")
.setMinDefaultMax(0, 500, 1000000 /* 1 GB/s */)
@@ -111,7 +111,7 @@ public class SelfUpdater
}
if (!ModrinthGetter.mcVersions.contains(mcVersion))
{
LOGGER.warn("Minecraft version ["+ mcVersion +"] is not findable on Modrinth, only findable versions are ["+ StringUtil.join(",", ModrinthGetter.mcVersions) +"]");
LOGGER.warn("Minecraft version ["+ mcVersion +"] is not findable on Modrinth, only findable versions are ["+ StringUtil.join(", ", ModrinthGetter.mcVersions) +"]");
return false;
}
@@ -340,7 +340,17 @@ public class DhClientLevel extends AbstractDhLevel implements IDhClientLevel
return true;
}
return !this.networkState.sessionConfig.isRealTimeUpdatesEnabled() || this.loadedOnceChunks.add(chunkPos);
if (!this.networkState.sessionConfig.isLocalChunkUseAllowed())
{
return false;
}
if (this.networkState.sessionConfig.isRealTimeUpdatesEnabled())
{
return this.loadedOnceChunks.add(chunkPos);
}
return true;
}
@@ -33,9 +33,9 @@ public class SessionConfig implements INetworkObject
registerConfigEntry(Config.Common.WorldGenerator.enableDistantGeneration, Boolean::logicalAnd);
registerConfigEntry(Config.Server.maxGenerationRequestDistance, Math::min);
registerConfigEntry(Config.Server.generationBoundsX, (x, y) -> y);
registerConfigEntry(Config.Server.generationBoundsZ, (x, y) -> y);
registerConfigEntry(Config.Server.generationBoundsRadius, (x, y) -> y);
registerConfigEntry(Config.Server.generationBoundsX, (clientValue, serverValue) -> serverValue);
registerConfigEntry(Config.Server.generationBoundsZ, (clientValue, serverValue) -> serverValue);
registerConfigEntry(Config.Server.generationBoundsRadius, (clientValue, serverValue) -> serverValue);
registerConfigEntry(Config.Server.generationRequestRateLimit, Math::min);
registerConfigEntry(Config.Server.enableRealTimeUpdates, Boolean::logicalAnd);
@@ -45,15 +45,16 @@ public class SessionConfig implements INetworkObject
registerConfigEntry(Config.Server.maxSyncOnLoadRequestDistance, Math::min);
registerConfigEntry(Config.Server.syncOnLoadRateLimit, Math::min);
registerConfigEntry(Config.Server.maxDataTransferSpeed, (x, y) -> {
if (x == 0 && y == 0)
registerConfigEntry(Config.Server.allowLocalChunkUse, (clientValue, serverValue) -> serverValue);
registerConfigEntry(Config.Server.maxDataTransferSpeed, (clientValue, serverValue) -> {
if (clientValue == 0 && serverValue == 0)
{
return 0;
}
return Math.min(
x > 0 ? x : Integer.MAX_VALUE,
y > 0 ? y : Integer.MAX_VALUE
clientValue > 0 ? clientValue : Integer.MAX_VALUE,
serverValue > 0 ? serverValue : Integer.MAX_VALUE
);
});
}
@@ -80,6 +81,7 @@ public class SessionConfig implements INetworkObject
public int getMaxSyncOnLoadDistance() { return this.getValue(Config.Server.maxSyncOnLoadRequestDistance); }
public int getSyncOnLoginRateLimit() { return this.getValue(Config.Server.syncOnLoadRateLimit); }
public boolean isLocalChunkUseAllowed() { return this.getValue(Config.Server.allowLocalChunkUse); }
public int getMaxDataTransferSpeed() { return this.getValue(Config.Server.maxDataTransferSpeed); }
@@ -1022,6 +1022,8 @@
"File: Info, Chat: Warning",
"distanthorizons.config.enum.EDhApiLoggerMode.LOG_ERROR_TO_CHAT_AND_INFO_TO_FILE":
"File: Info, Chat: Error",
"distanthorizons.config.enum.EDhApiLoggerMode.LOG_ERROR_TO_CHAT_AND_WARNING_TO_FILE":
"File: Warning, Chat: Error",
"distanthorizons.config.enum.EDhApiGpuUploadMethod.AUTO":
"Auto",