<commit_before>﻿using Data;
using Lang;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Tera.Game;

namespace DamageMeter.Processing
{
    internal class S_GUILD_QUEST_LIST
    {

        private static string ReplaceGuildInfo(string str, Tera.Game.Messages.S_GUILD_QUEST_LIST guildquest, DiscordInfoByGuild discordInfo)
        {
            str = str.Replace("{guild_guildname}", guildquest.GuildName);
            str = str.Replace("{guild_gold}", guildquest.Gold.ToString());
            str = str.Replace("{guild_creationtime}", guildquest.GuildCreationTime.ToString(@"yyyy-MM-dd"));
            str = str.Replace("{guild_lvl}", guildquest.GuildLevel.ToString());
            str = str.Replace("{guild_master}", guildquest.GuildMaster);
            str = str.Replace("{guild_size}", guildquest.GuildSize.ToString());
            str = str.Replace("{guild_xp_to_next_level}", (guildquest.GuildXpNextLevel - guildquest.GuildXpCurrent).ToString());
            str = str.Replace("{guild_current_xp}", guildquest.GuildXpCurrent.ToString());
            str = str.Replace("{guild_next_level_xp}", guildquest.GuildXpNextLevel.ToString());
            str = str.Replace("{guild_number_accounts}", guildquest.NumberAccount.ToString());
            str = str.Replace("{guild_number_characters}", guildquest.NumberCharacters.ToString());
            str = str.Replace("{guild_number_quest_done}", guildquest.NumberQuestsDone.ToString());
            str = str.Replace("{guild_total_number_quest}", guildquest.NumberTotalDailyQuest.ToString());
            str = str.Replace("{guild_number_quest_remaining}", (guildquest.NumberTotalDailyQuest - guildquest.NumberQuestsDone).ToString());
            str = str.Replace("{gold_label}", BasicTeraData.Instance.QuestInfoDatabase.Get(20000000));
            str = str.Replace("{xp_label}", BasicTeraData.Instance.QuestInfoDatabase.Get(20000001));

            var activeQuest = ReplaceNoQuest(discordInfo.QuestNoActiveText);
            var quests = guildquest.ActiveQuests();
            if (quests.Count > 0)
            {
                foreach (var quest in quests)
                {
                    activeQuest += ReplaceQuestInfo(discordInfo.QuestInfoText, quest, discordInfo);
                }
            }<commit_msg>Modify the multiple display active guild quest<commit_after>﻿using Data;
using Lang;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Tera.Game;

namespace DamageMeter.Processing
{
    internal class S_GUILD_QUEST_LIST
    {

        private static string ReplaceGuildInfo(string str, Tera.Game.Messages.S_GUILD_QUEST_LIST guildquest, DiscordInfoByGuild discordInfo)
        {
            str = str.Replace("{guild_guildname}", guildquest.GuildName);
            str = str.Replace("{guild_gold}", guildquest.Gold.ToString());
            str = str.Replace("{guild_creationtime}", guildquest.GuildCreationTime.ToString(@"yyyy-MM-dd"));
            str = str.Replace("{guild_lvl}", guildquest.GuildLevel.ToString());
            str = str.Replace("{guild_master}", guildquest.GuildMaster);
            str = str.Replace("{guild_size}", guildquest.GuildSize.ToString());
            str = str.Replace("{guild_xp_to_next_level}", (guildquest.GuildXpNextLevel - guildquest.GuildXpCurrent).ToString());
            str = str.Replace("{guild_current_xp}", guildquest.GuildXpCurrent.ToString());
            str = str.Replace("{guild_next_level_xp}", guildquest.GuildXpNextLevel.ToString());
            str = str.Replace("{guild_number_accounts}", guildquest.NumberAccount.ToString());
            str = str.Replace("{guild_number_characters}", guildquest.NumberCharacters.ToString());
            str = str.Replace("{guild_number_quest_done}", guildquest.NumberQuestsDone.ToString());
            str = str.Replace("{guild_total_number_quest}", guildquest.NumberTotalDailyQuest.ToString());
            str = str.Replace("{guild_number_quest_remaining}", (guildquest.NumberTotalDailyQuest - guildquest.NumberQuestsDone).ToString());
            str = str.Replace("{gold_label}", BasicTeraData.Instance.QuestInfoDatabase.Get(20000000));
            str = str.Replace("{xp_label}", BasicTeraData.Instance.QuestInfoDatabase.Get(20000001));

            var activeQuest = ReplaceNoQuest(discordInfo.QuestNoActiveText);
            var quests = guildquest.ActiveQuests();
            if (quests.Count > 0)
            {
                var activeQuests = string.Empty;
                foreach (var quest in quests)
                {
                    activeQuests += ReplaceQuestInfo(discordInfo.QuestInfoText, quest, discordInfo);
                }
                activeQuest = activeQuests;
            }
{'fraction_non_alphanumeric': 0.121529919802591, 'fraction_numerical': 0.006991568990335184, 'mean_word_length': 3.27792436235708, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7052385', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1361, 'n_words': 211}