Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete data extraction for quest_request_items_conditional #877

Open
shamage opened this issue Aug 31, 2024 · 2 comments
Open

Incomplete data extraction for quest_request_items_conditional #877

shamage opened this issue Aug 31, 2024 · 2 comments

Comments

@shamage
Copy link

shamage commented Aug 31, 2024

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 : e8739fe

@mdX7
Copy link
Member

mdX7 commented Aug 31, 2024

packet structs in wpp are not fully updated to 11.0.2 yet

@shamage
Copy link
Author

shamage commented Nov 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants