2019-01-07 22:27:24 +01:00
|
|
|
package db
|
|
|
|
|
2019-01-09 11:11:45 +01:00
|
|
|
import (
|
|
|
|
"mapserver/coords"
|
|
|
|
)
|
|
|
|
|
2019-01-07 22:27:24 +01:00
|
|
|
type Block struct {
|
2019-01-13 16:37:03 +01:00
|
|
|
Pos coords.MapBlockCoords
|
|
|
|
Data []byte
|
|
|
|
Mtime int64
|
2019-01-07 22:27:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type DBAccessor interface {
|
|
|
|
Migrate() error
|
2019-01-24 15:56:37 +01:00
|
|
|
|
|
|
|
FindBlocksByMtime(gtmtime int64, limit int) ([]Block, error)
|
|
|
|
FindLegacyBlocksByPos(lastpos coords.MapBlockCoords, limit int) ([]Block, error)
|
|
|
|
|
2019-01-24 07:22:28 +01:00
|
|
|
CountBlocks(frommtime, tomtime int64) (int, error)
|
2019-01-09 12:45:54 +01:00
|
|
|
GetBlock(pos coords.MapBlockCoords) (*Block, error)
|
2019-01-07 22:27:24 +01:00
|
|
|
}
|