Voxel-Fox-Ltd / Flower

A Discord bot for growing virtual flowers in a virtual garden.
GNU General Public License v2.0
16 stars 12 forks source link

Fix for trading watered plants #10

Closed FailSpy closed 3 years ago

FailSpy commented 3 years ago

Found an exploit where you can trade watered plants back and forth to water them faster than you should be able to, as it always resets the 'last watered time' such that you can water it again immediately.

This is pretty tedious ultimately, but for those sufficiently motivated it can "incentivize" lots and lots of unnecessary usage for your bot.

As an alternative to this I've made a change that checks if the plant being traded has been watered within the cooldown period -- if so, keep that plant's timestamp. Otherwise, refresh it to just after the cooldown period so the receiving user can water immediately or leave it comfortably.

FailSpy commented 3 years ago

I was trying to think of an alternative to this, such as the 'last water time' being kept to the player, rather than the plant.

Example:

A offers a watered plant to B B trades an unwatered plant with A

A then receives a watered plant (as the one they offered was watered) B receives an unwatered plant (as the one they offered was unwatered)

This is a nice solution IMO, but it does come with the issue, because of multiple pots, that you can then 'cycle' your plants.

A trades a watered high value plant of theirs for some plant of B's. A then trades an unwatered low value plant for their high value plant back, causing the more valuable plant to become unwatered again.

This is of course an extremely tedious process, but just something to keep in mind. It's tedious enough it could absolutely be overlooked if the first example's model is more interesting.

4Kaylum commented 3 years ago

It's really wild to me that people go through the effort to find these sorts of exploits. Thank you very much for the PR. Love it.