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

Update for Folia and add * wild card forwarder #33

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

AustinGoodrich
Copy link

Summary of your change

This will add support for Folia (Paper Fork by PaperMC).

I also added a wildcard for a playername. This will also allow you to mass run forward commands, helpful for moving people to the lobby. Example: /forward * server lobby

Related issue

  • Unspported on Folia

@games647
Copy link
Owner

games647 commented Jun 25, 2024

The question is if that code is thread-safe for the multi-threading in Folia. We cannot mark it as compatible if we didn't check it.I assume it could be compatible, because command processing and the events should be on the same thread. Do you already checked this behavior?

@AustinGoodrich
Copy link
Author

I have checked this behavior and haven't found any issues. I'm currently using my fork on my server just fine across 53 different regions. The good thing is players can't be in the same place twice.

@games647
Copy link
Owner

The issue with multi-threading is that that it is hard to reproduce an error and it could be very rare. Nevertheless, CommandForward is only operating on commands. Therefore, it should only operate on the Global region task queue ref and access only data owned by it. I see potential issues with the thread-safety of:

hasPermission - However unlikely to be regionized, because typical use case in command handling

return player != null && (!(player instanceof Player) || player.hasPermission(this.permission));

Bukkit.getOnlinePlayers(), because that could be regionized

Bukkit.getOnlinePlayers().stream().findAny().ifPresent(messageSender -> {

@games647 games647 merged commit 16f503a into games647:main Jun 30, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants