JustArchiNET / ArchiSteamFarm

C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
Apache License 2.0
10.88k stars 1.04k forks source link

[Plugin API] allow plugins read-only access to ParseTradeResult.EResult #3221

Closed zypA13510 closed 3 weeks ago

zypA13510 commented 3 weeks ago

Checklist

Enhancement purpose

As of today, plugins with IBotTradeOffer interface can register their own trading logic to ASF. However, the plugin only has access to the Bot and TradeOffer objects, there is no way for the plugin to know why the trade is rejected by ASF core logic.

Solution

Upon reading the relevant code, I can see that the ShouldAcceptTrade function actually returns more information, including a reason when the trade is not accepted. I would like to propose exposing this information via the interface to plugins, so plugins can selectively override certain outcomes while leaving others untouched.

Why currently available solutions are not sufficient?

For example, if the plugin would like to respect the FilterBadBots global config and give it priority, there is no way to do so without re-implementing the entire blacklisting logic.

Can you help us with this enhancement idea?

Yes, I can code the solution myself and send a pull request

Additional info

No response

JustArchi commented 3 weeks ago

Very good idea, I don't have anything against, thanks for suggesting it :trophy: - use new IBotTradeOffer2 interface instead, which replaces the functionality of the previous one :slightly_smiling_face:

I've marked V6.0.4.1 with release of this.