Skip to content

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

Description

@eric2788

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions