Add Profile API.#33
Conversation
|
The implementatio of the CopyOnWriteHashmap is wrong. Its more like a fully synchronized memory wasting implementation 😁 The synchronized Blocks should only go around the copy and merge methods not on the full operation. |
|
@geNAZt but then it doesn't guarantee a consistent snapshot, since someone else could be modifying it. |
79ec0da to
fe0d994
Compare
fe0d994 to
8b130bf
Compare
|
why the synchronize on the player map... ? that should not be accessed async ever. By synchronizing it, you're adding cost to player lookup operations across the entire server. We should never ever ever ever encourage accessing main thread state (online players) async by throwing a synchronized on it. |
|
On Server, public PlayerProfile getIfOnline(String name) { These feel unnecessary. |
|
also this is a profile API, uuid is just a single detail of profiles. suggest renaming package to .profile. and cleaning up the 'uuid api' comments. |
8b130bf to
5a6d6b4
Compare
|
The cache now maintains its own map of online players, and removed all the thread safety from the NMS player map (since its hard to maintain). |
5a6d6b4 to
494148f
Compare
494148f to
21f8e6d
Compare
|
Updated to 1.9 |
|
This still uses our old package |
2335e16 to
fb1a9a0
Compare
| + | ||
| + public EventProfileLookup(ProfileLookup delegate) { | ||
| + Preconditions.checkNotNull(delegate, "Null delegate"); | ||
| + this.delegate = delegate; |
There was a problem hiding this comment.
this.delegate = Preconditions.checkNotNull(delegate, "delegate");
There was a problem hiding this comment.
@kashike That isn't a normal syntax used in the project nor necessary.
Best to leave as is. It reads cleaner as the way it currently is.
There was a problem hiding this comment.
Other parts of the project don't even use Preconditions. Use Validate, then, @Techcable.
|
|
fb1a9a0 to
152bbb5
Compare
|
@Techcable this still has a WIP tag on it. Are we at a point now where we can start doing final review? |
|
@Zbob750 oh, i forgot to edit the tile. |
|
|
I think having a services api and an event system is unnecessary complexity. |
52d3b16 to
2eef99a
Compare
|
@Techcable regardless of how much you disagree, EVERY ONE OF US agreed we want Profile a mutable API design. it was 100% agreement. So.... |
|
@aikar You mean the properties? Will that be all? |
90d4fee to
ce68d02
Compare
|
any update? |
|
I'm going to revisit this once I get time, but I think we rather go with the official Mojang GameProfile class instead. I've actually got a lot of what this PR was aiming to provide in my fork, so i'm aiming to just pull it down to Paper. |
|
Hmm, what about player's skin? |
|
Any update to this? |
|
I can't remember, does it have a way to take a profile lookup, pass it a callback but block until the lookup completes, a la Netty's ChannelPromise#sync? |
|
Closing this as I've finally pulled in my profile lookup events and other things to come. But these 2 events satisfy the root desire (ability to prefill from cached profile properties to avoid being rate limited) |
Cache uuid/name requests.
Reroute requests in NMS through the api.
Make online player profile access thread safe (not player entities).
Pluggable lookup implementation, similar to @geNAZt 's in #13 .