Compare commits

...

5 Commits

Author SHA1 Message Date
Thomas Rudin 86c32221fb
Merge pull request #46 from alek13/patch-1
add support for block versions >25 and <28
2019-01-31 06:42:23 +01:00
Alexander Chibrikin f689bafd31
add support for block versions >25 and <28 2019-01-30 23:09:35 +03:00
Thomas Rudin 16dfe8c706 split doc 2018-12-20 08:16:42 +01:00
Thomas Rudin 2ce30b8e90 ignore mapblocks dir 2018-12-20 08:12:41 +01:00
Thomas Rudin c260b92c45 fix update test with max zoom level 2018-12-19 17:18:59 +01:00
5 changed files with 66 additions and 62 deletions

View File

@ -1,3 +1,4 @@
integration
logs
tiles
mapblocks

61
docs/config.md Normal file
View File

@ -0,0 +1,61 @@
The application drwas its configuration from the `tileserver.properties` file.
Key and values should be separated by a `=` (see **Example config**)
## Example config
Example for a setup with server-name **myhost**:
```
#tileserver.properties
minetest.db.url=jdbc:postgresql://myhost:5432/postgres
minetest.db.username=postgres
minetest.db.password=1234
```
## Configuration parameters
### http.port
Port to expose http server on
* Default: **8080**
### tilerenderer.updateinterval
Update interval to check for new tiles (in seconds)
* Default: **20**
### tilerenderer.initialrendering.enable
Enable initial rendering, renders/caches all tiles on startup and disables the realtime tile-update until restarted with false again.
Leaving this to default (false) renders all tiles on-demand
* Default: **false**
### player.updateinterval
Update interval to check for Player movements (in seconds)
* Default: **2**
### minetest.db.url
Url for DB Connection (jdbc connection string)
* Default: **jdbc:postgresql://127.0.0.1:5432/minetest**
### minetest.db.username
Username for DB Connection
* Default: **sa**
### minetest.db.password
Username for DB Connection
* Default:
### minetest.db.driver
Driver for DB Connection (only psql supported for now)
* Default: **org.postgresql.Driver**
### block.parser.poi.enable
Enable parsing of POI blocks, provided with the mod in this repository
* Default: **true**
### block.parser.travelnet.enable
Enable parsing of Travelnet boxes
* Default: **true**
### colors.file
Supply an external colors file supplementary to the builtin tables
Should be a valid filename or empty (no external colors)
* Default: **none**

View File

@ -43,66 +43,7 @@ Please create an issue with minetest-version and MapBlock info in the bug-tracke
# Configuring
The application drwas its configuration from the `tileserver.properties` file.
Key and values should be separated by a `=` (see **Example config**)
## Example config
Example for a setup with server-name **myhost**:
```
#tileserver.properties
minetest.db.url=jdbc:postgresql://myhost:5432/postgres
minetest.db.username=postgres
minetest.db.password=1234
```
## Configuration parameters
### http.port
Port to expose http server on
* Default: **8080**
### tilerenderer.updateinterval
Update interval to check for new tiles (in seconds)
* Default: **20**
### tilerenderer.initialrendering.enable
Enable initial rendering, renders/caches all tiles on startup and disables the realtime tile-update until restarted with false again.
Leaving this to default (false) renders all tiles on-demand
* Default: **false**
### player.updateinterval
Update interval to check for Player movements (in seconds)
* Default: **2**
### minetest.db.url
Url for DB Connection (jdbc connection string)
* Default: **jdbc:postgresql://127.0.0.1:5432/minetest**
### minetest.db.username
Username for DB Connection
* Default: **sa**
### minetest.db.password
Username for DB Connection
* Default:
### minetest.db.driver
Driver for DB Connection (only psql supported for now)
* Default: **org.postgresql.Driver**
### block.parser.poi.enable
Enable parsing of POI blocks, provided with the mod in this repository
* Default: **true**
### block.parser.travelnet.enable
Enable parsing of Travelnet boxes
* Default: **true**
### colors.file
Supply an external colors file supplementary to the builtin tables
Should be a valid filename or empty (no external colors)
* Default: **none**
See [config](docs/config.md)
# How it works

View File

@ -52,7 +52,7 @@ public class MapBlockParser {
block.version = data[0];
if (block.version != 28) {
if (block.version < 25 || block.version > 28) {
logger.error("block version not supported: {}", block.version);
throw new IllegalArgumentException("block version not supported: " + block.version);
}
@ -68,7 +68,7 @@ public class MapBlockParser {
//data[4] = content_width (2)
//data[5] = params_width (2)
int dataOffset = 6;
int dataOffset = block.version >= 27 ? 6 : 4;
Inflater inflater = new Inflater();
inflater.setInput(data, dataOffset, data.length - dataOffset);

View File

@ -35,6 +35,7 @@ public class UpdateChangedTilesTest extends TileServerTest {
MapBlockCoordinate mapBlockCoordinate = new MapBlockCoordinate(0, 0);
TileCoordinate tileCoordinate = CoordinateFactory.getTileCoordinateFromMapBlock(mapBlockCoordinate);
tileCoordinate = CoordinateFactory.getZoomedOutTile(tileCoordinate);
logger.debug("Mapblock X={} Z={} / Tile X={} Y={} Zoom={}",
mapBlockCoordinate.x, mapBlockCoordinate.z,