tileserver legacy upgrade and compat

This commit is contained in:
NatureFreshMilk 2019-03-22 11:27:14 +01:00
parent 783fdc2ef8
commit 70e859ca07
4 changed files with 63 additions and 34 deletions

View File

@ -6,6 +6,7 @@ dofile(MP.."/poi.lua")
dofile(MP.."/train.lua")
dofile(MP.."/label.lua")
dofile(MP.."/border.lua")
dofile(MP.."/legacy.lua")
-- optional mapserver-bridge stuff below

View File

@ -0,0 +1,20 @@
minetest.register_lbm({
label = "Tileserver->Mapserver poi upgrade",
name = "tileserver:poi",
nodenames = {"tileserver:poi"},
run_at_every_load = true,
action = function(pos, node)
minetest.swap_node(pos, { name="mapserver:poi" })
end
})
minetest.register_lbm({
label = "Tileserver->Mapserver train upgrade",
name = "tileserver:train",
nodenames = {"tileserver:train"},
run_at_every_load = true,
action = function(pos, node)
minetest.swap_node(pos, { name="mapserver:train" })
end
})

View File

@ -31,23 +31,24 @@ type MapBlockAccessorConfig struct {
}
type MapObjectConfig struct {
Areas bool `json:"areas"`
Bones bool `json:"bones"`
Protector bool `json:"protector"`
XPProtector bool `json:"xpprotector"`
PrivProtector bool `json:"privprotector"`
Technic bool `json:"technic"`
LuaController bool `json:"luacontroller"`
Digiterms bool `json:"digiterms"`
Digilines bool `json:"digilines"`
Travelnet bool `json:"travelnet"`
Mapserver bool `json:"mapserver"`
Mission bool `json:"mission"`
Jumpdrive bool `json:"jumpdrive"`
Smartshop bool `json:"smartshop"`
Fancyvend bool `json:"fancyvend"`
ATM bool `json:"atm"`
Train bool `json:"train"`
Areas bool `json:"areas"`
Bones bool `json:"bones"`
Protector bool `json:"protector"`
XPProtector bool `json:"xpprotector"`
PrivProtector bool `json:"privprotector"`
Technic bool `json:"technic"`
LuaController bool `json:"luacontroller"`
Digiterms bool `json:"digiterms"`
Digilines bool `json:"digilines"`
Travelnet bool `json:"travelnet"`
Mapserver bool `json:"mapserver"`
TileServerLegacy bool `json:"tileserverlegacy"`
Mission bool `json:"mission"`
Jumpdrive bool `json:"jumpdrive"`
Smartshop bool `json:"smartshop"`
Fancyvend bool `json:"fancyvend"`
ATM bool `json:"atm"`
Train bool `json:"train"`
}
type WebApiConfig struct {
@ -109,23 +110,24 @@ func ParseConfig(filename string) (*Config, error) {
}
mapobjs := MapObjectConfig{
Areas: true,
Bones: true,
Protector: true,
XPProtector: true,
PrivProtector: true,
Technic: true,
LuaController: true,
Digiterms: true,
Digilines: true,
Travelnet: true,
Mapserver: true,
Mission: true,
Jumpdrive: true,
Smartshop: true,
Fancyvend: true,
ATM: true,
Train: true,
Areas: true,
Bones: true,
Protector: true,
XPProtector: true,
PrivProtector: true,
Technic: true,
LuaController: true,
Digiterms: true,
Digilines: true,
Travelnet: true,
Mapserver: true,
TileServerLegacy: true,
Mission: true,
Jumpdrive: true,
Smartshop: true,
Fancyvend: true,
ATM: true,
Train: true,
}
mapblockaccessor := MapBlockAccessorConfig{

View File

@ -19,6 +19,12 @@ func Setup(ctx *app.App) {
l.AddMapObject("mapserver:label", &LabelBlock{})
}
//old tileserver stuff
if ctx.Config.MapObjects.TileServerLegacy {
l.AddMapObject("tileserver:poi", &PoiBlock{})
l.AddMapObject("tileserver:train", &TrainBlock{})
}
//travelnet
if ctx.Config.MapObjects.Travelnet {
l.AddMapObject("travelnet:travelnet", &TravelnetBlock{})