-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
775 additions
and
513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,279 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "IServerConfiguration", | ||
"type": "object", | ||
"x-abstract": true, | ||
"additionalProperties": false, | ||
"properties": { | ||
"Logging": { | ||
"$ref": "#/definitions/logging" | ||
}, | ||
"baah": { | ||
"type": [ | ||
"boolean", | ||
"null" | ||
] | ||
}, | ||
"allowLan": { | ||
"type": "boolean" | ||
}, | ||
"motd": { | ||
"type": "string" | ||
}, | ||
"port": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"address": { | ||
"type": [ | ||
"null", | ||
"string" | ||
] | ||
}, | ||
"onlineMode": { | ||
"type": "boolean" | ||
}, | ||
"maxPlayers": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"pregenerateChunkRange": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"serverListQuery": { | ||
"$ref": "#/definitions/ServerListQuery" | ||
}, | ||
"timeTickSpeedMultiplier": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"allowOperatorRequests": { | ||
"type": "boolean" | ||
}, | ||
"enableRcon": { | ||
"type": "boolean" | ||
}, | ||
"whitelist": { | ||
"type": "boolean" | ||
}, | ||
"network": { | ||
"$ref": "#/definitions/NetworkConfiguration" | ||
}, | ||
"messages": { | ||
"$ref": "#/definitions/MessagesConfiguration" | ||
}, | ||
"rcon": { | ||
"oneOf": [ | ||
{ | ||
"type": "null" | ||
}, | ||
{ | ||
"$ref": "#/definitions/RconConfiguration" | ||
} | ||
] | ||
}, | ||
"viewDistance": { | ||
"type": "integer", | ||
"format": "byte" | ||
} | ||
}, | ||
"definitions": { | ||
"logLevelThreshold": { | ||
"description": "Log level threshold.", | ||
"type": "string", | ||
"enum": [ | ||
"Trace", | ||
"Debug", | ||
"Information", | ||
"Warning", | ||
"Error", | ||
"Critical", | ||
"None" | ||
] | ||
}, | ||
"logLevel": { | ||
"title": "logging level options", | ||
"description": "Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.", | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/logLevelThreshold" | ||
} | ||
}, | ||
"logging": { | ||
"title": "logging options", | ||
"type": "object", | ||
"description": "Configuration for Microsoft.Extensions.Logging.", | ||
"properties": { | ||
"LogLevel": { | ||
"$ref": "#/definitions/logLevel" | ||
}, | ||
"Console": { | ||
"properties": { | ||
"LogLevel": { | ||
"$ref": "#/definitions/logLevel" | ||
}, | ||
"FormatterName": { | ||
"description": "Name of the log message formatter to use. Defaults to 'simple'.", | ||
"type": "string", | ||
"default": "simple" | ||
}, | ||
"FormatterOptions": { | ||
"title": "formatter options", | ||
"description": "Log message formatter options. Additional properties are available on the options depending on the configured formatter. The formatter is specified by FormatterName.", | ||
"type": "object", | ||
"properties": { | ||
"IncludeScopes": { | ||
"description": "Include scopes when true. Defaults to false.", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"TimestampFormat": { | ||
"description": "Format string used to format timestamp in logging messages. Defaults to null.", | ||
"type": "string" | ||
}, | ||
"UseUtcTimestamp": { | ||
"description": "Indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false.", | ||
"type": "boolean", | ||
"default": false | ||
} | ||
} | ||
}, | ||
"LogToStandardErrorThreshold": { | ||
"$ref": "#/definitions/logLevelThreshold", | ||
"description": "The minimum level of messages are written to Console.Error." | ||
} | ||
} | ||
}, | ||
"EventSource": { | ||
"properties": { | ||
"LogLevel": { | ||
"$ref": "#/definitions/logLevel" | ||
} | ||
} | ||
}, | ||
"Debug": { | ||
"properties": { | ||
"LogLevel": { | ||
"$ref": "#/definitions/logLevel" | ||
} | ||
} | ||
}, | ||
"EventLog": { | ||
"properties": { | ||
"LogLevel": { | ||
"$ref": "#/definitions/logLevel" | ||
} | ||
} | ||
}, | ||
"ElmahIo": { | ||
"properties": { | ||
"LogLevel": { | ||
"$ref": "#/definitions/logLevel" | ||
} | ||
} | ||
}, | ||
"ElmahIoBreadcrumbs": { | ||
"properties": { | ||
"LogLevel": { | ||
"$ref": "#/definitions/logLevel" | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": { | ||
"title": "provider logging settings", | ||
"type": "object", | ||
"description": "Logging configuration for a provider. The provider name must match the configuration's JSON property property name.", | ||
"properties": { | ||
"LogLevel": { | ||
"$ref": "#/definitions/logLevel" | ||
} | ||
} | ||
} | ||
}, | ||
"ServerListQuery": { | ||
"type": "string", | ||
"description": "", | ||
"x-enumNames": [ | ||
"Full", | ||
"Anonymized", | ||
"Disabled" | ||
], | ||
"enum": [ | ||
"Full", | ||
"Anonymized", | ||
"Disabled" | ||
] | ||
}, | ||
"NetworkConfiguration": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"shouldThrottle": { | ||
"type": "boolean" | ||
}, | ||
"keepAliveInterval": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"keepAliveTimeoutInterval": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"connectionThrottle": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"mulitplayerDebugMode": { | ||
"type": "boolean" | ||
} | ||
} | ||
}, | ||
"MessagesConfiguration": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"join": { | ||
"type": "string" | ||
}, | ||
"leave": { | ||
"type": "string" | ||
}, | ||
"notWhitelisted": { | ||
"type": "string" | ||
}, | ||
"serverFull": { | ||
"type": "string" | ||
}, | ||
"outdatedClient": { | ||
"type": "string" | ||
}, | ||
"outdatedServer": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"RconConfiguration": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"password": { | ||
"type": [ | ||
"null", | ||
"string" | ||
] | ||
}, | ||
"port": { | ||
"type": "integer" | ||
}, | ||
"broadcastToOps": { | ||
"type": "boolean" | ||
}, | ||
"requireEncryption": { | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "WhitelistConfiguration", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"whitelistedPlayers": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/WhitelistedPlayer" | ||
} | ||
}, | ||
"whitelistedIps": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"WhitelistedPlayer": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"id": { | ||
"type": "string", | ||
"format": "guid" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Obsidian.API.Configuration; | ||
public sealed record class MessagesConfiguration | ||
{ | ||
public string Join { get; set; } = "&e{0} joined the game"; | ||
|
||
public string Leave { get; set; } = "&e{0} left the game"; | ||
|
||
public string NotWhitelisted { get; set; } = "You are not whitelisted on this server!"; | ||
|
||
public string ServerFull { get; set; } = "The server is full!"; | ||
|
||
public string OutdatedClient { get; set; } = "Outdated client! Please use {0}"; | ||
public string OutdatedServer { get; set; } = "Outdated server! I'm still on {0}"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace Obsidian.API.Configuration; | ||
public sealed record class NetworkConfiguration | ||
{ | ||
/// <summary> | ||
/// Returns true if <see cref="ConnectionThrottle"/> has a value greater than 0. | ||
/// </summary> | ||
public bool ShouldThrottle => this.ConnectionThrottle > 0; | ||
|
||
public long KeepAliveInterval { get; set; } = 10_000; | ||
|
||
public long KeepAliveTimeoutInterval { get; set; } = 30_000; | ||
|
||
/// <summary> | ||
/// The time in milliseconds to wait before an ip is allowed to try and connect again. | ||
/// </summary> | ||
public long ConnectionThrottle { get; set; } = 15_000; | ||
|
||
/// <summary> | ||
/// If true, each login/client gets a random username where multiple connections from the same host will be allowed. | ||
/// </summary> | ||
public bool MulitplayerDebugMode { get; set; } = false; | ||
} |
6 changes: 3 additions & 3 deletions
6
Obsidian.API/_Types/Config/RconConfig.cs → ...an.API/Configuration/RconConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.