From 309938eab93f2c07bbbe9bcbb78ea0afaac287d3 Mon Sep 17 00:00:00 2001 From: HimbeerserverDE Date: Sat, 28 Aug 2021 13:02:27 +0200 Subject: [PATCH] Document configuration file --- config.go | 10 ++--- doc/config.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 5 deletions(-) create mode 100644 doc/config.md diff --git a/config.go b/config.go index fdc5cee..a303448 100644 --- a/config.go +++ b/config.go @@ -31,11 +31,11 @@ type Config struct { } CSMRF struct { NoCSMs bool - NoChatMsgs bool - NoItemDefs bool - NoNodeDefs bool - LimitMapRange bool - NoPlayerList bool + ChatMsgs bool + ItemDefs bool + NodeDefs bool + NoLimitMapRange bool + PlayerList bool } MapRange uint32 } diff --git a/doc/config.md b/doc/config.md new file mode 100644 index 0000000..46d65e0 --- /dev/null +++ b/doc/config.md @@ -0,0 +1,120 @@ +# Configuration file +## Location +The configuration file is automatically created in the working directory. +The file name is `config.json`. +## Format +The configuration file contains JSON data. The fields are as follows. + +> `RequirePasswd` +``` +Type: bool +Default: false +Description: Empty passwords are rejected if this is true. +``` + +> `SendInterval` +``` +Type: float32 +Default: 0.09 +Description: The recommended send interval for clients. The proxy itself doesn't have a fixed send interval. +``` + +> `UserLimit` +``` +Type: int +Default: 10 +Description: The maximum number of players that can be connected to the proxy at the same time. +``` + +> `AuthBackend` +``` +Type: string +Default: sqlite3 +Values: sqlite3 +Description: The authentication backend to use. Only SQLite3 is available at the moment. +``` + +> `BindAddr` +``` +Type: string +Default: ":40000" +Description: The proxy will listen for new clients on this address. +``` + +> `Servers` +``` +Type: []Server +Default: []Server{} +Description: The list of internal servers served by this proxy. +``` + +> `Server.Name` +``` +Type: string +Default: "" +Values: Any non-zero string +Description: The unique name an internal server is known as. +``` + +> `Server.Addr` +``` +Type: string +Default: "" +Description: The network address and port of an internal server. +``` + +> `CSMRF` +``` +Type: CSMRF +Default: CSMRF{} +Description: The CSM Restriction Flags to send to clients. Don't rely on this since it can trivially be bypassed. +``` + +> `CSMRF.NoCSMs` +``` +Type: bool +Default: false +Description: Loading CSMs is disabled if this is true. +``` + +> `CSMRF.ChatMsgs` +``` +Type: bool +Default: false +Description: CSMs can send chat messages if this is true. +``` + +> `CSMRF.ItemDefs` +``` +Type: bool +Default: false +Description: CSMs can read item definitions. +``` + +> `CSMRF.NodeDefs` +``` +Type: bool +Default: false +Description: CSMs can read node definitions. +``` + +> `CSMRF.NoLimitMapRange` +``` +Type: bool +Default: false +Description: CSMs can look nodes up no matter how far away they are. +``` + +> `CSMRF.PlayerList` +``` +Type: bool +Default: false +Description: CSMs can access the player list. +``` + +> `MapRange` +``` +Type: uint32 +Default: 0 +Description: The maximum distance from which CSMs can read the map. +```