Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -3339,6 +3339,12 @@
"fileMatch": ["*.hf.yaml"],
"url": "https://hyperfoil.io/schema.json"
},
{
"name": "Hytale Server Config",
"description": "The config file for Hytale servers",
"fileMatch": ["config.json"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too generic and will result in too many false positive matches. Can you narrow it in by adding a folder path or similar?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no sorry because the parent folder is the server name :D

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you need to remove the fileMatch, I'm afraid.

"url": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/hytale-server-config.json"
},
{
"name": "Hulak Configuration",
"description": "Hulak API client configuration file",
Expand Down
52 changes: 52 additions & 0 deletions src/negative_test/hytale-server-config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"AuthCredentialStore": {
"Path": "auth.enc",
"Type": "Memory"
},
"ConnectionTimeouts": {
"AuthTimeout": "30S",
"InitialTimeout": "10S",
"JoinTimeouts": false,
"PlayTimeout": "1M"
},
"Defaults": {
"GameMode": "Custom",
"World": 5475
},
"DisplayTmpTagsInStrings": "false",
"LocalCompressionEnabled": "false",
"LogLevels": {},
"MOTD": ["Hello Hytale Server"],
"MaxPlayers": "100",
"MaxViewRadius": "32",
"Mods": {
"modname:modid": {
"Enabled": "true",
"RequiredVersion": ">=1.0.0",
"bla": "blabla"
}
},
"Modules": {
"PathPlugin": {
"Modules": [
{
"Mod1": {
"Enabled": true
}
}
]
}
},
"Password": 2632623652,
"PlayerStorage": {
"Path": "universe/players",
"Type": "Hytale"
},
"RateLimit": {
"BurstCapacity": "500",
"Enabled": "true",
"PacketsPerSecond": "2000"
},
"ServerName": true,
"Version": "3"
}
1 change: 1 addition & 0 deletions src/schema-validation.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
"openhab-5.1.json",
"specif-1.1.json",
"ctfd.json",
"hytale-server-config.json",
"zarf.json",
"yamllint.json"
],
Expand Down
248 changes: 248 additions & 0 deletions src/schemas/json/hytale-server-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json.schemastore.org/hytale-server-config.json",
"$defs": {
"LogLevels": {
"type": "string",
"enum": [
"SEVERE",
"WARNING",
"INFO",
"CONFIG",
"FINE",
"FINER",
"FINEST",
"ALL",
"OFF"
]
}
},
"title": "Hytale Server Config",
"description": "The config file for Hytale servers",
"type": "object",
"additionalProperties": false,
"properties": {
"Version": {
"description": "The autogenerated config version number for migration purposes",
"type": "integer",
"default": 3
},
"ServerName": {
"description": "Display name for your server you will see in the welcome message or server lists",
"type": "string",
"default": "Hytale Server"
},
"MOTD": {
"description": "Message of the day shown to players after connect",
"type": "string",
"default": ""
},
"Password": {
"description": "Server password (empty for no password)",
"type": "string",
"default": ""
},
"MaxPlayers": {
"description": "Maximum concurrent players",
"type": "integer",
"default": 100
},
"MaxViewRadius": {
"description": "Maximum view radius in chunks player will see",
"type": "integer",
"default": 32
},
"Defaults": {
"description": "The default world and game mode settings",
"type": "object",
"additionalProperties": false,
"properties": {
"World": {
"description": "The default world directory in universe/worlds",
"type": "string",
"default": "default"
},
"GameMode": {
"description": "The default Game Mode",
"type": "string",
"enum": ["Adventure", "Creative"],
"enumDescriptions": [
"The default adventure mode",
"The Creative mode"
],
"default": "Adventure"
}
},
"required": ["World", "GameMode"]
},
"ConnectionTimeouts": {
"description": "Connection timeout settings",
"type": "object",
"additionalProperties": false,
"properties": {
"InitialTimeout": {
"description": "Initial connection timeout",
"type": "string",
"format": "duration",
"default": "PT10S"
},
"AuthTimeout": {
"description": "Authentication timeout ",
"type": "string",
"format": "duration",
"default": "PT30S"
},
"PlayTimeout": {
"description": "Play session timeout",
"type": "string",
"format": "duration",
"default": "PT1M"
},
"JoinTimeouts": {
"description": "Custom per-context join timeouts",
"type": "object",
"default": {}
}
}
},
"RateLimit": {
"description": "Packet flooding protection",
"type": "object",
"properties": {
"Enabled": {
"description": "Enable or disable packet flooding protection",
"type": "boolean",
"default": true
},
"PacketsPerSecond": {
"description": "Max packets per second",
"type": "integer",
"default": 2000
},
"BurstCapacity": {
"description": "Burst capacity allowance",
"type": "integer",
"default": 500
}
}
},
"Modules": {
"description": "Server modules",
"type": "object",
"properties": {
"PathPlugin": {
"description": "",
"type": "object",
"properties": {
"Modules": {
"description": "",
"type": "object"
}
}
}
}
},
"LogLevels": {
"description": "Log levels for specific loggers",
"type": "object",
"properties": {
"com.hypixel.hytale.server": {
"$ref": "#/$defs/LogLevels",
"default": "INFO"
},
"com.hypixel.hytale.server.network": {
"$ref": "#/$defs/LogLevels",
"default": "WARNING"
}
},
"additionalProperties": {
"$ref": "#/$defs/LogLevels"
}
},
"Mods": {
"description": "Mod settings and configuration",
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"properties": {
"Enabled": {
"description": "Enable or Disable the mod.",
"type": "boolean",
"default": true
},
"RequiredVersion": {
"description": "The required game version range (e.g. ^1.0.0 or >=1.2.0)",
"type": "string",
"pattern": "^([~^]|>=?|<=?)?[0-9]+(\\.[0-9x*]+)*(\\s+([~^]|>=?|<=?)?[0-9]+(\\.[0-9x*]+)*)*$",
"default": ">=1.0.0"
}
},
"required": ["Enabled", "RequiredVersion"]
}
},
"DisplayTmpTagsInStrings": {
"description": "Enable display of <temporary> tags in strings",
"type": "boolean",
"default": false
},
"LocalCompressionEnabled": {
"description": "Enable compression for local network",
"type": "boolean",
"default": false
},
"PlayerStorage": {
"description": "The Player Storage configures how player data is persisted",
"type": "object",
"properties": {
"Type": {
"description": "Storage provider type",
"type": "string",
"enum": ["Hytale", "Disk"],
"enumDescriptions": [
"Use the default path",
"Allows specifying a custom path"
],
"default": "Hytale"
},
"Path": {
"description": "Only if Type Disk is uses. Allows to specify a custom path",
"type": "string",
"default": "universe/players"
}
},
"if": { "properties": { "Type": { "const": "Hytale" } } },
"then": { "properties": { "Path": false } }
},
"AuthCredentialStore": {
"description": "Configures how authentication credentials are stored",
"type": "object",
"additionalProperties": false,
"properties": {
"Type": {
"description": "Credential store provider type",
"type": "string",
"enum": ["Memory", "Encrypted"],
"default": "Memory"
},
"Path": {
"description": "Only if Type Encrypted is uses. Path to encrypted credentials file",
"type": "string",
"default": "auth.enc"
}
},
"if": { "properties": { "Type": { "const": "Memory" } } },
"then": { "properties": { "Path": false } }
}
},
"required": [
"Version",
"ServerName",
"MOTD",
"Password",
"MaxPlayers",
"MaxViewRadius",
"Defaults",
"PlayerStorage"
]
}
52 changes: 52 additions & 0 deletions src/test/hytale-server-config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"AuthCredentialStore": {
"Path": "auth.enc",
"Type": "Encrypted"
},
"ConnectionTimeouts": {
"AuthTimeout": "PT30S",
"InitialTimeout": "PT10S",
"JoinTimeouts": {},
"PlayTimeout": "PT1M"
},
"Defaults": {
"GameMode": "Adventure",
"World": "default"
},
"DisplayTmpTagsInStrings": false,
"LocalCompressionEnabled": false,
"LogLevels": {
"com.hypixel.hytale.server": "INFO",
"com.hypixel.hytale.server.network": "WARNING"
},
"MOTD": "Hello Hytale Server",
"MaxPlayers": 100,
"MaxViewRadius": 32,
"Mods": {
"modname:modid": {
"Enabled": true,
"RequiredVersion": ">=1.0.0"
}
},
"Modules": {
"PathPlugin": {
"Modules": {
"Mod1": {
"Enabled": true
}
}
}
},
"Password": "bipapo321#",
"PlayerStorage": {
"Path": "universe/players",
"Type": "Disk"
},
"RateLimit": {
"BurstCapacity": 500,
"Enabled": true,
"PacketsPerSecond": 2000
},
"ServerName": "Hytale Server",
"Version": 3
}