Fix deposit over-estimation and extract constants for clarity - #7
Fix deposit over-estimation and extract constants for clarity#7ayanimea wants to merge 8 commits into
Conversation
Agent-Logs-Url: https://github.com/ayanimea/Auctionator-3.3.5-Fixed/sessions/80f95e9e-165a-4909-8a20-03796d1565c2 Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
…larity Agent-Logs-Url: https://github.com/ayanimea/Auctionator-3.3.5-Fixed/sessions/80f95e9e-165a-4909-8a20-03796d1565c2 Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates Auctionator’s sell-pane deposit display logic and adjusts the full auction house scan timeout to better support slower/unresponsive WoW 3.3.5 servers.
Changes:
- Increase full scan hard-stop timeout from 20 seconds to 20 minutes and update the stop-reason message.
- Rework the deposit shown in the sell UI to compute from vendor sell price, stack size, and duration; extract related constants for clarity.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Auctionator/AuctionatorScan.lua |
Extends full-scan timeout to reduce premature termination on slow servers. |
Auctionator/Auctionator.lua |
Changes deposit calculation to use vendor sell price + duration multiplier; adds local constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| local vendorPrice = auctionLink and (select(ITEM_INFO_VENDOR_PRICE_INDEX, GetItemInfo(auctionLink)) or 0) or 0; | ||
| local durationFactor = ({[1] = 1, [2] = 2, [3] = 4})[duration] or 1; | ||
| local deposit = math.max(1, math.floor(vendorPrice * Atr_StackSize() * DEPOSIT_RATE * durationFactor)); | ||
|
|
| local durationFactor = ({[1] = 1, [2] = 2, [3] = 4})[duration] or 1; | ||
| local deposit = math.max(1, math.floor(vendorPrice * Atr_StackSize() * DEPOSIT_RATE * durationFactor)); |
|
@copilot apply changes based on the comments in this thread |
…dule constant Agent-Logs-Url: https://github.com/ayanimea/Auctionator-3.3.5-Fixed/sessions/9a4e0151-7285-41a4-aadd-b09eaeafbd81 Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
Both review comments addressed in aa23315:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Standard WoW 3.3.5 AH deposit rate: 5% of vendor sell price per item per 12-hour period. | ||
| local DEPOSIT_RATE = 0.05; | ||
| -- Duration multipliers for AH deposit (12 h = 1×, 24 h = 2×, 48 h = 4×). | ||
| -- Declared as a module-level constant so it is not re-allocated on every UI tick. | ||
| local DEPOSIT_DURATION_FACTOR = {[1] = 1, [2] = 2, [3] = 4}; |
| -- Hard stop after 20 minutes to avoid hanging on unresponsive servers | ||
| if (not gAtr_FullScanTimedOut and (time() - gAtr_FullScanStart) > 20 * 60) then | ||
| gAtr_FullScanTimedOut = true; | ||
| gAtr_FullScanStopReason = "Stopped after 20s: server did not return all auctions"; | ||
| gAtr_FullScanStopReason = "Stopped after 20 minutes: server did not return all auctions"; |
|
@copilot apply changes based on the comments in this thread |
…UT_SECONDS constant Agent-Logs-Url: https://github.com/ayanimea/Auctionator-3.3.5-Fixed/sessions/16aff152-934a-4d2e-97c6-e4e0cdd04aec Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
Both comments addressed in 1e77cb6:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Hard stop after FULL_SCAN_TIMEOUT_SECONDS to avoid hanging on unresponsive servers | ||
| if (not gAtr_FullScanTimedOut and (time() - gAtr_FullScanStart) > FULL_SCAN_TIMEOUT_SECONDS) then | ||
| gAtr_FullScanTimedOut = true; | ||
| gAtr_FullScanStopReason = "Stopped after 20s: server did not return all auctions"; | ||
| gAtr_FullScanStopReason = string.format("Stopped after %d minutes: server did not return all auctions", FULL_SCAN_TIMEOUT_SECONDS / 60); |
| -- Derive the per-item 12-h deposit from the game engine so that the correct rate | ||
| -- is used automatically for both faction AH (15%) and neutral AH (75%). | ||
| -- Dividing CalculateAuctionDeposit(1) by slotCount and then multiplying by | ||
| -- Atr_StackSize() re-scales to the user's chosen stack, working around the | ||
| -- "count=1 bug" reported by GetAuctionSellItemInfo on some 3.3.5 private servers. | ||
| local itemsInSlot = math.max(auctionCount, 1); | ||
| local deposit12h = CalculateAuctionDeposit(1); | ||
| local durationFactor = DEPOSIT_DURATION_FACTOR[duration] or 1; |
| local itemsInSlot = math.max(auctionCount, 1); | ||
| local deposit12h = CalculateAuctionDeposit(1); | ||
| local durationFactor = DEPOSIT_DURATION_FACTOR[duration] or 1; | ||
| local deposit = math.max(1, math.floor((deposit12h / itemsInSlot) * Atr_StackSize() * durationFactor)); |
|
@copilot apply changes based on the comments in this thread |
… comment Agent-Logs-Url: https://github.com/ayanimea/Auctionator-3.3.5-Fixed/sessions/af5f5974-5373-416c-b3ff-ebf31b572943 Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
All three addressed in afb5727:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Ask the game engine for the 12-h deposit cost for whatever is in the sell slot. | ||
| -- Dividing by itemsInSlot and multiplying by Atr_StackSize() re-scales to the | ||
| -- user's chosen stack, working around the "count=1 bug" reported by | ||
| -- GetAuctionSellItemInfo on some 3.3.5 private servers. | ||
| local itemsInSlot = math.max(auctionCount, 1); | ||
| local deposit12h = CalculateAuctionDeposit(1); | ||
| local durationFactor = DEPOSIT_DURATION_FACTOR[duration] or 1; | ||
| local deposit = math.max(1, zc.round((deposit12h / itemsInSlot) * Atr_StackSize() * durationFactor)); |
|
@copilot apply changes based on the comments in this thread |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Atr_GetSellValue returns 0 when item info is not yet cached; in that case | ||
| -- we clear the field rather than showing a misleading value. | ||
| local vendorPrice = Atr_GetSellValue(auctionLink); | ||
| if (vendorPrice == 0) then | ||
| Atr_Deposit_Text:SetText(""); | ||
| return; | ||
| end | ||
|
|
||
| local durationFactor = DEPOSIT_DURATION_FACTOR[duration] or 1; | ||
| local deposit = math.max(1, zc.round(vendorPrice * DEPOSIT_RATE * Atr_StackSize() * durationFactor)); |
| -- Standard WoW 3.3.5 faction AH deposit rate per 12 hours. | ||
| local DEPOSIT_RATE = 0.15; | ||
|
|
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/ayanimea/Auctionator-3.3.5-Fixed/sessions/b7e3385f-2118-4795-a39c-c4f28b2e99aa Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
Both addressed in 1cbeb89:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Standard WoW 3.3.5 faction AH deposit rate per 12 hours. | ||
| local DEPOSIT_RATE = 0.15; | ||
|
|
| -- Hard-stop timeout for a full AH scan. Both the comparison and the user-facing | ||
| -- message are derived from these constants to keep them in sync. | ||
| local FULL_SCAN_TIMEOUT_SECONDS = 20 * 60; | ||
| local FULL_SCAN_TIMEOUT_MINUTES = math.floor(FULL_SCAN_TIMEOUT_SECONDS / 60); |
| if (not gAtr_FullScanTimedOut and (time() - gAtr_FullScanStart) > FULL_SCAN_TIMEOUT_SECONDS) then | ||
| gAtr_FullScanTimedOut = true; | ||
| gAtr_FullScanStopReason = "Stopped after 20s: server did not return all auctions"; | ||
| gAtr_FullScanStopReason = string.format("Stopped after %d minutes: server did not return all auctions", FULL_SCAN_TIMEOUT_MINUTES); |
|
@copilot apply changes based on the comments in this thread |
…lural handling Agent-Logs-Url: https://github.com/ayanimea/Auctionator-3.3.5-Fixed/sessions/478d0c28-d4bd-4240-b846-51710ad408be Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
All three addressed in e9b590f:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Standard WoW 3.3.5 faction AH deposit rate per 12 hours. | ||
| local DEPOSIT_RATE = 0.15; |
|
@copilot apply changes based on the comments in this thread |
The PR description has been updated — the "standard 5% rate per 12 hours" wording is now corrected to "15% deposit rate per 12 hours", matching |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Standard WoW 3.3.5 faction AH deposit rate per 12 hours. | ||
| local DEPOSIT_RATE = 0.15; | ||
|
|
|
@copilot apply changes based on the comments in this thread |
The PR description has been updated to remove the stale "5% rate" wording and now accurately states the 15% faction AH deposit rate, matching |
This pull request addresses two main issues in the Auctionator addon: it corrects the calculation of auction deposit costs to be more accurate for WoW 3.3.5 servers, and it extends the timeout for full auction house scans to better accommodate slower or unresponsive servers.
Deposit calculation improvements:
Auction scan timeout adjustment: