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

Added PlayerProfile support #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

egg82
Copy link
Contributor

@egg82 egg82 commented Aug 17, 2019

Adds PlayerProfile support for Paper, and a raw Mojang API/web request of not using Paper. This is mostly used for offline players (getting correct UUIDs, etc)

Copy link
Member

@aikar aikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think it is ok as a first pass
would be good if it also had properties too, but that can come later.

but i do like it being a read only object since cant set anything with it for now.

but would like some things changed:

  1. Use interface design pattern everything else uses.
  • The goal is one could replace implementations with reflection in their own plugin if they wished, or create reflection based "plugins" to PaperLib they can ship as their own modules.
  • This allows you to change impls per version with concrete implementations
  1. implement the isComplete() and .complete(fromCache) pattern
  • network calls should only be made on Bukkit if either fromCache is false OR fromCache is true but can not be found in cache.
  • use getOfflinePlayer for cache usage if we have a UUID but don't have name
  • name to uuid might need to always be network, as name to uuid in offline player can be really slow
  1. complete should take two params, fromCache and async andd should return a CompletableFuture,

if async is true (Default for .complete() or .complete(fromCache), dispatch the network requests on an async task, then complete future back on main thread.

  • rate limit errors should reject the future.

Papers version of complete should also be done async too.

if async is false, do the network request on current thread and use CompletableFuture.completedFuture(result) or CompletableFuture.failedFuture(ex)

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.

None yet

2 participants