mmap

package
v0.0.0-...-ef9d94b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MapBlkUpdateRate, _ = time.ParseDuration("2s") // in seconds

	MapBlkUpdateRange  = int16(10) // in mapblks
	MapBlkUpdateHeight = int16(5)  // in mapblks

)

Functions

func Blk2DBPos

func Blk2DBPos(p [3]int16) (i int64)

converts blkpos to database pos

func DB2BlkPos

func DB2BlkPos(i int64) (p [3]int16)

convert database pos to blkpos (useless i think)

func EmptyBlk

func EmptyBlk() (blk *mtmap.MapBlk)

EmptyBlk returns a empty MapBlock containing fully lit air

func GetBlk

func GetBlk(p [3]int16) <-chan *mtmap.MapBlk

func GetNode

func GetNode(pos [3]int16) *mt.Node

GetNode returns the given mt.Content at a specified spot returns nil if blk does not exist

func LoadBlk

func LoadBlk(c *minetest.Client, p [3]int16, force bool)

LoadBlk sends a minetest.Client a blk at pos TODO: if force is false, will only update every 10 seconds (atm sends only once (per client)) triggers SBMs

func OpenDB

func OpenDB(file string) (err error)

func PluginsLoaded

func PluginsLoaded()

DO NOT CALL IF YOU DONT KNOW WHAT YOUR DOING

func Pos2int

func Pos2int(p mt.Pos) (i [3]int16)

func PosUpdate

func PosUpdate(c *minetest.Client, pos *mt.PlayerPos, LastUpdate int64)

DO NOT CALL IF YOU DONT KNOW WHAT YOUR DOING

func ProcessPkt

func ProcessPkt(c *minetest.Client, pkt *mt.Pkt)

DO NOT CALL IF YOU DONT KNOW WHAT YOUR DOING

func RegisterSBM

func RegisterSBM(s *SBM)

RegisterSBM registers a SBM

func SetBlk

func SetBlk(p [3]int16, blk *mtmap.MapBlk)

func SetNode

func SetNode(pos [3]int16, node mt.Node)

SetNode reads a blk and sets node to node then saves

Types

type MapBlkData

type MapBlkData [4096]mt.Content

type SBM

type SBM struct {
	Send func(clt *minetest.Client, pos [3]int16, blk *mtmap.MapBlk)
}

SBM describes a Send Block Manager gets called whenever a mapblk is send to a client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL