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

PlayerNameResolver has no concept of multithreading #145

Closed
TheE opened this issue Apr 15, 2017 · 1 comment
Closed

PlayerNameResolver has no concept of multithreading #145

TheE opened this issue Apr 15, 2017 · 1 comment
Assignees
Labels
c: bukkit-imp Affects the Bukkit version. c: core Affects the core. c: sponge-imp Affects the Sponge version. t: enhancement An improvement of an existing function.
Milestone

Comments

@TheE
Copy link
Member

TheE commented Apr 15, 2017

The current PlayerNameResolver has no concept of multithreading, lookups are always done in the main server-thread. This is obviously problematic.

A better alternative could be to wrap results in CompletableFuturess and enforce an async implementation on the platform-level. (Sponge's GameProfileManager already works asynchronous.)

@TheE TheE added c: bukkit-imp Affects the Bukkit version. c: core Affects the core. c: sponge-imp Affects the Sponge version. t: enhancement An improvement of an existing function. labels Apr 15, 2017
@TheE TheE added this to the 3.0 milestone Apr 15, 2017
@TheE TheE self-assigned this Apr 15, 2017
@TheE
Copy link
Member Author

TheE commented Dec 10, 2017

When tackling this problem a few other issues could be fixed as well:

  1. In commands, players should be able to optionally give an UUID instead of a name (by prefixing UUIDs with u:), e.g. to uninvited a player who is not known to the server. To do this we need to re-add Profiles - but unlike the previous usage, Warp would not store Profiles but UUIDs. Done in 91cdc14.
  2. Commands that require a name to UUID conversation need to work partially async. The implementation would wait until a UUID (or Profile) is acquired and than continue in the main thread. As of writing, the same operation results in a short block if the name is resolved from the SQLite cache on Bukkit.
  3. Maybe we can also revisit the implementation of invitations. The commands could be greatly simplified if some common structure for groups and players were introduced (e.g. Domains). It might even be a good idea to have Warp only store individual Domain instances and delegate saving to the Storage. Done in 08cbad8.

@TheE TheE closed this as completed in 1a31b67 Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bukkit-imp Affects the Bukkit version. c: core Affects the core. c: sponge-imp Affects the Sponge version. t: enhancement An improvement of an existing function.
Projects
None yet
Development

No branches or pull requests

1 participant