TimeoutProfile class

Пакет: com.hypixel.hytale.server.core

Файл: com/hypixel/hytale/server/core/HytaleServerConfig.java

Поля (16)

МодификаторыТипИмя
public static final Codec<HytaleServerConfig.TimeoutProfile> CODEC
private static final HytaleServerConfig.TimeoutProfile MULTIPLAYER_DEFAULTS
private static final HytaleServerConfig.TimeoutProfile SINGLEPLAYER_DEFAULTS
private Duration auth
private Duration authGrant
private Duration authServerExchange
private Duration authToken
private Duration auxStreamPending
private transient HytaleServerConfig hytaleServerConfig
private Duration initial
private Duration password
private Duration play
private Duration setupAddToUniverse
private Duration setupAssetsRequest
private Duration setupSendAssets
private Duration setupWorldSettings

Методы (28)

МодификаторыВозвратСигнатура
public static HytaleServerConfig.TimeoutProfile defaultspublic static HytaleServerConfig.TimeoutProfile defaults()
public Duration getAuthpublic Duration getAuth()
public Duration getAuthGrantpublic Duration getAuthGrant()
public Duration getAuthServerExchangepublic Duration getAuthServerExchange()
public Duration getAuthTokenpublic Duration getAuthToken()
public Duration getAuxStreamPendingpublic Duration getAuxStreamPending()
public Duration getInitialpublic Duration getInitial()
public Duration getPasswordpublic Duration getPassword()
public Duration getPlaypublic Duration getPlay()
public Duration getSetupAddToUniversepublic Duration getSetupAddToUniverse()
public Duration getSetupAssetsRequestpublic Duration getSetupAssetsRequest()
public Duration getSetupSendAssetspublic Duration getSetupSendAssets()
public Duration getSetupWorldSettingspublic Duration getSetupWorldSettings()
if if(this.hytaleServerConfig != null)
private void markChangedprivate void markChanged()
public void setAuthpublic void setAuth(Duration var1)
public void setAuthGrantpublic void setAuthGrant(Duration var1)
public void setAuthServerExchangepublic void setAuthServerExchange(Duration var1)
public void setAuthTokenpublic void setAuthToken(Duration var1)
public void setAuxStreamPendingpublic void setAuxStreamPending(Duration var1)
void setHytaleServerConfigvoid setHytaleServerConfig(HytaleServerConfig var1)
public void setInitialpublic void setInitial(Duration var1)
public void setPasswordpublic void setPassword(Duration var1)
public void setPlaypublic void setPlay(Duration var1)
public void setSetupAddToUniversepublic void setSetupAddToUniverse(Duration var1)
public void setSetupAssetsRequestpublic void setSetupAssetsRequest(Duration var1)
public void setSetupSendAssetspublic void setSetupSendAssets(Duration var1)
public void setSetupWorldSettingspublic void setSetupWorldSettings(Duration var1)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.core;

class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.DocumentContainingCodec;
class="kw">import com.hypixel.hytale.codec.ExtraInfo;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.codec.codecs.array.ArrayCodec;
class="kw">import com.hypixel.hytale.codec.codecs.map.MapCodec;
class="kw">import com.hypixel.hytale.codec.codecs.map.ObjectMapCodec;
class="kw">import com.hypixel.hytale.codec.function.FunctionCodec;
class="kw">import com.hypixel.hytale.codec.lookup.Deferred;
class="kw">import com.hypixel.hytale.codec.lookup.DeferredCodec;
class="kw">import com.hypixel.hytale.codec.lookup.Priority;
class="kw">import com.hypixel.hytale.codec.util.RawJsonReader;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import com.hypixel.hytale.common.plugin.PluginIdentifier;
class="kw">import com.hypixel.hytale.logger.HytaleLogger;
class="kw">import com.hypixel.hytale.math.iterator.SphereOffsets;
class="kw">import com.hypixel.hytale.protocol.GameMode;
class="kw">import com.hypixel.hytale.protocol.HostAddress;
class="kw">import com.hypixel.hytale.server.core.auth.AuthCredentialStoreProvider;
class="kw">import com.hypixel.hytale.server.core.codec.ProtocolCodecs;
class="kw">import com.hypixel.hytale.server.core.config.BackupConfig;
class="kw">import com.hypixel.hytale.server.core.config.CrashRecoveryConfig;
class="kw">import com.hypixel.hytale.server.core.config.ModConfig;
class="kw">import com.hypixel.hytale.server.core.config.RateLimitConfig;
class="kw">import com.hypixel.hytale.server.core.config.ServerWorldMapConfig;
class="kw">import com.hypixel.hytale.server.core.config.UpdateConfig;
class="kw">import com.hypixel.hytale.server.core.modules.accesscontrol.provider.BanStorageProvider;
class="kw">import com.hypixel.hytale.server.core.modules.accesscontrol.provider.DiskBanStorageProvider;
class="kw">import com.hypixel.hytale.server.core.universe.hardcore.HardcoreMode;
class="kw">import com.hypixel.hytale.server.core.universe.playerdata.DefaultPlayerStorageProvider;
class="kw">import com.hypixel.hytale.server.core.universe.playerdata.DiskPlayerStorageProvider;
class="kw">import com.hypixel.hytale.server.core.universe.playerdata.PlayerStorageProvider;
class="kw">import com.hypixel.hytale.server.core.universe.resources.DefaultUniverseResourceStorageProvider;
class="kw">import com.hypixel.hytale.server.core.universe.resources.DiskUniverseResourceStorageProvider;
class="kw">import com.hypixel.hytale.server.core.universe.resources.IUniverseResourceStorageProvider;
class="kw">import com.hypixel.hytale.server.core.util.BsonUtil;
class="kw">import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
class="kw">import java.nio.file.Files;
class="kw">import java.nio.file.Path;
class="kw">import java.time.Duration;
class="kw">import java.util.Collections;
class="kw">import java.util.Map;
class="kw">import java.util.Optional;
class="kw">import java.util.Map.Entry;
class="kw">import java.util.concurrent.CompletableFuture;
class="kw">import java.util.concurrent.ConcurrentHashMap;
class="kw">import java.util.concurrent.atomic.AtomicBoolean;
class="kw">import java.util.logging.Level;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.bson.BsonDocument;

