Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- setBoot(HytaleServerConfig, PluginIdentifier, boolean)
- getServerName()
- setServerName(String)
- getMotd()
- setMotd(String)
- getPassword()
- setPassword(String)
- isRequireJoinPermission()
- setRequireJoinPermission(boolean)
- isDisplayTmpTagsInStrings()
- setDisplayTmpTagsInStrings(boolean)
- getMaxPlayers()
- setMaxPlayers(int)
- getMaxViewRadius()
- setMaxViewRadius(int)
- getDefaults()
- setDefaults(HytaleServerConfig.Defaults)
- getConnectionTimeouts()
- setConnectionTimeouts(HytaleServerConfig.TimeoutProfile)
- getRateLimitConfig()
- setRateLimitConfig(RateLimitConfig)
- getModules()
- getModule(String)
- setModules(Map)
- getLogLevels()
- setLogLevels(Map)
- getModConfig()
- setModConfig(Map)
- getDefaultModsEnabled()
- getModLoadOrder()
- getPlayerStorageProvider()
- setPlayerStorageProvider(PlayerStorageProvider)
- getUniverseResourceStorageProvider()
- setUniverseResourceStorageProvider(IUniverseResourceStorageProvider)
- getBanStorageProvider()
- setBanStorageProvider(BanStorageProvider)
- getAuthCredentialStoreProvider()
- setAuthCredentialStoreProvider(AuthCredentialStoreProvider)
- getUpdateConfig()
- setUpdateConfig(UpdateConfig)
- getBackupConfig()
- setBackupConfig(BackupConfig)
- getFallbackServer()
- setFallbackServer(HostAddress)
- getWorldMapConfig()
- setWorldMapConfig(ServerWorldMapConfig)
- removeModule(String)
- markChanged()
- consumeHasChanged()
- load()
- load(Path)
- save(HytaleServerConfig)
- save(Path, HytaleServerConfig)
- getMaxViewSphereOffsets()
Class HytaleServerConfig
java.lang.Object
com.hypixel.hytale.server.core.HytaleServerConfig
The configuration file containing the configuration values for HytaleServer and all ServerModule's.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classRepresents the configuration for a specific module within the server.static classConfiguration for connection timeouts at various stages of the connection lifecycle. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<HytaleServerConfig> The codec used to parseHytaleServerConfiginstances.static final intThe default maximum view radius for players.static final intHard ceiling on the configuredMaxViewRadius.static final PathThe path to the server configuration file.static final PluginIdentifier[]static final intThe current version of the server configuration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe provider is decoded on the first call, so call this once the plugins are loaded.The provider is decoded on the first call, so call this once the plugins are loaded.booleanReturns the default enabled state for external mods not explicitly configured.intintReturns the sharedSphereOffsetslist built for the server's maximum-allowed view radius.Called to get the module configuration for the specified module name.getMotd()The provider is decoded on the first call, so call this once the plugins are loaded.The provider is decoded on the first call, so call this once the plugins are loaded.booleanbooleanWhile this is set, a player needs thehytale.server.joinpermission to connect, and every player without it is refused.static HytaleServerConfigload()static HytaleServerConfigCalled to load and return the server configuration from the specified path.voidCalled to mark the configuration as changed.voidremoveModule(String module) Called to remove a module configuration.static CompletableFuture<Void> save(HytaleServerConfig hytaleServerConfig) Called to save the server configuration to the default path.static CompletableFuture<Void> save(Path path, HytaleServerConfig hytaleServerConfig) Called to save the server configuration to the specified path.voidSets the auth credential store provider directly.voidsetBackupConfig(BackupConfig backupConfig) Called to set the backup configuration.voidsetBanStorageProvider(BanStorageProvider banStorageProvider) Called to set the ban list the server applies when a player connects.static voidsetBoot(HytaleServerConfig serverConfig, PluginIdentifier identifier, boolean enabled) Sets the enabled state for a mod/plugin in the server config.voidsetConnectionTimeouts(HytaleServerConfig.TimeoutProfile connectionTimeouts) Called to set the configurable connection timeouts.voidsetDefaults(HytaleServerConfig.Defaults defaults) Called to set the default configuration values.voidsetDisplayTmpTagsInStrings(boolean displayTmpTagsInStrings) Called to set whether temporary tags should be displayed in strings.voidsetFallbackServer(HostAddress fallbackServer) voidsetLogLevels(Map<String, Level> logLevels) Called to set the log levels for loggers.voidsetMaxPlayers(int maxPlayers) Called to set the maximum number of players allowed on the server.voidsetMaxViewRadius(int maxViewRadius) Called to set the maximum view radius for players.voidsetModConfig(Map<PluginIdentifier, ModConfig> modConfig) Called to set the mod configurations.voidsetModules(Map<String, HytaleServerConfig.Module> modules) Called to set the module configurations.voidCalled to set the message of the day.voidsetPassword(String password) Called to set the server password.voidsetPlayerStorageProvider(PlayerStorageProvider playerStorageProvider) Called to set the storage provider for player data.voidsetRateLimitConfig(RateLimitConfig rateLimitConfig) Called to set the packet rate limit configuration.voidsetRequireJoinPermission(boolean requireJoinPermission) Called to set whether a player needs thehytale.server.joinpermission to connect.voidsetServerName(String serverName) Called to set the server name.voidsetUniverseResourceStorageProvider(IUniverseResourceStorageProvider universeResourceStorageProvider) Called to set the storage provider for universe resources.voidsetUpdateConfig(UpdateConfig updateConfig) Called to set the auto-update configuration.voidsetWorldMapConfig(ServerWorldMapConfig worldMapConfig) Called to set the server-level world map configuration.
-
Field Details
-
VERSION
public static final int VERSIONThe current version of the server configuration.- See Also:
-
DEFAULT_MAX_VIEW_RADIUS
public static final int DEFAULT_MAX_VIEW_RADIUSThe default maximum view radius for players.- See Also:
-
MAX_VIEW_RADIUS_LIMIT
public static final int MAX_VIEW_RADIUS_LIMITHard ceiling on the configuredMaxViewRadius.SphereOffsets.build(int)is O(R³), so an unbounded value would let a misconfigured (or hostile)config.jsontrigger a multi-gigabyte allocation on first chunk tracking. Matches the client's sphere-radius cap (MapModule.MaxClientSphereChunkRadius); a larger server value buys nothing because the client clamps its own sphere to that radius.- See Also:
-
PATH
The path to the server configuration file. -
PLUGIN_IDENTIFIERS
-
CODEC
The codec used to parseHytaleServerConfiginstances.
-
-
Constructor Details
-
HytaleServerConfig
public HytaleServerConfig()
-
-
Method Details
-
setBoot
public static void setBoot(@Nonnull HytaleServerConfig serverConfig, @Nonnull PluginIdentifier identifier, boolean enabled) Sets the enabled state for a mod/plugin in the server config.- Parameters:
serverConfig- The server configuration.identifier- The mod/plugin identifier.enabled- Whether the mod/plugin should be enabled.
-
getServerName
- Returns:
- the server name.
-
setServerName
Called to set the server name.- Parameters:
serverName- The new server name to set.
-
getMotd
- Returns:
- the message of the day.
-
setMotd
Called to set the message of the day.- Parameters:
motd- The new message of the day to set.
-
getPassword
- Returns:
- the server password.
-
setPassword
Called to set the server password.- Parameters:
password- The new server password to set.
-
isRequireJoinPermission
public boolean isRequireJoinPermission()While this is set, a player needs thehytale.server.joinpermission to connect, and every player without it is refused. A grant to the player, a group they belong to, and a wildcard that covers the node all satisfy it. No group holds the node itself, but the admin group holds every permission.- Returns:
trueif a player needs a permission to connect.
-
setRequireJoinPermission
public void setRequireJoinPermission(boolean requireJoinPermission) Called to set whether a player needs thehytale.server.joinpermission to connect.- Parameters:
requireJoinPermission- The new value to set.
-
isDisplayTmpTagsInStrings
public boolean isDisplayTmpTagsInStrings()- Returns:
trueif temporary tags should be displayed in strings,falseotherwise.
-
setDisplayTmpTagsInStrings
public void setDisplayTmpTagsInStrings(boolean displayTmpTagsInStrings) Called to set whether temporary tags should be displayed in strings.- Parameters:
displayTmpTagsInStrings- The new value to set.
-
getMaxPlayers
public int getMaxPlayers()- Returns:
- the maximum number of players allowed on the server.
-
setMaxPlayers
public void setMaxPlayers(int maxPlayers) Called to set the maximum number of players allowed on the server.- Parameters:
maxPlayers- The new maximum number of players to set.
-
getMaxViewRadius
public int getMaxViewRadius()- Returns:
- the maximum view radius for players.
-
setMaxViewRadius
public void setMaxViewRadius(int maxViewRadius) Called to set the maximum view radius for players.- Parameters:
maxViewRadius- The new maximum view radius to set.
-
getDefaults
- Returns:
- the default configuration values.
-
setDefaults
Called to set the default configuration values.- Parameters:
defaults- The new default configuration values to set.
-
getConnectionTimeouts
- Returns:
- the configurable connection timeouts.
-
setConnectionTimeouts
Called to set the configurable connection timeouts.- Parameters:
connectionTimeouts- The new connection timeouts to set.
-
getRateLimitConfig
- Returns:
- the packet rate limit configuration.
-
setRateLimitConfig
Called to set the packet rate limit configuration.- Parameters:
rateLimitConfig- The new rate limit configuration to set.
-
getModules
- Returns:
- an unmodifiable map of module names to their corresponding
HytaleServerConfig.Moduleconfigurations.
-
getModule
Called to get the module configuration for the specified module name.- Parameters:
moduleName- The name of the module.- Returns:
- the module configuration.
-
setModules
Called to set the module configurations.- Parameters:
modules- The new module configurations to set.
-
getLogLevels
-
setLogLevels
-
getModConfig
- Returns:
- the map of mod/plugin identifiers to their corresponding
ModConfigconfigurations.
-
setModConfig
Called to set the mod configurations.- Parameters:
modConfig- The new mod configurations to set.
-
getDefaultModsEnabled
public boolean getDefaultModsEnabled()Returns the default enabled state for external mods not explicitly configured. Built-in mods use their manifest default; this only affects external mods.- Returns:
- true if external mods should be enabled by default, false otherwise.
-
getModLoadOrder
-
getPlayerStorageProvider
The provider is decoded on the first call, so call this once the plugins are loaded.- Returns:
- the storage provider for player data.
-
setPlayerStorageProvider
Called to set the storage provider for player data.- Parameters:
playerStorageProvider- The new player storage provider to set.
-
getUniverseResourceStorageProvider
The provider is decoded on the first call, so call this once the plugins are loaded.- Returns:
- the storage provider for universe resources.
-
setUniverseResourceStorageProvider
public void setUniverseResourceStorageProvider(@Nonnull IUniverseResourceStorageProvider universeResourceStorageProvider) Called to set the storage provider for universe resources.- Parameters:
universeResourceStorageProvider- The new universe resource storage provider to set.
-
getBanStorageProvider
The provider is decoded on the first call, so call this once the plugins are loaded.- Returns:
- the ban list the server applies when a player connects
-
setBanStorageProvider
Called to set the ban list the server applies when a player connects.- Parameters:
banStorageProvider- The new ban list to set.
-
getAuthCredentialStoreProvider
The provider is decoded on the first call, so call this once the plugins are loaded.- Returns:
- the store for the credentials the server authenticates with
-
setAuthCredentialStoreProvider
Sets the auth credential store provider directly.- Parameters:
provider- The provider to use.
-
getUpdateConfig
- Returns:
- the auto-update configuration.
-
setUpdateConfig
Called to set the auto-update configuration.- Parameters:
updateConfig- The new auto-update configuration to set.
-
getBackupConfig
- Returns:
- the backup configuration.
-
setBackupConfig
Called to set the backup configuration.- Parameters:
backupConfig- The new backup configuration to set.
-
getFallbackServer
-
setFallbackServer
-
getWorldMapConfig
- Returns:
- the server-level world map configuration, acting as the global limitations for world map settings.
-
setWorldMapConfig
Called to set the server-level world map configuration.- Parameters:
worldMapConfig- The new world map configuration to set.
-
removeModule
Called to remove a module configuration.- Parameters:
module- The name of the module to remove.
-
markChanged
public void markChanged()Called to mark the configuration as changed. -
consumeHasChanged
public boolean consumeHasChanged()- Returns:
trueif the configuration has changed since it was last saved,falseotherwise.
-
load
- Returns:
- the loaded server configuration, or
nullif loading failed.
-
load
Called to load and return the server configuration from the specified path.- Parameters:
path- The path to load the server configuration from.- Returns:
- the loaded server configuration.
-
save
Called to save the server configuration to the default path.- Parameters:
hytaleServerConfig- The server configuration to save.- Returns:
- a future that completes when the save is complete.
-
save
@Nonnull public static CompletableFuture<Void> save(@Nonnull Path path, @Nonnull HytaleServerConfig hytaleServerConfig) Called to save the server configuration to the specified path.- Parameters:
path- The path to save the server configuration to.hytaleServerConfig- The server configuration to save.- Returns:
- a future that completes when the save is complete.
-
getMaxViewSphereOffsets
Returns the sharedSphereOffsetslist built for the server's maximum-allowed view radius. Used by per-playerSphereSpiralIteratorinstances; each iterator clamps this list to its own (smaller-or-equal) radius via a binary search atinit.Lazily built on first access and cached.
synchronizedensures all callers observe the same instance. Building is a one-shot cost in the low milliseconds, so the lock is uncontended after warmup.
-