本文整理匯總了Golang中gslib/utils/packet.Packet.WriteString方法的典型用法代碼示例。如果您正苦於以下問題:Golang Packet.WriteString方法的具體用法?Golang Packet.WriteString怎麽用?Golang Packet.WriteString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gslib/utils/packet.Packet
的用法示例。
在下文中一共展示了Packet.WriteString方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: encodeLoginResponse
func encodeLoginResponse(buffer *packet.Packet, value interface{}) {
v := value.(*LoginResponse)
buffer.WriteString(v.Uuid)
buffer.WriteUint32(v.Level)
buffer.WriteFloat32(v.Exp)
buffer.WriteUint16(uint16(len(v.Equips)))
for i := 0; i < len(v.Equips); i++ {
encodeEquipLoadResponse(buffer, v.Equips[i])
}
buffer.WriteUint16(uint16(len(v.Friends)))
for i := 0; i < len(v.Friends); i++ {
buffer.WriteString(v.Friends[i])
}
buffer.WriteUint16(uint16(len(v.Ages)))
for i := 0; i < len(v.Ages); i++ {
buffer.WriteInt32(v.Ages[i])
}
}
示例2: encodeEquipUnLoadResponse
func encodeEquipUnLoadResponse(buffer *packet.Packet, value interface{}) {
v := value.(*EquipUnLoadResponse)
buffer.WriteString(v.PlayerID)
buffer.WriteString(v.EquipId)
buffer.WriteUint32(v.Level)
}
示例3: encodeEquipUnLoadParams
func encodeEquipUnLoadParams(buffer *packet.Packet, value interface{}) {
v := value.(*EquipUnLoadParams)
buffer.WriteString(v.PlayerID)
buffer.WriteString(v.EquipId)
buffer.WriteString(v.HeroId)
}