class="kw">public class HytaleServerConfig {
   class="kw">public class="kw">static class="kw">final int VERSION = 4;
   class="kw">private class="kw">static class="kw">final String HARDCORE_GAME_MODE_TYPE_ON_DEATH = "HardcoreSpectator";
   class="kw">public class="kw">static class="kw">final int DEFAULT_MAX_VIEW_RADIUS = 32;
   class="kw">public class="kw">static class="kw">final int MAX_VIEW_RADIUS_LIMIT = 32;
   @Nonnull
   class="kw">public class="kw">static class="kw">final Path PATH = Path.of("config.json");
   class="kw">public class="kw">static class="kw">final PluginIdentifier[] PLUGIN_IDENTIFIERS = new PluginIdentifier[0];
   class="kw">private class="kw">static class="kw">final HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
   @Nonnull
   class="kw">public class="kw">static class="kw">final BuilderCodec<HytaleServerConfig> CODEC = BuilderCodec.builder(HytaleServerConfig.class, HytaleServerConfig::new)
      .versioned()
      .codecVersion(4)
      .append(new KeyedCodec<>("ServerName", Codec.STRING), (var0, var1) -> var0.serverName = var1, var0 -> var0.serverName)
      .add()
      .append(new KeyedCodec<>("MOTD", Codec.STRING), (var0, var1) -> var0.motd = var1, var0 -> var0.motd)
      .add()
      .append(new KeyedCodec<>("Password", Codec.STRING), (var0, var1) -> var0.password = var1, var0 -> var0.password)
      .add()
      .append(new KeyedCodec<>("MaxPlayers", Codec.INTEGER), (var0, var1) -> var0.maxPlayers = var1, var0 -> var0.maxPlayers)
      .add()
      .append(new KeyedCodec<>("MaxViewRadius", Codec.INTEGER), (var0, var1) -> var0.maxViewRadius = var1, var0 -> var0.maxViewRadius)
      .add()
      .append(new KeyedCodec<>("Defaults", HytaleServerConfig.Defaults.CODEC), (var0, var1) -> var0.defaults = var1, var0 -> var0.defaults)
      .add()
      .append(
         new KeyedCodec<>("ConnectionTimeouts", HytaleServerConfig.TimeoutProfile.CODEC),
         (var0, var1) -> var0.connectionTimeouts = var1,
         var0 -> var0.connectionTimeouts
      )
      .add()
      .append(new KeyedCodec<>("RateLimit", RateLimitConfig.CODEC), (var0, var1) -> var0.rateLimitConfig = var1, var0 -> var0.rateLimitConfig)
      .add()
      .append(new KeyedCodec<>("Modules", new MapCodec<>(HytaleServerConfig.Module.CODEC, ConcurrentHashMap::new, false)), (var0, var1) -> {
         var0.modules = var1;
         var0.unmodifiableModules = Collections.unmodifiableMap(var1);
      }, var0 -> var0.modules)
      .add()
      .append(new KeyedCodec<>("LogLevels", new MapCodec<>(Codec.LOG_LEVEL, ConcurrentHashMap::new, false)), (var0, var1) -> {
         var0.logLevels = var1;
         var0.unmodifiableLogLevels = Collections.unmodifiableMap(var0.logLevels);
      }, var0 -> var0.logLevels)
      .add()
      .<Map>append(
         new KeyedCodec<>(
            "Plugins", new ObjectMapCodec<>(ModConfig.CODEC, Object2ObjectOpenHashMap::new, PluginIdentifier::toString, PluginIdentifier::fromString, false)
         ),
         (var0, var1) -> var0.legacyPluginConfig = var1,
         var0 -> null
      )
      .setVersionRange(0, 2)
      .add()
      .append(
         new KeyedCodec<>(
            "Mods", new ObjectMapCodec<>(ModConfig.CODEC, ConcurrentHashMap::new, PluginIdentifier::toString, PluginIdentifier::fromString, false)
         ),
         (var0, var1) -> var0.modConfig = var1,
         var0 -> var0.modConfig
      )
      .add()
      .append(
         new KeyedCodec<>(
            "ModLoadOrder",
            new ArrayCodec<>(new FunctionCodec<>(Codec.STRING, PluginIdentifier::fromString, PluginIdentifier::toString), PluginIdentifier[]::new)
         ),
         (var0, var1) -> var0.modLoadOrder = var1,
         var0 -> var0.modLoadOrder.length == 0 ? null : var0.modLoadOrder
      )
      .add()
      .<Boolean>append(new KeyedCodec<>("DefaultModsEnabled", Codec.BOOLEAN), (var0, var1) -> var0.defaultModsEnabled = var1, var0 -> var0.defaultModsEnabled)
      .setVersionRange(4, Integer.MAX_VALUE)
      .add()
      .append(new KeyedCodec<>("RequireJoinPermission", Codec.BOOLEAN), (var0, var1) -> var0.requireJoinPermission = var1, var0 -> var0.requireJoinPermission)
      .add()
      .append(
         new KeyedCodec<>("DisplayTmpTagsInStrings", Codec.BOOLEAN), (var0, var1) -> var0.displayTmpTagsInStrings = var1, var0 -> var0.displayTmpTagsInStrings
      )
      .add()
      .append(
         new KeyedCodec<>("PlayerStorage", new DeferredCodec<>(PlayerStorageProvider.CODEC)),
         (var0, var1) -> var0.playerStorageProvider = var1,
         var0 -> var0.playerStorageProvider.isEmpty() ? null : var0.playerStorageProvider
      )
      .add()
      .append(
         new KeyedCodec<>("UniverseResourceStorage", new DeferredCodec<>(IUniverseResourceStorageProvider.CODEC)),
         (var0, var1) -> var0.universeResourceStorageProvider = var1,
         var0 -> var0.universeResourceStorageProvider.isEmpty() ? null : var0.universeResourceStorageProvider
      )
      .add()
      .append(
         new KeyedCodec<>("BanStorage", new DeferredCodec<>(BanStorageProvider.CODEC)),
         (var0, var1) -> var0.banStorageProvider = var1,
         var0 -> var0.banStorageProvider.isEmpty() ? null : var0.banStorageProvider
      )
      .add()
      .append(
         new KeyedCodec<>("AuthCredentialStore", new DeferredCodec<>(AuthCredentialStoreProvider.CODEC)),
         (var0, var1) -> var0.authCredentialStoreProvider = var1,
         var0 -> var0.authCredentialStoreProvider.isEmpty() ? null : var0.authCredentialStoreProvider
      )
      .add()
      .append(new KeyedCodec<>("Update", UpdateConfig.CODEC), (var0, var1) -> var0.updateConfig = var1, var0 -> var0.updateConfig)
      .add()
      .append(new KeyedCodec<>("Backup", BackupConfig.CODEC), (var0, var1) -> var0.backupConfig = var1, var0 -> var0.backupConfig)
      .add()
      .append(
         new KeyedCodec<>("WorldMap", ServerWorldMapConfig.CODEC),
         (var0, var1) -> var0.worldMapConfig = var1 != null ? var1 : new ServerWorldMapConfig(var0),
         var0 -> var0.worldMapConfig
      )
      .add()
      .append(
         new KeyedCodec<>(
            "FallbackServer",
            BuilderCodec.builder(HostAddress.class, HostAddress::new)
               .append(new KeyedCodec<>("Host", Codec.STRING), (var0, var1) -> var0.host = var1, var0 -> var0.host)
               .addValidator(Validators.nonNull())
               .add()
               .<Short>append(new KeyedCodec<>("Port", Codec.SHORT), (var0, var1) -> var0.port = var1, var0 -> var0.port)
               .addValidator(Validators.nonNull())
               .add()
               .build()
         ),
         (var0, var1) -> var0.fallbackServer = var1,
         var0 -> var0.fallbackServer
      )
      .add()
      .afterDecode((var0, var1) -> {
         var0.defaults.hytaleServerConfig = var0;
         var0.connectionTimeouts.setHytaleServerConfig(var0);
         var0.rateLimitConfig.setHytaleServerConfig(var0);
         var0.updateConfig.setHytaleServerConfig(var0);
         var0.backupConfig.setHytaleServerConfig(var0);
         var0.worldMapConfig.setHytaleServerConfig(var0);
         var0.modules.values().forEach(var1x -> var1x.setHytaleServerConfig(var0));
         int var2 = Math.clamp(var0.maxViewRadius, 1, 32);
         if (var2 != var0.maxViewRadius) {
            LOGGER.at(Level.WARNING).log("MaxViewRadius %s is outside [1, %s], using %s", var0.maxViewRadius, 32, var2);
            var0.maxViewRadius = var2;
         }

         if (var0.legacyPluginConfig != null && !var0.legacyPluginConfig.isEmpty()) {
            for (Entry var4 : var0.legacyPluginConfig.entrySet()) {
               var0.modConfig.putIfAbsent(var4.getKey(), var4.getValue());
            }

            var0.legacyPluginConfig = null;
            var0.markChanged();
         }

         if (var0.defaultModsEnabled == null && var1.getVersion() < 4) {
            var0.defaultModsEnabled = true;
         }

         if (var0.defaults.hardcoreMode == null) {
            boolean var5 = "HardcoreSpectator".equals(var0.defaults.gameModeTypeOnDeath);
            var0.defaults.hardcoreMode = var5 ? HardcoreMode.PerPlayer : HardcoreMode.None;
            var0.markChanged();
         }

         if (var0.defaults.getHardcoreMode() != HardcoreMode.None && var0.defaults.gameModeTypeOnDeath == null) {
            var0.defaults.gameModeTypeOnDeath = "HardcoreSpectator";
            var0.markChanged();
         }

         if (var1.getVersion() != 4) {
            var0.markChanged();
         }
      })
      .build();
   @Nonnull
   class="kw">private class="kw">final class="kw">transient AtomicBoolean hasChanged = new AtomicBoolean();
   class="kw">private String serverName = "Hytale Server";
   class="kw">private String motd = "";
   class="kw">private String password = "";
   class="kw">private int maxPlayers = 100;
   class="kw">private int maxViewRadius = 32;
   @Nonnull
   class="kw">private HytaleServerConfig.Defaults defaults = new HytaleServerConfig.Defaults(this);
   @Nonnull
   class="kw">private HytaleServerConfig.TimeoutProfile connectionTimeouts = new HytaleServerConfig.TimeoutProfile(this);
   @Nonnull
   class="kw">private RateLimitConfig rateLimitConfig = new RateLimitConfig(this);
   @Nonnull
   class="kw">private Map<String, HytaleServerConfig.Module> modules = new ConcurrentHashMap<>();
   @Nonnull
   class="kw">private Map<String, Level> logLevels = Collections.emptyMap();
   @Nullable
   class="kw">private class="kw">transient Map<PluginIdentifier, ModConfig> legacyPluginConfig;
   @Nonnull
   class="kw">private Map<PluginIdentifier, ModConfig> modConfig = new ConcurrentHashMap<>();
   class="kw">private PluginIdentifier[] modLoadOrder = PLUGIN_IDENTIFIERS;
   @Nullable
   class="kw">private Boolean defaultModsEnabled;
   @Nonnull
   class="kw">private Map<String, HytaleServerConfig.Module> unmodifiableModules = Collections.unmodifiableMap(this.modules);
   @Nonnull
   class="kw">private Map<String, Level> unmodifiableLogLevels = Collections.unmodifiableMap(this.logLevels);
   @Nonnull
   class="kw">private Deferred<PlayerStorageProvider> playerStorageProvider = new Deferred<>(PlayerStorageProvider.CODEC);
   @Nonnull
   class="kw">private Deferred<IUniverseResourceStorageProvider> universeResourceStorageProvider = new Deferred<>(IUniverseResourceStorageProvider.CODEC);
   @Nonnull
   class="kw">private Deferred<BanStorageProvider> banStorageProvider = new Deferred<>(BanStorageProvider.CODEC);
   @Nonnull
   class="kw">private Deferred<AuthCredentialStoreProvider> authCredentialStoreProvider = new Deferred<>(AuthCredentialStoreProvider.CODEC);
   class="kw">private class="kw">volatile boolean requireJoinPermission;
   class="kw">private boolean displayTmpTagsInStrings;
   @Nonnull
   class="kw">private UpdateConfig updateConfig = new UpdateConfig(this);
   @Nonnull
   class="kw">private BackupConfig backupConfig = new BackupConfig(this);
   @Nonnull
   class="kw">private ServerWorldMapConfig worldMapConfig = new ServerWorldMapConfig(this);
   @Nullable
   class="kw">private HostAddress fallbackServer;
   @Nullable
   class="kw">private class="kw">transient SphereOffsets sphereOffsets;

   class="kw">public HytaleServerConfig() {
   }

   class="kw">public class="kw">static void setBoot(@Nonnull HytaleServerConfig var0, @Nonnull PluginIdentifier var1, boolean var2) {
      var0.modConfig.computeIfAbsent(var1, var0x -> new ModConfig()).setEnabled(var2);
   }

   class="kw">public String getServerName() {
      class="kw">return this.serverName;
   }

   class="kw">public void setServerName(@Nonnull String var1) {
      this.serverName = var1;
      this.markChanged();
   }

   class="kw">public String getMotd() {
      class="kw">return this.motd;
   }

   class="kw">public void setMotd(@Nonnull String var1) {
      this.motd = var1;
      this.markChanged();
   }

   class="kw">public String getPassword() {
      class="kw">return this.password;
   }

   class="kw">public void setPassword(@Nonnull String var1) {
      this.password = var1;
      this.markChanged();
   }

   class="kw">public boolean isRequireJoinPermission() {
      class="kw">return this.requireJoinPermission;
   }

   class="kw">public void setRequireJoinPermission(boolean var1) {
      this.requireJoinPermission = var1;
      this.markChanged();
   }

   class="kw">public boolean isDisplayTmpTagsInStrings() {
      class="kw">return this.displayTmpTagsInStrings;
   }

   class="kw">public void setDisplayTmpTagsInStrings(boolean var1) {
      this.displayTmpTagsInStrings = var1;
   }

   class="kw">public int getMaxPlayers() {
      class="kw">return this.maxPlayers;
   }

   class="kw">public void setMaxPlayers(int var1) {
      this.maxPlayers = var1;
      this.markChanged();
   }

   class="kw">public int getMaxViewRadius() {
      class="kw">return this.maxViewRadius;
   }

   class="kw">public void setMaxViewRadius(int var1) {
      class="kw">synchronized (this) {
         this.maxViewRadius = var1;
         this.sphereOffsets = null;
      }

      this.markChanged();
   }

   @Nonnull
   class="kw">public HytaleServerConfig.Defaults getDefaults() {
      class="kw">return this.defaults;
   }

   class="kw">public void setDefaults(@Nonnull HytaleServerConfig.Defaults var1) {
      this.defaults = var1;
      this.markChanged();
   }

   @Nonnull
   class="kw">public HytaleServerConfig.TimeoutProfile getConnectionTimeouts() {
      class="kw">return this.connectionTimeouts;
   }

   class="kw">public void setConnectionTimeouts(@Nonnull HytaleServerConfig.TimeoutProfile var1) {
      this.connectionTimeouts = var1;
      this.markChanged();
   }

   @Nonnull
   class="kw">public RateLimitConfig getRateLimitConfig() {
      class="kw">return this.rateLimitConfig;
   }

   class="kw">public void setRateLimitConfig(@Nonnull RateLimitConfig var1) {
      this.rateLimitConfig = var1;
      this.markChanged();
   }

   @Nonnull
   class="kw">public Map<String, HytaleServerConfig.Module> getModules() {
      class="kw">return this.unmodifiableModules;
   }

   @Nonnull
   class="kw">public HytaleServerConfig.Module getModule(String var1) {
      class="kw">return this.modules.computeIfAbsent(var1, var1x -> new HytaleServerConfig.Module(this));
   }

   class="kw">public void setModules(@Nonnull Map<String, HytaleServerConfig.Module> var1) {
      this.modules = var1;
      this.markChanged();
   }

   @Nonnull
   class="kw">public Map<String, Level> getLogLevels() {
      class="kw">return this.unmodifiableLogLevels;
   }

   class="kw">public void setLogLevels(@Nonnull Map<String, Level> var1) {
      this.logLevels = var1;
      this.markChanged();
   }

   @Nonnull
   class="kw">public Map<PluginIdentifier, ModConfig> getModConfig() {
      class="kw">return this.modConfig;
   }

   class="kw">public void setModConfig(@Nonnull Map<PluginIdentifier, ModConfig> var1) {
      this.modConfig = var1;
      this.markChanged();
   }

   class="kw">public boolean getDefaultModsEnabled() {
      class="kw">return this.defaultModsEnabled != null ? this.defaultModsEnabled : !Constants.SINGLEPLAYER;
   }

   class="kw">public PluginIdentifier[] getModLoadOrder() {
      class="kw">return this.modLoadOrder;
   }

   @Nonnull
   class="kw">public PlayerStorageProvider getPlayerStorageProvider() {
      class="kw">return this.playerStorageProvider.get();
   }

