2019-01-08 00:27:24 +03:00
|
|
|
package db
|
|
|
|
|
2019-01-09 13:11:45 +03:00
|
|
|
import (
|
|
|
|
"mapserver/coords"
|
|
|
|
)
|
|
|
|
|
2019-01-08 00:27:24 +03:00
|
|
|
type Block struct {
|
2019-01-13 18:37:03 +03:00
|
|
|
Pos coords.MapBlockCoords
|
|
|
|
Data []byte
|
|
|
|
Mtime int64
|
2019-01-08 00:27:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type DBAccessor interface {
|
|
|
|
Migrate() error
|
2019-01-21 11:11:07 +03:00
|
|
|
/**
|
|
|
|
* find old (pre-mapserver) mapblocks by lastpos
|
|
|
|
* used only on initial rendering
|
|
|
|
*/
|
|
|
|
FindLegacyBlocks(lastpos coords.MapBlockCoords, limit int) ([]Block, error)
|
|
|
|
|
2019-01-08 10:57:50 +03:00
|
|
|
FindLatestBlocks(mintime int64, limit int) ([]Block, error)
|
2019-01-17 17:14:13 +03:00
|
|
|
CountBlocks(pos1 coords.MapBlockCoords, pos2 coords.MapBlockCoords) (int, error)
|
2019-01-09 14:45:54 +03:00
|
|
|
GetBlock(pos coords.MapBlockCoords) (*Block, error)
|
2019-01-08 00:27:24 +03:00
|
|
|
}
|