-
Notifications
You must be signed in to change notification settings - Fork 87
Conversation
…ize, Code clean-up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! This is just a brief review, I'll do a full review and test when I can. Also you should try to not edit the formatting of the files, I see that there's a lot of files with just formatting changes.
NachoSpigot-Server/src/main/java/me/elier/nachospigot/config/NachoConfig.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/net/minecraft/server/DedicatedServer.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/net/minecraft/server/ItemSkull.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/net/minecraft/server/MinecraftServer.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/net/minecraft/server/MinecraftServer.java
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/net/minecraft/server/TileEntitySkull.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/net/minecraft/server/TileEntitySkull.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
Outdated
Show resolved
Hide resolved
its not a good idea to use private apis in this project |
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/utils/ProfileUtil.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/NachoAuthenticatorService.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/utils/HashMapBuilder.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/session/NachoSessionService.java
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/session/NachoSessionService.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/storage/ProfileCache.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/storage/ProfileCache.java
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/storage/ProfileCache.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/session/NachoSessionService.java
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/session/NachoSessionService.java
Outdated
Show resolved
Hide resolved
I personally trust this API. I haven't ever met with a situation when this API is down (I'm using this in every project that needs data from Mojang). But not everyone has to trust it, that's why I added an option in the configuration to disable that. |
I think it would be good to automatically switch to Mojang's API if any exception is caught with ashcon API |
The API seems open source (as declared on the issue init message) and claims to be hosted on Cloudflare Workers |
Oh also the person running and maintaining the API works at Cloudflare |
NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/NachoAuthenticationService.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/me/elier/nachospigot/config/NachoConfig.java
Outdated
Show resolved
Hide resolved
NachoSpigot-Server/src/main/java/me/elier/nachospigot/config/NachoConfig.java
Outdated
Show resolved
Hide resolved
public static boolean alwaysUseMojang; | ||
|
||
private static void alwaysUseMojang() { | ||
alwaysUseMojang = getBoolean("settings.authenticator.always-use-mojang", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo this should be inverted and be use-ashcon-api
Looks good! Awesome PR :) |
…ize, Code clean-up
# Conflicts: # NachoSpigot-API/pom.xml # NachoSpigot-Server/pom.xml # NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/NachoAuthenticationService.java # NachoSpigot-Server/src/main/java/com/github/sadcenter/auth/profile/NachoGameProfileRepository.java # NachoSpigot-Server/src/main/java/me/elier/nachospigot/config/NachoConfig.java
oops Intelij IDEA kinda messed up I believe |
Rebasing on master should partially fix it |
backups = getBoolean("settings.authenticator.backups", true); | ||
uuidMojangPriority = getString("settings.authenticator.uuid-priority", "ashcon") | ||
.equalsIgnoreCase("ashcon"); | ||
texturesMojangPriority = getString("settings.authenticator.textures-priority", "mojang") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use integers booleans to specify the api
Is this PR stale or not? |
is #353 related to this? |
it might fix it, but it's unlikely possible since authlib wasn't touched in nacho |
yea, I will resolve the conflicts tomorrow (if tram won't hit me or smth) |
CodeQL uses Java 11 where |
Description
Changes auth implementation from yggdrasil one to mine one. (toggleable in configuration)
It uses https://github.com/Electroid/mojang-api and caches the player's texture to the file.
Fixes/Adds #127 (Not completely due it's impossible, more info in
Additional comments
section.)How has this been tested?
Tested by generating skulls and toggling
online-mode
Additional Comments
It's impossible to remove the delay completely in async action (sync would be even worse). However, we can try to reduce the delay by using better API, cache, etc.
Default cache time is 1 day.
If there's something wrong with changes, let me know.
Checklist: