
PlayerNameResolver has no concept of multithreading
TheE opened this issue ยท 1 comments
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 CompletableFutures
s and enforce an async implementation on the platform-level. (Sponge's GameProfileManager already works asynchronous.)
When tackling this problem a few other issues could be fixed as well:
In commands, players should be able to optionally give an UUID instead of a name (by prefixing UUIDs withDone in 91cdc14.u:
), e.g. to uninvited a player who is not known to the server. To do this we need to re-addProfile
s - but unlike the previous usage,Warp
would not store Profiles but UUIDs.- 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.
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.Done in 08cbad8.Domain
s). It might even be a good idea to haveWarp
only store individualDomain
instances and delegate saving to the Storage.