WowPacketParser icon indicating copy to clipboard operation
WowPacketParser copied to clipboard

Incomplete data extraction for `quest_request_items_conditional`

Open shamage opened this issue 1 year ago • 2 comments

Incomplete extraction of data for quest_request_items_conditional regardless of whether it is a numeric value or text itself ( see printscreen ) Ashampoo_Snap_sobota 31  augusta 2024_13h6m41s

for Build : e8739fece46da439fdaa5ffa0f8b63902fb3bd09

shamage avatar Aug 31 '24 11:08 shamage

packet structs in wpp are not fully updated to 11.0.2 yet

mdX7 avatar Aug 31 '24 12:08 mdX7

I tested a minor code modification for this output .

In this modification:

  1. Verification of the QuestId value: We ensure that the QuestId is not zero.
  2. Validation of the PlayerConditionId value: We ensure that the PlayerConditionId is not negative and not too large.
  3. Text verification: We will ensure that the text is not empty or incomplete. This modification should ensure that only valid and complete records will be processed and stored in the database.

However, with this modification I ensured that the output was no longer any. It is possible that I completely messed up the output settings or tightened them too much.

[BuilderMethod]
public static string QuestRequestItemsConditional()
{
    if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.quest_template))
        return string.Empty;

    if (Storage.QuestRequestItemsConditional.IsEmpty())
        return string.Empty;

    var validItems = new List<QuestRequestItemsConditional>();

    foreach (var item in Storage.QuestRequestItemsConditional)
    {
        // Verify that QuestId is not null
        if (item.Item1.QuestId == 0)
            continue;

        // Verify that PlayerConditionId is not negative and not too large
        if (item.Item1.PlayerConditionId < 0 || item.Item1.PlayerConditionId > int.MaxValue)
            continue;

        // Verification that the text is not empty or incomplete
        if (string.IsNullOrEmpty(item.Item1.Text) || item.Item1.Text.Length < 10) // Adjust the length check as needed
            continue;

        validItems.Add(item.Item1);
    }

    if (validItems.Count == 0)
        return string.Empty;

    var templatesDb = SQLDatabase.Get<QuestRequestItemsConditional>((IEnumerable<System.Tuple<QuestRequestItemsConditional, System.TimeSpan?>>)validItems);

    return SQLUtil.Compare((IEnumerable<System.Tuple<QuestRequestItemsConditional, System.TimeSpan?>>)validItems, templatesDb, StoreNameType.Quest);
}

  • All that's left is to wait for @mdX7 to solve it.

shamage avatar Nov 23 '24 22:11 shamage