This commit is contained in:
Thomas Rudin 2019-02-10 20:34:11 +01:00
parent 04ef01ee78
commit 26c3663287
3 changed files with 20 additions and 13 deletions

View File

@ -10,7 +10,15 @@ import (
"github.com/sirupsen/logrus"
)
func (a *MapBlockAccessor) FindNextLegacyBlocks(lastpos *coords.MapBlockCoords, limit int, layerfilter []layer.Layer) (*FindMapBlocksResult, error) {
type FindNextLegacyBlocksResult struct {
HasMore bool
LastPos *coords.MapBlockCoords
LastMtime int64
List []*mapblockparser.MapBlock
UnfilteredCount int
}
func (a *MapBlockAccessor) FindNextLegacyBlocks(lastpos *coords.MapBlockCoords, limit int, layerfilter []layer.Layer) (*FindNextLegacyBlocksResult, error) {
fields := logrus.Fields{
"x": lastpos.X,
@ -26,7 +34,7 @@ func (a *MapBlockAccessor) FindNextLegacyBlocks(lastpos *coords.MapBlockCoords,
return nil, err
}
result := FindMapBlocksResult{}
result := FindNextLegacyBlocksResult{}
mblist := make([]*mapblockparser.MapBlock, 0)
var newlastpos *coords.MapBlockCoords

View File

@ -5,7 +5,6 @@ import (
"mapserver/coords"
"mapserver/db"
"mapserver/eventbus"
"mapserver/mapblockparser"
"time"
@ -31,11 +30,3 @@ func NewMapBlockAccessor(accessor db.DBAccessor) *MapBlockAccessor {
Eventbus: eventbus.New(),
}
}
type FindMapBlocksResult struct {
HasMore bool
LastPos *coords.MapBlockCoords
LastMtime int64
List []*mapblockparser.MapBlock
UnfilteredCount int
}

View File

@ -10,7 +10,15 @@ import (
"github.com/sirupsen/logrus"
)
func (a *MapBlockAccessor) FindMapBlocksByMtime(lastmtime int64, limit int, layerfilter []layer.Layer) (*FindMapBlocksResult, error) {
type FindMapBlocksByMtimeResult struct {
HasMore bool
LastPos *coords.MapBlockCoords
LastMtime int64
List []*mapblockparser.MapBlock
UnfilteredCount int
}
func (a *MapBlockAccessor) FindMapBlocksByMtime(lastmtime int64, limit int, layerfilter []layer.Layer) (*FindMapBlocksByMtimeResult, error) {
fields := logrus.Fields{
"lastmtime": lastmtime,
@ -24,7 +32,7 @@ func (a *MapBlockAccessor) FindMapBlocksByMtime(lastmtime int64, limit int, laye
return nil, err
}
result := FindMapBlocksResult{}
result := FindMapBlocksByMtimeResult{}
mblist := make([]*mapblockparser.MapBlock, 0)
var newlastpos *coords.MapBlockCoords