psql stub
This commit is contained in:
parent
c6adc74f2d
commit
81ee5d9f0f
@ -57,8 +57,14 @@ func Setup(p params.ParamsType, cfg *Config) (*App, error) {
|
|||||||
//mapblock renderer
|
//mapblock renderer
|
||||||
a.Mapblockrenderer = mapblockrenderer.NewMapBlockRenderer(a.BlockAccessor, a.Colormapping)
|
a.Mapblockrenderer = mapblockrenderer.NewMapBlockRenderer(a.BlockAccessor, a.Colormapping)
|
||||||
|
|
||||||
//tile database
|
//mapserver database
|
||||||
a.Objectdb, err = mapobjectdb.NewSqliteAccessor("mapserver.sqlite")
|
if a.Worldconfig.MapObjectConnection != nil {
|
||||||
|
//TODO: Psql connection
|
||||||
|
|
||||||
|
} else {
|
||||||
|
a.Objectdb, err = mapobjectdb.NewSqliteAccessor("mapserver.sqlite")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -19,6 +19,7 @@ const (
|
|||||||
CONFIG_PLAYER_BACKEND string = "player_backend"
|
CONFIG_PLAYER_BACKEND string = "player_backend"
|
||||||
CONFIG_PSQL_CONNECTION string = "pgsql_connection"
|
CONFIG_PSQL_CONNECTION string = "pgsql_connection"
|
||||||
CONFIG_PSQL_PLAYER_CONNECTION string = "pgsql_player_connection"
|
CONFIG_PSQL_PLAYER_CONNECTION string = "pgsql_player_connection"
|
||||||
|
CONFIG_PSQL_MAPSERVER string = "pgsql_mapserver_connection"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PsqlConfig struct {
|
type PsqlConfig struct {
|
||||||
@ -35,6 +36,7 @@ type WorldConfig struct {
|
|||||||
|
|
||||||
PsqlConnection *PsqlConfig
|
PsqlConnection *PsqlConfig
|
||||||
PsqlPlayerConnection *PsqlConfig
|
PsqlPlayerConnection *PsqlConfig
|
||||||
|
MapObjectConnection *PsqlConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseConnectionString(str string) *PsqlConfig {
|
func parseConnectionString(str string) *PsqlConfig {
|
||||||
@ -90,6 +92,8 @@ func Parse(filename string) WorldConfig {
|
|||||||
cfg.PsqlConnection = parseConnectionString(valueStr)
|
cfg.PsqlConnection = parseConnectionString(valueStr)
|
||||||
case CONFIG_PSQL_PLAYER_CONNECTION:
|
case CONFIG_PSQL_PLAYER_CONNECTION:
|
||||||
cfg.PsqlPlayerConnection = parseConnectionString(valueStr)
|
cfg.PsqlPlayerConnection = parseConnectionString(valueStr)
|
||||||
|
case CONFIG_PSQL_MAPSERVER:
|
||||||
|
cfg.MapObjectConnection = parseConnectionString(valueStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user