Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrReachRateLimit = errors.New("reach rate limit")
View Source
var NetworkCodec registry.NetworkCodec
Functions ¶
func NewEntityID ¶
func NewEntityID() int32
Types ¶
type ChunkProvider ¶
type ChunkProvider struct {
// contains filtered or unexported fields
}
ChunkProvider implements chunk storage
func NewProvider ¶
func NewProvider(dir string, limiter *rate.Limiter) ChunkProvider
type ChunkViewer ¶
type Client ¶
type Client interface { ChunkViewer EntityViewer SendDisconnect(reason chat.Message) SendPlayerPosition(pos [3]float64, rot [2]float32) (teleportID int32) SendSetChunkCacheCenter(chunkPos [2]int32) }
type ClientInfo ¶
type EntityViewer ¶
type EntityViewer interface { ViewAddPlayer(p *Player) ViewRemoveEntities(entityIDs []int32) ViewMoveEntityPos(id int32, delta [3]int16, onGround bool) ViewMoveEntityPosAndRot(id int32, delta [3]int16, rot [2]int8, onGround bool) ViewMoveEntityRot(id int32, rot [2]int8, onGround bool) ViewRotateHead(id int32, yaw int8) ViewTeleportEntity(id int32, pos [3]float64, rot [2]int8, onGround bool) }
type LoadedChunk ¶
func (*LoadedChunk) AddViewer ¶
func (lc *LoadedChunk) AddViewer(v ChunkViewer)
func (*LoadedChunk) RemoveViewer ¶
func (lc *LoadedChunk) RemoveViewer(v ChunkViewer) bool
type Player ¶
type Player struct { Entity Name string UUID uuid.UUID PubKey *user.PublicKey Properties []user.Property Latency time.Duration ChunkPos [3]int32 ViewDistance int32 Gamemode int32 EntitiesInView map[int32]*Entity Inputs Inputs // contains filtered or unexported fields }
func (*Player) GetPrevChatSignature ¶
func (*Player) SetLastChatTimestamp ¶
SetLastChatTimestamp update the lastChatTimestamp and return true if new timestamp is newer than last one. Otherwise, didn't update the lastChatTimestamp and return false.
func (*Player) SetPrevChatSignature ¶
type PlayerProvider ¶
type PlayerProvider struct {
// contains filtered or unexported fields
}
func NewPlayerProvider ¶
func NewPlayerProvider(dir string) PlayerProvider
type TeleportRequest ¶
type World ¶
type World struct {
// contains filtered or unexported fields
}
func (*World) HashedSeed ¶
func (*World) RemovePlayer ¶
func (*World) SpawnPositionAndAngle ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.