本文整理匯總了Golang中github.com/gemrs/gem/gem/encoding.PacketHeader類的典型用法代碼示例。如果您正苦於以下問題:Golang PacketHeader類的具體用法?Golang PacketHeader怎麽用?Golang PacketHeader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了PacketHeader類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Decode
func (frm *OutboundRegionUpdate) Decode(buf io.Reader, flags interface{}) (err error) {
struc := (*anonymous_outbound_packets_bb_0)(frm)
hdr := encoding.PacketHeader{
Number: OutboundRegionUpdateDefinition.Number,
Size: OutboundRegionUpdateDefinition.Size,
Object: struc,
}
return hdr.Decode(buf, flags)
}
示例2: Encode
func (frm *OutboundPlayerInit) Encode(buf io.Writer, flags interface{}) (err error) {
struc := (*anonymous_outbound_packets_bb_2)(frm)
hdr := encoding.PacketHeader{
Number: OutboundPlayerInitDefinition.Number,
Size: OutboundPlayerInitDefinition.Size,
Object: struc,
}
return hdr.Encode(buf, flags)
}
示例3: Decode
func (frm *InboundPlayerWalk) Decode(buf io.Reader, flags interface{}) (err error) {
struc := (*InboundPlayerWalkBlock)(frm)
hdr := encoding.PacketHeader{
Number: InboundPlayerWalkDefinition.Number,
Size: InboundPlayerWalkDefinition.Size,
Object: struc,
}
return hdr.Decode(buf, flags)
}
示例4: Decode
func (frm *InboundPing) Decode(buf io.Reader, flags interface{}) (err error) {
struc := (*anonymous_inbound_packets_bb_0)(frm)
hdr := encoding.PacketHeader{
Number: InboundPingDefinition.Number,
Size: InboundPingDefinition.Size,
Object: struc,
}
return hdr.Decode(buf, flags)
}
示例5: Decode
func (frm *PlayerUpdate) Decode(buf io.Reader, flags interface{}) (err error) {
struc := (*PlayerUpdateBlock)(frm)
hdr := encoding.PacketHeader{
Number: PlayerUpdateDefinition.Number,
Size: PlayerUpdateDefinition.Size,
Object: struc,
}
return hdr.Decode(buf, flags)
}