JustArchiNET / ArchiSteamFarm

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

Add ability to set trade offer message #3262

Closed dm1tz closed 1 month ago

dm1tz commented 1 month ago

Checklist

Changes

New functionality

Adds the ability to set a custom message when sending an offer.

Additional info

This is particularly useful for third-party plugins that implement custom trading logic, as a message can convey useful information and/or help users differentiate offers created by ASF from those created by plugins.

Abrynos commented 1 month ago

I would prefer this to be IN ADDITION to the information already contained and not instead of it.

Abrynos commented 1 month ago

Now that I think of it, I personally also would like for ASF to include information about the calling assembly (in case it differs from ASF and official plugins).

nolddor commented 1 month ago

What if provided message is larger than the max. chars (128) a trade offer message can handle?

I'm still unsure if it is safe to allow 3rd party plugins to override the message,.. would be better to append I guess.

dm1tz commented 1 month ago

What if provided message is larger than the max. chars (128) a trade offer message can handle?

  • Does it truncate the message with no error / warnings? <-- This is how web trade window works at least.
  • Does it fail to send and we get an clear error message?

Good point, we could preemptively truncate the message if it exceeds the limit.

I'm still unsure if it is safe to allow 3rd party plugins to override the message,.. would be better to append I guess.

Could you please elaborate? I'd argue that overriding the standard message is a more flexible approach, and given that the default message (e.g. Sent by ArchiSteamFarm-modded/6.0.4.4) is already 37 characters, it would consume space for a custom one.

Besides, nothing is stopping you from re-implementing SendTradeOffer and directly overriding the original message in a plugin.

JustArchi commented 1 month ago

I don't see any added value other than abuse potential in replacing the message, not like I care much about it, but trade offer message isn't a place for putting arbitrary info.

We can totally append extra informaton though, so with current code I've committed above you have approx 80 characters for adding anything you deem important, which should be enough for an identifier, link, or even some kind of hash or summary.

Should be sufficient for any legit use cases this PR aimed for, while not disrupting ASF's way of doing things by being transparent in everything it's doing.