Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.yml doesn't show AsynchonrousActions property and the allowAsync will run on main thread if true. #119

Open
eric2788 opened this issue May 8, 2022 · 0 comments

Comments

@eric2788
Copy link

eric2788 commented May 8, 2022

I have a points plugin that needs to do asynchronously, so I decide to look into the points plugin and set config.yml AsynchronrousActions: true, but I didn't find that property so I decided to do it manually with code (which by setting setPurchaseAsyncEnabled(true)). However, the giveReward is running on the main thread, I checked the source code of BossShopPro and I found that allowAsync is returning true on BSRewardTypePoints

image

which seems no problem at all because the points plugin should allow running asynchronously.

but in the method purchase from BSBuy class, when purchase async is enabled, using allowAsync with true will force it to run on the main thread.......

image

So allowAsync will run on the main thread......and there are some RewardTypes that may need to run asynchronously like BSRewardTypePoints are returning true, while some RewardTypes which definitely not allowed to run async like permission and command are setting allowAsync to false, it caused a big problem like allowing purchase async will cause them to dispatch:

image

I think it should be just a logic problem mistake, I already created a temporary solution but I hope it can fix it on the next update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant