NFT-Worlds / WRLD-Payments-API

https://www.nftworlds.com/
GNU Affero General Public License v3.0
12 stars 14 forks source link

AsyncPlayerPaidFromServerWalletEvent #25

Closed TrevorMickelson closed 2 years ago

TrevorMickelson commented 2 years ago

I ran into a situation on WorldBlocks where I need to determine if a user actually got the wrld transfer successfully. For some reason it doesn't always go through. This event would be very useful for me, so that I can add more logs, and make sure players always get their wrld, even if the plugin has an issue.

enotakin commented 2 years ago

You did it wrong, you need to first create an event and then call the callEvent() method.

At the moment, you don't get information about whether some plugin really doesn't want to display the isDefaultReceiveMessage() message, because this information will only become available after calling the callEvent() method.

It would also be smarter to make the Getter and Setter methods for the defaultReceiveMessage variable in the AsyncPlayerPaidFromServerWalletEvent class, rather than the disableDefaultReceiveMessage() method, this will be more flexible and correct.

Screenshot_3

enotakin commented 2 years ago

It would also make sense to pass information about the TransactionHash or even TransactionReceipt to the AsyncPlayerPaidFromServerWalletEvent so that other plugins can create a similar message like the WRLD-Payments-API does.

TrevorMickelson commented 2 years ago

Yea you're right, I can't believe I messed that up. On my latest commit I fixed the bug, updated the boolean to a getter and a setter, added the transaction receipt, and even through in the receiptlink as a string so that re-creating a custom message would be super easy. I also changed "Player" to "OfflinePlayer" because there are edge cases where the player won't always be online.

iamarkdev commented 2 years ago

@Jaxkr