/// <summary>
        ///     Composes the specified achievement.
        /// </summary>
        /// <param name="achievement">The achievement.</param>
        /// <param name="level">The level.</param>
        /// <param name="pointReward">The point reward.</param>
        /// <param name="pixelReward">The pixel reward.</param>
        /// <returns>ServerMessage.</returns>
        internal static ServerMessage Compose(Achievement achievement, int level, int pointReward, int pixelReward)
        {
            var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("UnlockAchievementMessageComposer"));

            serverMessage.AppendInteger(achievement.Id);
            serverMessage.AppendInteger(level);
            serverMessage.AppendInteger(144);
            serverMessage.AppendString($"{achievement.GroupName}{level}");
            serverMessage.AppendInteger(pointReward);
            serverMessage.AppendInteger(pixelReward);
            serverMessage.AppendInteger(0);
            serverMessage.AppendInteger(10);
            serverMessage.AppendInteger(21);
            serverMessage.AppendString(level > 1 ? $"{achievement.GroupName}{(level - 1)}" : string.Empty);
            serverMessage.AppendString(achievement.Category);
            serverMessage.AppendBool(true);

            return serverMessage;
        }
        /// <summary>
        ///     Composes the specified achievement.
        /// </summary>
        /// <param name="achievement">The achievement.</param>
        /// <param name="targetLevel">The target level.</param>
        /// <param name="targetLevelData">The target level data.</param>
        /// <param name="totalLevels">The total levels.</param>
        /// <param name="userData">The user data.</param>
        /// <returns>ServerMessage.</returns>
        internal static ServerMessage Compose(Achievement achievement, int targetLevel, AchievementLevel targetLevelData, int totalLevels, UserAchievement userData)
        {
            var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("AchievementProgressMessageComposer"));

            serverMessage.AppendInteger(achievement.Id);
            serverMessage.AppendInteger(targetLevel);
            serverMessage.AppendString($"{achievement.GroupName}{targetLevel}");
            serverMessage.AppendInteger(targetLevelData.Requirement);
            serverMessage.AppendInteger(targetLevelData.Requirement);
            serverMessage.AppendInteger(targetLevelData.RewardPixels);
            serverMessage.AppendInteger(0);
            serverMessage.AppendInteger(userData.Progress);
            serverMessage.AppendBool(userData.Level >= totalLevels);
            serverMessage.AppendString(achievement.Category);
            serverMessage.AppendString(string.Empty);
            serverMessage.AppendInteger(totalLevels);
            serverMessage.AppendInteger(0);

            return serverMessage;
        }
        /// <summary>
        ///     Gets the achievement levels.
        /// </summary>
        /// <param name="achievements">The achievements.</param>
        /// <param name="dbClient">The database client.</param>
        internal static void GetAchievementLevels(out Dictionary<string, Achievement> achievements,
            IQueryAdapter dbClient)
        {
            achievements = new Dictionary<string, Achievement>();
            dbClient.SetQuery("SELECT * FROM achievements_data");

            var table = dbClient.GetTable();

            foreach (DataRow dataRow in table.Rows)
            {
                var id = Convert.ToUInt32(dataRow["id"]);
                var category = (string)dataRow["category"];
                var text = (string)dataRow["group_name"];
                var level = (int)dataRow["level"];
                var rewardPixels = (int)dataRow["reward_pixels"];
                var rewardPoints = (int)dataRow["reward_points"];
                var requirement = (int)dataRow["progress_needed"];

                var level2 = new AchievementLevel(level, rewardPixels, rewardPoints, requirement);

                if (!achievements.ContainsKey(text))
                {
                    var achievement = new Achievement(id, text, category);
                    achievement.AddLevel(level2);
                    achievements.Add(text, achievement);
                }
                else
                {
                    if (!achievements[text].CheckLevel(level2))
                        achievements[text].AddLevel(level2);
                    else
                        Out.WriteLine("Was Found a Duplicated Level for: " + text + ", Level: " + level2.Level,
                            "[Azure.Achievements]", ConsoleColor.Cyan);
                }
            }
        }