   class="kw">public void setPlayerStorageProvider(@Nonnull PlayerStorageProvider var1) {
      this.playerStorageProvider.set(var1);
      this.markChanged();
   }

   @Nonnull
   class="kw">public IUniverseResourceStorageProvider getUniverseResourceStorageProvider() {
      class="kw">return this.universeResourceStorageProvider.get();
   }

   class="kw">public void setUniverseResourceStorageProvider(@Nonnull IUniverseResourceStorageProvider var1) {
      this.universeResourceStorageProvider.set(var1);
      this.markChanged();
   }

   @Nonnull
   class="kw">public BanStorageProvider getBanStorageProvider() {
      class="kw">return this.banStorageProvider.get();
   }

   class="kw">public void setBanStorageProvider(@Nonnull BanStorageProvider var1) {
      this.banStorageProvider.set(var1);
      this.markChanged();
   }

   @Nonnull
   class="kw">public AuthCredentialStoreProvider getAuthCredentialStoreProvider() {
      class="kw">return this.authCredentialStoreProvider.get();
   }

   class="kw">public void setAuthCredentialStoreProvider(@Nonnull AuthCredentialStoreProvider var1) {
      this.authCredentialStoreProvider.set(var1);
      this.markChanged();
   }

   @Nonnull
   class="kw">public UpdateConfig getUpdateConfig() {
      class="kw">return this.updateConfig;
   }

   class="kw">public void setUpdateConfig(@Nonnull UpdateConfig var1) {
      this.updateConfig = var1;
      this.markChanged();
   }

   @Nonnull
   class="kw">public BackupConfig getBackupConfig() {
      class="kw">return this.backupConfig;
   }

   class="kw">public void setBackupConfig(@Nonnull BackupConfig var1) {
      this.backupConfig = var1;
      this.markChanged();
   }

   @Nullable
   class="kw">public HostAddress getFallbackServer() {
      class="kw">return this.fallbackServer;
   }

   class="kw">public void setFallbackServer(@Nullable HostAddress var1) {
      this.fallbackServer = var1;
      this.markChanged();
   }

   @Nonnull
   class="kw">public ServerWorldMapConfig getWorldMapConfig() {
      class="kw">return this.worldMapConfig;
   }

   class="kw">public void setWorldMapConfig(@Nonnull ServerWorldMapConfig var1) {
      this.worldMapConfig = var1;
      this.markChanged();
   }

   class="kw">public void removeModule(@Nonnull String var1) {
      this.modules.remove(var1);
      this.markChanged();
   }

   class="kw">public void markChanged() {
      this.hasChanged.set(true);
   }

   class="kw">public boolean consumeHasChanged() {
      class="kw">return this.hasChanged.getAndSet(false);
   }

   @Nonnull
   class="kw">public class="kw">static HytaleServerConfig load() {
      class="kw">return load(PATH);
   }

   @Nonnull
   class="kw">public class="kw">static HytaleServerConfig load(@Nonnull Path var0) {
      if (!Files.isRegularFile(var0)) {
         HytaleServerConfig var3 = new HytaleServerConfig();
         if (!Options.isBare()) {
            save(var3).join();
         }

         class="kw">return var3;
      } else {
         try {
            HytaleServerConfig var1 = RawJsonReader.readSyncWithBak(var0, CODEC, HytaleLogger.getLogger());
            if (var1 == null) {
               throw new RuntimeException("Failed to load server config from " + var0);
            } else {
               class="kw">return var1;
            }
         } catch (Exception var2) {
            throw new RuntimeException("Failed to read server config!", var2);
         }
      }
   }

   @Nonnull
   class="kw">public class="kw">static CompletableFuture<Void> save(@Nonnull HytaleServerConfig var0) {
      class="kw">return save(PATH, var0);
   }

   @Nonnull
   class="kw">public class="kw">static CompletableFuture<Void> save(@Nonnull Path var0, @Nonnull HytaleServerConfig var1) {
      BsonDocument var2 = CODEC.encode(var1, ExtraInfo.THREAD_LOCAL.get()).asDocument();
      class="kw">return BsonUtil.writeDocument(var0, var2);
   }

   @Nonnull
   class="kw">public class="kw">synchronized SphereOffsets getMaxViewSphereOffsets() {
      if (this.sphereOffsets == null) {
         this.sphereOffsets = SphereOffsets.build(this.maxViewRadius);
      }

      class="kw">return this.sphereOffsets;
   }

   class="kw">static {
      PlayerStorageProvider.CODEC.register(Priority.DEFAULT, "Hytale", DefaultPlayerStorageProvider.class, DefaultPlayerStorageProvider.CODEC);
      PlayerStorageProvider.CODEC.register("Disk", DiskPlayerStorageProvider.class, DiskPlayerStorageProvider.CODEC);
      IUniverseResourceStorageProvider.CODEC
         .register(Priority.DEFAULT, "Hytale", DefaultUniverseResourceStorageProvider.class, DefaultUniverseResourceStorageProvider.CODEC);
      IUniverseResourceStorageProvider.CODEC.register("Disk", DiskUniverseResourceStorageProvider.class, DiskUniverseResourceStorageProvider.CODEC);
      BanStorageProvider.CODEC.register(Priority.DEFAULT, "Disk", DiskBanStorageProvider.class, DiskBanStorageProvider.CODEC);
      HytaleServerConfig.Module.BUILDER_CODEC_BUILDER
         .append(
            new KeyedCodec<>("Modules", new MapCodec<>(HytaleServerConfig.Module.CODEC, ConcurrentHashMap::new, false)),
            (var0, var1) -> var0.modules = var1,
            var0 -> var0.modules
         )
         .add();
   }

   class="kw">public class="kw">static class Defaults {
      class="kw">public class="kw">static class="kw">final KeyedCodec<String> WORLD = new KeyedCodec<>("World", Codec.STRING);
      class="kw">public class="kw">static class="kw">final KeyedCodec<GameMode> GAMEMODE = new KeyedCodec<>("GameMode", ProtocolCodecs.GAMEMODE_LEGACY);
      class="kw">public class="kw">static class="kw">final KeyedCodec<String> GAME_MODE_TYPE_ON_DEATH = new KeyedCodec<>("GameModeTypeOnDeath", Codec.STRING);
      class="kw">public class="kw">static class="kw">final KeyedCodec<String> HARDCORE_MODE = new KeyedCodec<>("HardcoreMode", Codec.STRING);
      class="kw">public class="kw">static class="kw">final KeyedCodec<Integer> HARDCORE_LIVES = new KeyedCodec<>("HardcoreLives", Codec.INTEGER);
      class="kw">public class="kw">static class="kw">final KeyedCodec<CrashRecoveryConfig> CRASH_RECOVERY = new KeyedCodec<>("CrashRecovery", CrashRecoveryConfig.CODEC);
      class="kw">public class="kw">static class="kw">final BuilderCodec<HytaleServerConfig.Defaults> CODEC = BuilderCodec.builder(
            HytaleServerConfig.Defaults.class, HytaleServerConfig.Defaults::new
         )
         .append(WORLD, (var0, var1) -> var0.world = var1, var0 -> var0.world)
         .add()
         .append(GAMEMODE, (var0, var1) -> var0.gameMode = var1, var0 -> var0.gameMode)
         .add()
         .append(GAME_MODE_TYPE_ON_DEATH, (var0, var1) -> var0.gameModeTypeOnDeath = var1, var0 -> var0.gameModeTypeOnDeath)
         .add()
         .append(
            HARDCORE_MODE, (var0, var1) -> var0.hardcoreMode = HardcoreMode.parse(var1), var0 -> var0.hardcoreMode != null ? var0.hardcoreMode.name() : null
         )
         .add()
         .<Integer>append(HARDCORE_LIVES, (var0, var1) -> var0.hardcoreLives = var1, var0 -> var0.hardcoreLives)
         .addValidator(Validators.min(1))
         .documentation("Lives per player for PerPlayer, or the shared pool size for Global. Defaults to 1. None ignores it.")
         .add()
         .<CrashRecoveryConfig>append(
            CRASH_RECOVERY, (var0, var1) -> var0.crashRecovery = var1 != null ? var1 : new CrashRecoveryConfig(), var0 -> var0.crashRecovery
         )
         .addValidator(Validators.nonNull())
         .documentation("Recovery policy for the class="kw">default world when its thread crashes.")
         .add()
         .build();
      class="kw">private class="kw">transient HytaleServerConfig hytaleServerConfig;
      class="kw">private String world = "class="kw">default";
      class="kw">private GameMode gameMode = GameMode.Adventure;
      @Nullable
      class="kw">private String gameModeTypeOnDeath;
      @Nullable
      class="kw">private HardcoreMode hardcoreMode;
      @Nullable
      class="kw">private Integer hardcoreLives;
      @Nonnull
      class="kw">private CrashRecoveryConfig crashRecovery = new CrashRecoveryConfig();

      class="kw">private Defaults() {
      }

      class="kw">private Defaults(HytaleServerConfig var1) {
         this.hytaleServerConfig = var1;
      }

      class="kw">public String getWorld() {
         class="kw">return this.world;
      }

      class="kw">public void setWorld(String var1) {
         this.world = var1;
         this.hytaleServerConfig.markChanged();
      }

      class="kw">public GameMode getGameMode() {
         class="kw">return this.gameMode;
      }

      class="kw">public void setGameMode(GameMode var1) {
         this.gameMode = var1;
         this.hytaleServerConfig.markChanged();
      }

      @Nullable
      class="kw">public String getGameModeTypeOnDeath() {
         class="kw">return this.gameModeTypeOnDeath;
      }

      class="kw">public void setGameModeTypeOnDeath(@Nullable String var1) {
         this.gameModeTypeOnDeath = var1;
         this.hytaleServerConfig.markChanged();
      }

      @Nonnull
      class="kw">public HardcoreMode getHardcoreMode() {
         class="kw">return this.hardcoreMode != null ? this.hardcoreMode : HardcoreMode.None;
      }

      class="kw">public int getHardcoreLives() {
         if (this.getHardcoreMode() == HardcoreMode.None) {
            class="kw">return 0;
         } else {
            class="kw">return this.hardcoreLives != null ? this.hardcoreLives : 1;
         }
      }

      @Nonnull
      class="kw">public CrashRecoveryConfig getCrashRecovery() {
         class="kw">return this.crashRecovery;
      }
   }

   class="kw">public class="kw">static class Module {
      @Nonnull
      class="kw">protected class="kw">static BuilderCodec.Builder<HytaleServerConfig.Module> BUILDER_CODEC_BUILDER = BuilderCodec.builder(
            HytaleServerConfig.Module.class, HytaleServerConfig.Module::new
         )
         .append(new KeyedCodec<>("Enabled", Codec.BOOLEAN), (var0, var1) -> var0.enabled = var1, var0 -> var0.enabled)
         .add();
      @Nonnull
      class="kw">protected class="kw">static BuilderCodec<HytaleServerConfig.Module> BUILDER_CODEC = BUILDER_CODEC_BUILDER.build();
      @Nonnull
      class="kw">public class="kw">static class="kw">final DocumentContainingCodec<HytaleServerConfig.Module> CODEC = new DocumentContainingCodec<>(
         BUILDER_CODEC, (var0, var1) -> var0.document = var1, var0 -> var0.document
      );
      class="kw">private class="kw">transient HytaleServerConfig hytaleServerConfig;
      class="kw">private Boolean enabled;
      @Nonnull
      class="kw">private Map<String, HytaleServerConfig.Module> modules = new ConcurrentHashMap<>();
      @Nonnull
      class="kw">private BsonDocument document = new BsonDocument();

