Documentation
¶
Index ¶
- type Player
- func (p *Player) CanCall(command string) bool
- func (p *Player) DespawnPackets() []protocol.Packet
- func (p *Player) Player() *Player
- func (p *Player) QueuePacket(packet protocol.Packet)
- func (p *Player) Saveable() bool
- func (p *Player) SendMessage(msg *message.Message)
- func (p *Player) SpawnPackets() []protocol.Packet
- func (p *Player) Start()
- type PlayerHandler
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Player ¶
type Player struct { entity.EntityComponent //Parts entity.PositionComponent entity.LastPositionComponent Username string Server Server ClosedChannel chan struct{} Handler PlayerHandler LockChan chan chan struct{} // contains filtered or unexported fields }
A local player is a player connected directly to this server
func (*Player) DespawnPackets ¶
func (*Player) QueuePacket ¶
Queues a packet to be sent to the player
func (*Player) SendMessage ¶
Sends a message to the player
func (*Player) SpawnPackets ¶
type PlayerHandler ¶
type PlayerHandler interface { EnterWorld(*protocol.JoinGame) BlockPlacement(protocol.PlayerBlockPlacement) BlockDig(protocol.PlayerDigging) Chat(string) Leave() }
type Server ¶
type Server interface { entity.Server //Returns the default world for the server DefaultWorld() *world.World //Gets the world by name, loads the world if it isn't loaded World(name string) *world.World //Sends the packet to every player on the server QueuePacket(packet protocol.Packet) //Sends the message to every player on the server SendMessage(msg *message.Message) }
Contains methods that a player needs for a server
Click to show internal directories.
Click to hide internal directories.