From 26c36632878d6c99836f7982cae6f014c8a467f0 Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Sun, 10 Feb 2019 20:34:11 +0100 Subject: [PATCH] cleanup --- server/mapblockaccessor/legacyblocks.go | 12 ++++++++++-- server/mapblockaccessor/mapblockaccessor.go | 9 --------- server/mapblockaccessor/mtime.go | 12 ++++++++++-- 3 files changed, 20 insertions(+), 13 deletions(-) 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