      class="kw">private Module() {
      }

      class="kw">private Module(@Nonnull HytaleServerConfig var1) {
         this.hytaleServerConfig = var1;
      }

      class="kw">public boolean isEnabled(boolean var1) {
         class="kw">return this.enabled != null ? this.enabled : var1;
      }

      class="kw">public void setEnabled(boolean var1) {
         this.enabled = var1;
         this.hytaleServerConfig.markChanged();
      }

      class="kw">public Boolean getEnabled() {
         class="kw">return this.enabled;
      }

      @Nonnull
      class="kw">public Map<String, HytaleServerConfig.Module> getModules() {
         class="kw">return Collections.unmodifiableMap(this.modules);
      }

      @Nonnull
      class="kw">public HytaleServerConfig.Module getModule(@Nonnull String var1) {
         class="kw">return this.modules.computeIfAbsent(var1, var1x -> new HytaleServerConfig.Module(this.hytaleServerConfig));
      }

      class="kw">public void setModules(@Nonnull Map<String, HytaleServerConfig.Module> var1) {
         this.modules = var1;
         this.hytaleServerConfig.markChanged();
      }

      @Nonnull
      class="kw">public BsonDocument getDocument() {
         class="kw">return this.document;
      }

      @Nullable
      class="kw">public <T> T decode(@Nonnull Codec<T> var1) {
         class="kw">return var1.decode(this.document);
      }

      class="kw">public <T> void encode(@Nonnull Codec<T> var1, @Nonnull T var2) {
         this.document = var1.encode(var2).asDocument();
      }

      @Nonnull
      class="kw">public <T> Optional<T> getData(@Nonnull KeyedCodec<T> var1) {
         class="kw">return var1.get(this.document);
      }

      @Nullable
      class="kw">public <T> T getDataOrNull(@Nonnull KeyedCodec<T> var1) {
         class="kw">return var1.getOrNull(this.document);
      }

      class="kw">public <T> T getDataNow(@Nonnull KeyedCodec<T> var1) {
         class="kw">return var1.getNow(this.document);
      }

      class="kw">public <T> void put(@Nonnull KeyedCodec<T> var1, T var2) {
         var1.put(this.document, var2);
         this.hytaleServerConfig.markChanged();
      }

      class="kw">public void setDocument(@Nonnull BsonDocument var1) {
         this.document = var1;
         this.hytaleServerConfig.markChanged();
      }

      void setHytaleServerConfig(@Nonnull HytaleServerConfig var1) {
         this.hytaleServerConfig = var1;
         this.modules.values().forEach(var1x -> var1x.setHytaleServerConfig(var1));
      }
   }

   class="kw">public class="kw">static class TimeoutProfile {
      class="kw">private class="kw">static class="kw">final HytaleServerConfig.TimeoutProfile SINGLEPLAYER_DEFAULTS = new HytaleServerConfig.TimeoutProfile(
         Duration.ofSeconds(30L),
         Duration.ofSeconds(5L),
         Duration.ofSeconds(60L),
         Duration.ofSeconds(60L),
         Duration.ofSeconds(60L),
         Duration.ofSeconds(30L),
         Duration.ofSeconds(60L),
         Duration.ofSeconds(120L),
         Duration.ofSeconds(30L),
         Duration.ofSeconds(300L),
         Duration.ofSeconds(300L),
         Duration.ofSeconds(120L)
      );
      class="kw">private class="kw">static class="kw">final HytaleServerConfig.TimeoutProfile MULTIPLAYER_DEFAULTS = new HytaleServerConfig.TimeoutProfile(
         Duration.ofSeconds(20L),
         Duration.ofSeconds(5L),
         Duration.ofSeconds(30L),
         Duration.ofSeconds(30L),
         Duration.ofSeconds(30L),
         Duration.ofSeconds(15L),
         Duration.ofSeconds(45L),
         Duration.ofSeconds(60L),
         Duration.ofSeconds(15L),
         Duration.ofSeconds(120L),
         Duration.ofSeconds(120L),
         Duration.ofSeconds(60L)
      );
      class="kw">public class="kw">static class="kw">final Codec<HytaleServerConfig.TimeoutProfile> CODEC = BuilderCodec.builder(
            HytaleServerConfig.TimeoutProfile.class, HytaleServerConfig.TimeoutProfile::new
         )
         .append(new KeyedCodec<>("InitialTimeout", Codec.DURATION), (var0, var1) -> var0.initial = var1, var0 -> var0.initial)
         .add()
         .append(new KeyedCodec<>("AuxStreamPendingTimeout", Codec.DURATION), (var0, var1) -> var0.auxStreamPending = var1, var0 -> var0.auxStreamPending)
         .add()
         .append(new KeyedCodec<>("AuthTimeout", Codec.DURATION), (var0, var1) -> var0.auth = var1, var0 -> var0.auth)
         .add()
         .append(new KeyedCodec<>("AuthGrantTimeout", Codec.DURATION), (var0, var1) -> var0.authGrant = var1, var0 -> var0.authGrant)
         .add()
         .append(new KeyedCodec<>("AuthTokenTimeout", Codec.DURATION), (var0, var1) -> var0.authToken = var1, var0 -> var0.authToken)
         .add()
         .append(new KeyedCodec<>("AuthServerExchangeTimeout", Codec.DURATION), (var0, var1) -> var0.authServerExchange = var1, var0 -> var0.authServerExchange)
         .add()
         .append(new KeyedCodec<>("PasswordTimeout", Codec.DURATION), (var0, var1) -> var0.password = var1, var0 -> var0.password)
         .add()
         .append(new KeyedCodec<>("PlayTimeout", Codec.DURATION), (var0, var1) -> var0.play = var1, var0 -> var0.play)
         .add()
         .append(new KeyedCodec<>("SetupWorldSettings", Codec.DURATION), (var0, var1) -> var0.setupWorldSettings = var1, var0 -> var0.setupWorldSettings)
         .add()
         .append(new KeyedCodec<>("SetupAssetsRequest", Codec.DURATION), (var0, var1) -> var0.setupAssetsRequest = var1, var0 -> var0.setupAssetsRequest)
         .add()
         .append(new KeyedCodec<>("SetupSendAssets", Codec.DURATION), (var0, var1) -> var0.setupSendAssets = var1, var0 -> var0.setupSendAssets)
         .add()
         .append(new KeyedCodec<>("SetupAddToUniverse", Codec.DURATION), (var0, var1) -> var0.setupAddToUniverse = var1, var0 -> var0.setupAddToUniverse)
         .add()
         .build();
      class="kw">private Duration initial;
      class="kw">private Duration auxStreamPending;
      class="kw">private Duration auth;
      class="kw">private Duration authGrant;
      class="kw">private Duration authToken;
      class="kw">private Duration authServerExchange;
      class="kw">private Duration password;
      class="kw">private Duration play;
      class="kw">private Duration setupWorldSettings;
      class="kw">private Duration setupAssetsRequest;
      class="kw">private Duration setupSendAssets;
      class="kw">private Duration setupAddToUniverse;
      class="kw">private class="kw">transient HytaleServerConfig hytaleServerConfig;

      class="kw">public class="kw">static HytaleServerConfig.TimeoutProfile defaults() {
         class="kw">return Constants.SINGLEPLAYER ? SINGLEPLAYER_DEFAULTS : MULTIPLAYER_DEFAULTS;
      }

      class="kw">public TimeoutProfile() {
      }

      class="kw">public TimeoutProfile(HytaleServerConfig var1) {
         this.hytaleServerConfig = var1;
      }

      class="kw">private TimeoutProfile(
         Duration var1,
         Duration var2,
         Duration var3,
         Duration var4,
         Duration var5,
         Duration var6,
         Duration var7,
         Duration var8,
         Duration var9,
         Duration var10,
         Duration var11,
         Duration var12
      ) {
         this.initial = var1;
         this.auxStreamPending = var2;
         this.auth = var3;
         this.authGrant = var4;
         this.authToken = var5;
         this.authServerExchange = var6;
         this.password = var7;
         this.play = var8;
         this.setupWorldSettings = var9;
         this.setupAssetsRequest = var10;
         this.setupSendAssets = var11;
         this.setupAddToUniverse = var12;
      }

      class="kw">public Duration getInitial() {
         class="kw">return this.initial != null ? this.initial : defaults().initial;
      }

      class="kw">public void setInitial(Duration var1) {
         this.initial = var1;
         this.markChanged();
      }

      class="kw">public Duration getAuxStreamPending() {
         class="kw">return this.auxStreamPending != null ? this.auxStreamPending : defaults().auxStreamPending;
      }

      class="kw">public void setAuxStreamPending(Duration var1) {
         this.auxStreamPending = var1;
         this.markChanged();
      }

      class="kw">public Duration getAuth() {
         class="kw">return this.auth != null ? this.auth : defaults().auth;
      }

      class="kw">public void setAuth(Duration var1) {
         this.auth = var1;
         this.markChanged();
      }

      class="kw">public Duration getAuthGrant() {
         class="kw">return this.authGrant != null ? this.authGrant : defaults().authGrant;
      }

      class="kw">public void setAuthGrant(Duration var1) {
         this.authGrant = var1;
         this.markChanged();
      }

      class="kw">public Duration getAuthToken() {
         class="kw">return this.authToken != null ? this.authToken : defaults().authToken;
      }

      class="kw">public void setAuthToken(Duration var1) {
         this.authToken = var1;
         this.markChanged();
      }

      class="kw">public Duration getAuthServerExchange() {
         class="kw">return this.authServerExchange != null ? this.authServerExchange : defaults().authServerExchange;
      }

      class="kw">public void setAuthServerExchange(Duration var1) {
         this.authServerExchange = var1;
         this.markChanged();
      }

      class="kw">public Duration getPassword() {
         class="kw">return this.password != null ? this.password : defaults().password;
      }

      class="kw">public void setPassword(Duration var1) {
         this.password = var1;
         this.markChanged();
      }

      class="kw">public Duration getPlay() {
         class="kw">return this.play != null ? this.play : defaults().play;
      }

      class="kw">public void setPlay(Duration var1) {
         this.play = var1;
         this.markChanged();
      }

      class="kw">public Duration getSetupWorldSettings() {
         class="kw">return this.setupWorldSettings != null ? this.setupWorldSettings : defaults().setupWorldSettings;
      }

      class="kw">public void setSetupWorldSettings(Duration var1) {
         this.setupWorldSettings = var1;
         this.markChanged();
      }

      class="kw">public Duration getSetupAssetsRequest() {
         class="kw">return this.setupAssetsRequest != null ? this.setupAssetsRequest : defaults().setupAssetsRequest;
      }

      class="kw">public void setSetupAssetsRequest(Duration var1) {
         this.setupAssetsRequest = var1;
         this.markChanged();
      }

      class="kw">public Duration getSetupSendAssets() {
         class="kw">return this.setupSendAssets != null ? this.setupSendAssets : defaults().setupSendAssets;
      }

      class="kw">public void setSetupSendAssets(Duration var1) {
         this.setupSendAssets = var1;
         this.markChanged();
      }

      class="kw">public Duration getSetupAddToUniverse() {
         class="kw">return this.setupAddToUniverse != null ? this.setupAddToUniverse : defaults().setupAddToUniverse;
      }

      class="kw">public void setSetupAddToUniverse(Duration var1) {
         this.setupAddToUniverse = var1;
         this.markChanged();
      }

      class="kw">private void markChanged() {
         if (this.hytaleServerConfig != null) {
            this.hytaleServerConfig.markChanged();
         }
      }

      void setHytaleServerConfig(HytaleServerConfig var1) {
         this.hytaleServerConfig = var1;
      }
   }
}