Documentation ¶
Index ¶
- type AddEntityEntry
- type AddPlayerEntry
- type Handler
- type IPacketManager
- type PacketManagerBase
- func (Base *PacketManagerBase) DeregisterPacketHandlers(packet info.PacketName, priority int)
- func (Base *PacketManagerBase) GetHandlers(packet info.PacketName) [][]Handler
- func (Base *PacketManagerBase) GetHandlersById(id int) [][]Handler
- func (Base *PacketManagerBase) GetIdList() info.PacketIdList
- func (Base *PacketManagerBase) GetPacket(packetId int) packets.IPacket
- func (Base *PacketManagerBase) GetPackets() map[int]func() packets.IPacket
- func (Base *PacketManagerBase) IsPacketRegistered(packetId int) bool
- func (Base *PacketManagerBase) RegisterHandler(packet info.PacketName, handler Handler) bool
- func (Base *PacketManagerBase) RegisterPacket(packetId int, packetFunc func() packets.IPacket)
- type PlayerListEntry
- type StartGameEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddEntityEntry ¶
type AddPlayerEntry ¶
type AddPlayerEntry interface { AddEntityEntry GetDisplayName() string GetName() string }
type IPacketManager ¶
type IPacketManager interface { GetIdList() info.PacketIdList GetHandlers(packet info.PacketName) [][]Handler GetHandlersById(id int) [][]Handler RegisterHandler(packet info.PacketName, handler Handler) bool DeregisterPacketHandlers(packet info.PacketName, priority int) GetPackets() map[int]func() packets.IPacket RegisterPacket(packetId int, packetFunc func() packets.IPacket) GetPacket(packetId int) packets.IPacket IsPacketRegistered(packetId int) bool GetAddEntity(AddEntityEntry) packets.IPacket GetAddPlayer(uuid.UUID, AddPlayerEntry) packets.IPacket GetChunkRadiusUpdated(int32) packets.IPacket GetCraftingData() packets.IPacket GetDisconnect(string, bool) packets.IPacket GetFullChunkData(*chunks.Chunk) packets.IPacket GetMovePlayer(uint64, r3.Vector, data.Rotation, byte, bool, uint64) packets.IPacket GetPlayerList(byte, map[string]PlayerListEntry) packets.IPacket GetPlayStatus(int32) packets.IPacket GetRemoveEntity(int64) packets.IPacket GetResourcePackChunkData(string, int32, int64, []byte) packets.IPacket GetResourcePackDataInfo(packs.Pack) packets.IPacket GetResourcePackInfo(bool, *packs.Stack, *packs.Stack) packets.IPacket GetResourcePackStack(bool, *packs.Stack, *packs.Stack) packets.IPacket GetServerHandshake(string) packets.IPacket GetSetEntityData(uint64, map[uint32][]interface{}) packets.IPacket GetStartGame(StartGameEntry, []byte) packets.IPacket GetText(types.Text) packets.IPacket GetTransfer(string, uint16) packets.IPacket GetUpdateAttributes(uint64, data.AttributeMap) packets.IPacket GetNetworkChunkPublisherUpdatePacket(position blocks.Position, radius uint32) packets.IPacket GetMoveEntity(uint64, r3.Vector, data.Rotation, byte, bool) packets.IPacket GetPlayerSkin(uuid2 uuid.UUID, skinId, geometryName, geometryData string, skinData, capeData []byte) packets.IPacket GetPlayerAction(runtimeId uint64, action int32, position blocks.Position, face int32) packets.IPacket GetAnimate(action int32, runtimeId uint64, float float32) packets.IPacket GetUpdateBlock(position blocks.Position, blockRuntimeId, dataLayerId uint32) packets.IPacket }
type PacketManagerBase ¶
type PacketManagerBase struct {
// contains filtered or unexported fields
}
PacketManagerBase is a struct providing the base for a PacketManagerBase. It provides utility functions for a basic PacketManagerBase implementation.
func NewPacketManagerBase ¶
func NewPacketManagerBase(idList info.PacketIdList, packets map[int]func() packets.IPacket, handlers map[int][][]Handler) *PacketManagerBase
NewBase returns a new PacketManagerBase with the given PacketManagerBase number and packets.
func (*PacketManagerBase) DeregisterPacketHandlers ¶
func (Base *PacketManagerBase) DeregisterPacketHandlers(packet info.PacketName, priority int)
DeregisterPackHandlers deregisters all packet handlers listening for packets with the given ID, on the given priority.
func (*PacketManagerBase) GetHandlers ¶
func (Base *PacketManagerBase) GetHandlers(packet info.PacketName) [][]Handler
GetHandlers returns all handlers registered for the given packet name.
func (*PacketManagerBase) GetHandlersById ¶
func (Base *PacketManagerBase) GetHandlersById(id int) [][]Handler
GetHandlersById returns all handlers registered on the given ID.
func (*PacketManagerBase) GetIdList ¶
func (Base *PacketManagerBase) GetIdList() info.PacketIdList
GetIdList returns the packet name => Id list of the bedrock.
func (*PacketManagerBase) GetPacket ¶
func (Base *PacketManagerBase) GetPacket(packetId int) packets.IPacket
GetPacket returns a packet with the given packet ID.
func (*PacketManagerBase) GetPackets ¶
func (Base *PacketManagerBase) GetPackets() map[int]func() packets.IPacket
GetPackets returns a packet ID => packet function map containing all registered packets.
func (*PacketManagerBase) IsPacketRegistered ¶
func (Base *PacketManagerBase) IsPacketRegistered(packetId int) bool
IsPacketRegistered checks if the PacketManagerBase has a packet with the given packet ID.
func (*PacketManagerBase) RegisterHandler ¶
func (Base *PacketManagerBase) RegisterHandler(packet info.PacketName, handler Handler) bool
RegisterHandler registers a new packet handler to listen for packets with the given ID. This function uses the priority of the handler. Returns a bool indicating success.
func (*PacketManagerBase) RegisterPacket ¶
func (Base *PacketManagerBase) RegisterPacket(packetId int, packetFunc func() packets.IPacket)
RegisterPacket registers a packet function with the given packet ID.