Ejemplo n.º 1
0
func decodeLoginResponse(buffer *packet.Packet) interface{} {
	data := &LoginResponse{}
	data.Uuid = buffer.ReadString()
	data.Level = buffer.ReadUint32()
	data.Exp = buffer.ReadFloat32()

	for i := 0; i < int(buffer.ReadUint16()); i++ {
		data.Equips = append(data.Equips, decodeEquipLoadResponse(buffer).(*EquipLoadResponse))
	}

	for i := 0; i < int(buffer.ReadUint16()); i++ {
		data.Friends = append(data.Friends, buffer.ReadString())
	}

	for i := 0; i < int(buffer.ReadUint16()); i++ {
		data.Ages = append(data.Ages, buffer.ReadInt32())
	}
	return data
}