diff --git a/server/mapblockaccessor/legacyblocks.go b/server/mapblockaccessor/legacyblocks.go index 51aba87..39bfdc5 100644 --- a/server/mapblockaccessor/legacyblocks.go +++ b/server/mapblockaccessor/legacyblocks.go @@ -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 diff --git a/server/mapblockaccessor/mapblockaccessor.go b/server/mapblockaccessor/mapblockaccessor.go index 14f985e..c1d224e 100644 --- a/server/mapblockaccessor/mapblockaccessor.go +++ b/server/mapblockaccessor/mapblockaccessor.go @@ -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 -} diff --git a/server/mapblockaccessor/mtime.go b/server/mapblockaccessor/mtime.go index 4dba785..4bfaffb 100644 --- a/server/mapblockaccessor/mtime.go +++ b/server/mapblockaccessor/mtime.go @@ -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