Skip to content

[fix] AH Announcements, AH timer issue#7540

Merged
Xaver-DaRed merged 1 commit intoLandSandBoat:basefrom
sruon:ah_announcements
May 11, 2025
Merged

[fix] AH Announcements, AH timer issue#7540
Xaver-DaRed merged 1 commit intoLandSandBoat:basefrom
sruon:ah_announcements

Conversation

@sruon
Copy link
Copy Markdown
Contributor

@sruon sruon commented May 8, 2025

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

2 for 1

  • Reworks ah_announcement module to defer the bulk of the logic to auctionutils, so it stops breaking every other day. Closes 🐛 AH announcements module not letting purchases proceed #7485

    • auctionutils::PurchasingItems returns a boolean, indicating if a sale went through
  • Fixes the check for user throttling when they check list of sales, as it is currently defaulting to the "Try again later" state

    • Since m_AHHistoryTimestamp is initialized to timer::time_point::min() (min value of a long long), the existing check no longer works.

Screenshot 2025-05-07 185929

Steps to test these changes

Without modules enabled:

  • Open Auction House
  • Check Sales Status
  • Ensure items for sale show up
  • Try again during the 5s cooldown, ensure "Please try again" shows up
  • Ensure items can be listed and purchased

With modules enabled:

  • Ensure pagination on Sales Status works, along with the 1.5s cooldown
  • Ensure a message is received when purchasing one of your own item

@cocosolos
Copy link
Copy Markdown
Contributor

cocosolos commented May 8, 2025

Oh good catch. Could also use std::chrono::abs() I think. Intuitively -5s duration is still a 5s duration but I guess you need to explicitly check that.

Edit: or curTick > PChar->m_AHHistoryTimestamp + 5s should work too. I looked over the rest of the uses of time_point::min() and it looks like everything else should be okay.

@sruon sruon force-pushed the ah_announcements branch from 1a15449 to f964171 Compare May 8, 2025 05:30
@sruon
Copy link
Copy Markdown
Contributor Author

sruon commented May 8, 2025

Made the change based on your recommendation since that's easier to read and understand.

@Xaver-DaRed Xaver-DaRed merged commit aa38a6a into LandSandBoat:base May 11, 2025
13 checks passed
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

Successfully merging this pull request may close these issues.

🐛 AH announcements module not letting purchases proceed

4 participants