shardserver

package
v0.0.0-...-93088af Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2013 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	// contains filtered or unexported fields
}

A chunk is slice of the world map.

func (*Chunk) AddActiveBlock

func (chunk *Chunk) AddActiveBlock(blockXyz *BlockXyz)

func (*Chunk) AddActiveBlockIndex

func (chunk *Chunk) AddActiveBlockIndex(blockIndex BlockIndex)

func (*Chunk) AddEntity

func (chunk *Chunk) AddEntity(s gamerules.INonPlayerEntity)

AddEntity creates a mob or item in this chunk and notifies all chunk subscribers of the new entity

func (*Chunk) AddOnUnsubscribe

func (chunk *Chunk) AddOnUnsubscribe(entityId EntityId, observer gamerules.IUnsubscribed)

AddOnUnsubscribe registers a function to be called when the given subscriber unsubscribes.

func (*Chunk) BlockQuery

func (chunk *Chunk) BlockQuery(blockLoc BlockXyz) (isSolid bool, isWithinChunk bool)

Used to read the BlockId of a block that's either in the chunk, or immediately adjoining it in a neighbouring chunk. In cases where the block type can't be determined we assume that the block asked about is solid (this way objects don't fly off the side of the map needlessly).

func (*Chunk) ItemType

func (chunk *Chunk) ItemType(itemTypeId ItemTypeId) (itemType *gamerules.ItemType, ok bool)

func (*Chunk) Rand

func (chunk *Chunk) Rand() *rand.Rand

func (*Chunk) RemoveOnUnsubscribe

func (chunk *Chunk) RemoveOnUnsubscribe(entityId EntityId, observer gamerules.IUnsubscribed)

RemoveOnUnsubscribe removes a function previously registered

func (*Chunk) SetBlockByIndex

func (chunk *Chunk) SetBlockByIndex(blockIndex BlockIndex, blockId BlockId, blockData byte)

func (*Chunk) SetTileEntity

func (chunk *Chunk) SetTileEntity(index BlockIndex, tileEntity gamerules.ITileEntity)

func (*Chunk) String

func (chunk *Chunk) String() string

func (*Chunk) TileEntity

func (chunk *Chunk) TileEntity(index BlockIndex) gamerules.ITileEntity

type ChunkShard

type ChunkShard struct {
	// contains filtered or unexported fields
}

ChunkShard represents a square shard of chunks that share a master goroutine.

func NewChunkShard

func NewChunkShard(shardConnecter gamerules.IShardConnecter, chunkStore chunkstore.IChunkStore, entityMgr *entity.EntityManager, loc ShardXz) (shard *ChunkShard)

func (*ChunkShard) String

func (shard *ChunkShard) String() string

type LocalShardManager

type LocalShardManager struct {
	// contains filtered or unexported fields
}

LocalShardManager contains all chunk shards and can look them up. It implements IShardConnecter and is for use in hosting all shards in the local process.

func NewLocalShardManager

func NewLocalShardManager(chunkStore chunkstore.IChunkStore, entityMgr *entity.EntityManager) *LocalShardManager

func (*LocalShardManager) EnqueueAllChunks

func (mgr *LocalShardManager) EnqueueAllChunks(fn func(chunk *Chunk))

EnqueueAllChunks runs a given function on all loaded chunks.

func (*LocalShardManager) EnqueueOnChunk

func (mgr *LocalShardManager) EnqueueOnChunk(loc ChunkXz, fn func(chunk *Chunk))

EnqueueOnChunk runs a function on the chunk at the given location. If the chunk does not exist, it does nothing.

func (*LocalShardManager) PlayerShardConnect

func (mgr *LocalShardManager) PlayerShardConnect(entityId EntityId, player gamerules.IPlayerClient, shardLoc ShardXz) gamerules.IPlayerShardClient

func (*LocalShardManager) ShardShardConnect

func (mgr *LocalShardManager) ShardShardConnect(shardLoc ShardXz) gamerules.IShardShardClient

Jump to

Keyboard shortcuts

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