Documentation ¶
Index ¶
- Variables
- func RegisterPackets()
- func SetupLoggerFiles() (*os.File, *os.File, func(), error)
- func SetupServerLogger() func()
- type ClientBoundWorldStateUpdate
- type Connection
- type Packet
- type RecievedPacket
- type ServerBoundAddVolume
- type ServerBoundLightingUpdate
- type ServerBoundWorldStateRequest
- type Volume
- type WorldState
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RegisterPackets ¶
func RegisterPackets()
func SetupServerLogger ¶
func SetupServerLogger() func()
Types ¶
type ClientBoundWorldStateUpdate ¶
type ClientBoundWorldStateUpdate struct {
State WorldState
}
type Connection ¶
type Connection struct { Connection net.Conn ClientAddr net.Addr Encoder *gob.Encoder Decoder *gob.Decoder }
func NewConnection ¶
func NewConnection(conn net.Conn) Connection
func (Connection) MustRecieve ¶
func (c Connection) MustRecieve() Packet
Same as Recieve() but panics if it encounters an error
func (Connection) MustSend ¶
func (c Connection) MustSend(packet Packet)
Same as Send() but panics if it encounters an error
func (Connection) Recieve ¶
func (c Connection) Recieve() (Packet, error)
Waits for incoming data on the Connection before it decodes the data into a packet with the gob.Decoder
func (Connection) Send ¶
func (c Connection) Send(packet Packet) error
Encodes a packet with the gob.Encoder and sends it along the Connection
type RecievedPacket ¶
type ServerBoundAddVolume ¶
type ServerBoundAddVolume struct {
Volume Volume
}
type ServerBoundWorldStateRequest ¶
type ServerBoundWorldStateRequest struct { }
type WorldState ¶
Click to show internal directories.
Click to hide internal directories.