Open andreasdc opened 3 years ago
@Outfluencer ?
This issue seems stale, it should be closed
I can confirm that using setOwner changes the skin of the head to an alex, then to the correct skin. The alex stays around for 1-2 seconds before updating.
I'll work on that.
Okay, actually it isn't a bug, it's just minecraft fault... It takes around 450ms to download skin texture. So slow
Is the skin texture cached?
Yea it is, but sometimes there is no player in cache and the server has to download texture. When the skin is alex the server is downloading actual skin.
I was thinking about changing GameProfileRepository
in MinecraftServer
due it's responsible for this stuff. I believe this change would also bring better performance.
https://github.com/CobbleSword/NachoSpigot/blob/ebf0841bee5ccf847d0b2dd8d18ec10be6afced8/NachoSpigot-Server/src/main/java/net/minecraft/server/MinecraftServer.java#L133
https://github.com/Electroid/mojang-api - I've heard this api is great, I'm also using this in my auth plugins.
Spammed that API and Mojang's API a couple of times and it seems that Electroid's API is faster.
So if you want, feel free to PR that. But keep in mind to keep the old logic for Minecraft's session server in case Electroid's API breaks. We need a fallback in the case that such a thing happens.
So just do a try-catch, and if that fails send a request to Mojang's API and continue from there. Make sure to log an error for that in the console so we can check what's wrong.
You have maybe mojang api from different ips to bypass mojang's limit?
Definetly faster, and also Electroid's api has no ratelimit.
It uses normal mojang urls, so it has 600 connections per 10 minutes, but I see it has its own url.
There is a way to bypass rate limit. https://github.com/Electroid/mojang-api#purpose
I think I've done that. It's nearly(or fully?) impossible to make heads load instantly, we would have to make heads sync what would make this even worse, imagine for example 200 heads loading at once and a player has to wait while heads are loading. I made an async implementation of authlib which uses file caching that speeds up the process. (preview https://github.com/sadcenter/NachoSpigot/tree/auth/NachoSpigot-Server/src/main/java/com/github/sadcenter/auth) I'm currently using ashcon api to read textures, the only downside is providing too much data (more data -> it takes more time to deserialize JSON by GSON -> late response). @andreasdc already has suggested to the owner a function to exclude parameters that are not wanted (Electroid/mojang-api#48). I'm almost sure I'll post PR tomorrow. BTW: It's not a bug
@sadcenter Since there's not a lot of data, you could also just go through each line and find the right one and parse it yourself.
- bug calling setOwner changes skin to alex, then to skin, when doing it again it's again alex, skin.
This was the bug @sadcenter I think
Okay, NVM after some tests I've concluded that parsing doesn't make a real difference here
Also, if possible, make sure to cache it. And check if the player is online, if so grab their skin since when they're online it should be held in memory so you don't need to send a unnecessary http request.
It's already in the code BTW: What do you guys think about making accessibility to turn online/offline mode per player, like in bungeecord? This will allow developers to make premium authentication plugins like FastLogin, JPremium, mineLogin on Spigot, currently, this is only available on proxies, etc. IMO Nice feature
It's already in the code BTW: What do you guys think about making accessibility to turn online/offline mode per player, like in bungeecord? This will allow developers to make premium authentication plugins like FastLogin, JPremium, mineLogin on Spigot, currently, this is only available on proxies, etc. IMO Nice feature
IMO there are cooler things and optimizations that should be created in Nacho first.
It's already in the code
BTW: What do you guys think about making accessibility to turn online/offline mode per player, like in bungeecord? This will allow developers to make premium authentication plugins like FastLogin, JPremium, mineLogin on Spigot, currently, this is only available on proxies, etc.
IMO Nice feature
I always thought it was like servers in the sense that servers can only be offline or online, unless you mean separate proxies (or unless I'm just oblivious to that knowledge). Cool idea, but as @andreasdc said there's other stuff the project is focusing on. If you wanna contribute something like that I'd love to see that on this project, though!
It's already in the code BTW: What do you guys think about making accessibility to turn online/offline mode per player, like in bungeecord? This will allow developers to make premium authentication plugins like FastLogin, JPremium, mineLogin on Spigot, currently, this is only available on proxies, etc. IMO Nice feature
I always thought it was like servers in the sense that servers can only be offline or online, unless you mean separate proxies (or unless I'm just oblivious to that knowledge). Cool idea, but as @andreasdc said there's other stuff the project is focusing on. If you wanna contribute something like that I'd love to see that on this project, though!
I think @sadcenter wants to do auth plugin to check premium users on spigot, but I think it's better to look into getCubes, movement, double interactions, packet sending and many other cool optimizations that can be done in Nacho, we are fork of Taco, good fork of Paper, right?
I want to add accessibility to set online mode per player in PreLoginEvent
which shouldn't be difficult
@sadcenter Any updates? Might wanna PR this soon if possible so this issue can be closed :)
Will calling setOwner to the same name spam mojang api or will it cache in ItemStack SkullMeta?