From 041131dee42ded6825faea397e802ea44d0bd081 Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Tue, 5 Feb 2019 16:33:10 +0100 Subject: [PATCH] docs --- doc/config.md | 74 +++++++++++++++++++++++++++++++++++++++++ doc/contrib.md | 4 +++ doc/install.md | 11 ++++++ doc/mod.md | 34 +++++++++++++++++++ doc/params.md | 29 ++++++++++++++++ readme.md | 44 ++++++++++++------------ server/params/params.go | 1 - 7 files changed, 174 insertions(+), 23 deletions(-) create mode 100644 doc/config.md create mode 100644 doc/mod.md create mode 100644 doc/params.md diff --git a/doc/config.md b/doc/config.md new file mode 100644 index 0000000..cb02c67 --- /dev/null +++ b/doc/config.md @@ -0,0 +1,74 @@ + +# Configuration + +All config options reside in the `mapserver.json` file with the default values +Please stop the server if you make any changes there. + +The mapserver will generate a fresh `mapserver.json` if there is none at startup. + +## Example json +```json +{ + "port": 8080, + "enablerendering": true, + "webdev": false, + "webapi": { + "enablemapblock": false, + "secretkey": "ZJoSpysiKGlYexof" + }, + "renderstate": { + "initialrun": false, + "legacyprocessed": 16111, + "lastx": 3, + "lasty": 3, + "lastz": 8, + "lastmtime": 0 + }, + "layers": [ + { + "id": 0, + "name": "Base", + "to": 160, + "from": -16 + } + ], + "renderingfetchlimit": 1000, + "renderingjobs": 2, + "renderingqueue": 100 +} +``` + +## Settings + +### port +The port on which the server listens to + +### webapi.secretkey +The generated secret for the [mod bridge](./install) + +### layers +The layers as a list +More layers can be added here: +```json +"layers": [ + { + "id": 0, + "name": "Base", + "to": 160, + "from": -16 + }, + { + "id": 1, + "name": "Space", + "to": 1600, + "from": 1000 + } +], +``` +*from* and *to* are in blocks (not mapblocks) +Don't reuse the `id` after the tiles are generated. +If you make more substantial changes here you may have to remove all +existing tiles and start rendering from scratch. + +### renderingjobs +Number of cores to use for rendering, defaults to all available cores diff --git a/doc/contrib.md b/doc/contrib.md index e69de29..36df969 100644 --- a/doc/contrib.md +++ b/doc/contrib.md @@ -0,0 +1,4 @@ + +# Contributions + +Contributions are always welcome via pull/merge requests diff --git a/doc/install.md b/doc/install.md index e69de29..5dbac6b 100644 --- a/doc/install.md +++ b/doc/install.md @@ -0,0 +1,11 @@ + +# Mapserver installation + +**Please make a backup of your world in case something goes wrong** + +* Download the binary from the [releases](https://github.com/thomasrudin-mt/mapserver/releases) for your architecture and platform +* Drop the binary into your world folder (the one with the `world.mt` and `map.sqlite` files) +* Start the mapserver via command-line: `./mapserver` or `./mapserver.exe` +* Point your browser to `http://127.0.0.1:8080` + +For additional infos (lag,time,players) on the mapserver interface you should install the [mapserver-mod](mod.md) diff --git a/doc/mod.md b/doc/mod.md new file mode 100644 index 0000000..b09714c --- /dev/null +++ b/doc/mod.md @@ -0,0 +1,34 @@ + +# Mapserver mod + +If the `mapserver-mod` is installed and configured +you get more realtime-data from within your minetest-world: + +* Current players with their positions +* Current time and max lag + +You can use the `mapserver-mod` either passive or active: +* *Passive* Makes some additional markers available (POI, etc) +* *Active* Communicates with the mapserver and sends realtime data (players, lag, time) + +## Installing and configuring the bridge-mod + +The mod itself is available in the git [repo](./mapserver_mod) +or as a zip package in the [releases](./releases) + +## Active mode + +The mod communicates via http with the mapserver. +You need to configure the *url* and the *secretkey* in your `minetest.conf` + +* Install the mapserver mod in your minetest instance +* Copy the `secretkey` from your `mapserver.json` (this is an autogenerated key) +* Enable http for the `mapserver` mod in your `minetest.conf` +* Configure your `minetest.conf` with the settings: `mapserver.url` and `mapserver.key` + +Example config: +``` +secure.http_mods = mapserver +mapserver.url = http://127.0.0.1:8080 +mapserver.key = ZJoSpysiKGlYexof +``` diff --git a/doc/params.md b/doc/params.md new file mode 100644 index 0000000..00a01f0 --- /dev/null +++ b/doc/params.md @@ -0,0 +1,29 @@ + +# Parameters + +Mapserver command line parameters: + +## Help +`./mapserver -help` +Shows all available commands + + +## Version +`./mapserver -version` +Shows the version, architecture and operating system: + +``` +Mapserver version: 0.0.2 +OS: linux +Architecture: amd64 +``` + + +## Debug mode +`./mapserver -debug` +Enables the debug mode +It is advisable to pipe the debug output to a file for later inspection: + +``` +./mapserver -debug > debug.txt +``` diff --git a/readme.md b/readme.md index 62c91fb..4b855c7 100644 --- a/readme.md +++ b/readme.md @@ -1,45 +1,45 @@ Minetest mapserver ======= -Realtime mapserver for Minetest +Realtime mapserver for [Minetest](https://minetest.net) + +# Documentation + +* [Installation](doc/install.md) +* [Mapserver mod](doc/mod.md) +* [Parameters](doc/params.md) +* [Configuration](doc/config.md) +* [Contribution](doc/contrib.md) # Features ## Current features * Initial and incremental map rendering +* Realtime player and world stats * Configurable layers (default: "Base" from y -16 to 160) ## Planned Features * POI markers / mod integration -* Player markers and infos (HP, breath, etc) +* Player infos (HP, breath, etc) +* LCD Displays as markers * Street names / Train stuff - -# Installation / Getting started - -**Please make a backup of your world in case something goes wrong** - -* Download the binary from the [releases](https://github.com/thomasrudin-mt/mapserver/releases) for your architecture and platform -* Drop the binary into your world folder (the one with the `world.mt` and `map.sqlite` files) -* Start the mapserver via command-line: `./mapserver` or `./mapserver.exe` -* Point your browser to `http://127.0.0.1:8080` - -# Configuration - -All config options reside in the `mapserver.json` file with the default values -Please stop the server if you make any changes there. +* City borders # Development state -* Early beta * Working basic features (map rendering) * Successor of http://github.com/thomasrudin-mt/minetest-tile-server +# Screenshots + +## Web interface + + +## Terminal + + # Bugs -There will be bugs, please file them in the *issues* page. - -# Contributions - -Contributions are always welcome via pull/merge requests +There will be bugs, please file them in the [issues](./issues) page. diff --git a/server/params/params.go b/server/params/params.go index fcc53cb..336743a 100644 --- a/server/params/params.go +++ b/server/params/params.go @@ -8,7 +8,6 @@ type ParamsType struct { Help bool Version bool Debug bool - Dumpconfig bool } func Parse() ParamsType {