Jump to content

bugs

Pending 2.1.4

Johnnathan Wick
Johnnathan Wick

Posted

Hello! First of all, thank you for the great plugin. I'm using it on an active server, but we are currently experiencing a massive console spam issue related to the Buy/Sell Offers UI, which is causing performance drops.

Here is the exact error spamming our console:

Plaintext

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

And the Oxide debug log points directly to this method:

Plaintext

Failed to call hook 'ShoppyStockConsoleCommand' on plugin 'ShoppyStock v2.1.4' (IndexOutOfRangeException: Index was outside the bounds of the array.) at Oxide.Plugins.ShoppyStock.UpdateBuySellOfferDetailsUI (BasePlayer player, System.Int32 newIndex) [0x00236] at Oxide.Plugins.ShoppyStock.ShoppyStockConsoleCommand (ConsoleSystem+Arg arg)

Context: This seems to trigger when players are interacting with the stock market UI (specifically checking buy/sell offer details). It looks like newIndex is falling out of bounds—possibly when an offer is purchased/removed while someone else is viewing it, or if they click through the UI too quickly.

Could you please add a quick bounds check (e.g., if (newIndex < 0 || newIndex >= list.Count) return;) inside the UpdateBuySellOfferDetailsUI method in the next update to prevent this error loop?

Thanks for your time and for the awesome work!

ThePitereq

Posted

8 hours ago, Johnnathan Wick said:

Hello! First of all, thank you for the great plugin. I'm using it on an active server, but we are currently experiencing a massive console spam issue related to the Buy/Sell Offers UI, which is causing performance drops.

Here is the exact error spamming our console:

Plaintext

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

And the Oxide debug log points directly to this method:

Plaintext

Failed to call hook 'ShoppyStockConsoleCommand' on plugin 'ShoppyStock v2.1.4' (IndexOutOfRangeException: Index was outside the bounds of the array.) at Oxide.Plugins.ShoppyStock.UpdateBuySellOfferDetailsUI (BasePlayer player, System.Int32 newIndex) [0x00236] at Oxide.Plugins.ShoppyStock.ShoppyStockConsoleCommand (ConsoleSystem+Arg arg)

Context: This seems to trigger when players are interacting with the stock market UI (specifically checking buy/sell offer details). It looks like newIndex is falling out of bounds—possibly when an offer is purchased/removed while someone else is viewing it, or if they click through the UI too quickly.

Could you please add a quick bounds check (e.g., if (newIndex < 0 || newIndex >= list.Count) return;) inside the UpdateBuySellOfferDetailsUI method in the next update to prevent this error loop?

Thanks for your time and for the awesome work!

Hey. Thanks for the report but preventing from error won't find an existing issue of why it happened.
Can you please share with me your configuration and all the data files related to the stock market where the problem happened. Also on which item listing does problem appears?

Johnnathan Wick

Posted

Thank you for getting back to me so quickly. You are absolutely right, finding the root cause is much better.

I have attached my configuration file and the data files as requested.

Regarding the item listings and when it happens: I've been analyzing my server logs and I noticed a clear pattern. The error triggers when players are interacting with the UI very quickly, specifically right after an offer is fully purchased or removed.

For example, looking at my console logs:

A player is viewing a specific buy/sell offer (e.g., battery.small or a custom item like sticks with skin 3718987801).

The player clicks purchase (stock buySellOffer purchase), and the transaction completes successfully (the offer is fulfilled and removed from the active list).

Immediately after (in the exact same second), the player keeps spamming/clicking UI buttons like increase, decrease, or typing an amount (stock buySellOffer setItemAmount ...).

The server then throws the IndexOutOfRangeException at UpdateBuySellOfferDetailsUI because the UI hasn't refreshed fast enough and is trying to access the index of the offer that no longer exists in the collection.

It happens across multiple different items, not just one specific listing. It's essentially a UI desync when players spam clicks on the menu while buying/selling.

I've attached the files. Let me know if you need any more logs or tests from my side! Thanks again for the great support.

BraZ.json

Johnnathan Wick

Posted

10 hours ago, Johnnathan Wick said:

Thank you for getting back to me so quickly. You are absolutely right, finding the root cause is much better.

I have attached my configuration file and the data files as requested.

Regarding the item listings and when it happens: I've been analyzing my server logs and I noticed a clear pattern. The error triggers when players are interacting with the UI very quickly, specifically right after an offer is fully purchased or removed.

For example, looking at my console logs:

A player is viewing a specific buy/sell offer (e.g., battery.small or a custom item like sticks with skin 3718987801).

The player clicks purchase (stock buySellOffer purchase), and the transaction completes successfully (the offer is fulfilled and removed from the active list).

Immediately after (in the exact same second), the player keeps spamming/clicking UI buttons like increase, decrease, or typing an amount (stock buySellOffer setItemAmount ...).

The server then throws the IndexOutOfRangeException at UpdateBuySellOfferDetailsUI because the UI hasn't refreshed fast enough and is trying to access the index of the offer that no longer exists in the collection.

It happens across multiple different items, not just one specific listing. It's essentially a UI desync when players spam clicks on the menu while buying/selling.

I've attached the files. Let me know if you need any more logs or tests from my side! Thanks again for the great support.

BraZ.json 36.65 kB · 0 downloads

 

ShoppyStock.json BraZ.json

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.5m
Total downloads
Customers
11.1k
Customers served
Files Sold
159.2k
Marketplace sales
Payments
3.4m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.