本文整理匯總了Golang中nonamelib/network.IPacket.AddUint32方法的典型用法代碼示例。如果您正苦於以下問題:Golang IPacket.AddUint32方法的具體用法?Golang IPacket.AddUint32怎麽用?Golang IPacket.AddUint32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nonamelib/network.IPacket
的用法示例。
在下文中一共展示了IPacket.AddUint32方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: writeChangePP
func (m *BattleEventMessage) writeChangePP(_packet pnet.IPacket) pnet.IPacket {
_packet.AddUint32(m.PokemonId)
_packet.AddUint32(m.MoveSlotId)
_packet.AddUint8(m.NewPP)
return _packet
}
示例2: WritePacket
// WritePacket write the needed object data to a Packet and returns it
func (m *BattleEventMessage) WritePacket() pnet.IPacket {
var packet pnet.IPacket = pnet.NewPacketExt(m.GetHeader())
packet.AddUint32(m.EventType)
switch m.EventType {
case pnet.BATTLEEVENT_TEXT:
packet = m.writeMessage(packet)
case pnet.BATTLEEVENT_CHANGEPP:
packet = m.writeChangePP(packet)
case pnet.BATTLEEVENT_CHANGEHP:
packet = m.writeChangeHP(packet)
}
return packet
}
示例3: writeChangeHP
func (m *BattleEventMessage) writeChangeHP(_packet pnet.IPacket) pnet.IPacket {
_packet.AddUint32(m.PokemonId)
_packet.AddUint16(m.NewHP)
return _packet
}