當前位置: 首頁>>代碼示例>>Golang>>正文


Golang encoding.PacketHeader類代碼示例

本文整理匯總了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)
}
開發者ID:gemrs,項目名稱:gem,代碼行數:9,代碼來源:outbound_packets.bb.go

示例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)
}
開發者ID:gemrs,項目名稱:gem,代碼行數:9,代碼來源:outbound_packets.bb.go

示例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)
}
開發者ID:gemrs,項目名稱:gem,代碼行數:9,代碼來源:player_walk.go

示例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)
}
開發者ID:gemrs,項目名稱:gem,代碼行數:9,代碼來源:inbound_packets.bb.go

示例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)
}
開發者ID:gemrs,項目名稱:gem,代碼行數:9,代碼來源:player_update.go


注:本文中的github.com/gemrs/gem/gem/encoding.PacketHeader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。