Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

SkullMeta setOwner #127

Open
andreasdc opened this issue Jul 23, 2021 · 26 comments
Open

SkullMeta setOwner #127

andreasdc opened this issue Jul 23, 2021 · 26 comments
Assignees
Labels
bug Something isn't working

Comments

@andreasdc
Copy link

Will calling setOwner to the same name spam mojang api or will it cache in ItemStack SkullMeta?

@andreasdc
Copy link
Author

  • bug calling setOwner changes skin to alex, then to skin, when doing it again it's again alex, skin.

@Sculas
Copy link
Collaborator

Sculas commented Jul 23, 2021

@Outfluencer ?

@CyberFlameGO
Copy link
Contributor

This issue seems stale, it should be closed

@Rqver
Copy link

Rqver commented Oct 18, 2021

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.

@sadcenter
Copy link
Contributor

I'll work on that.

@sadcenter
Copy link
Contributor

Okay, actually it isn't a bug, it's just minecraft fault... It takes around 450ms to download skin texture. So slow

@Sculas
Copy link
Collaborator

Sculas commented Nov 13, 2021

Is the skin texture cached?

@sadcenter
Copy link
Contributor

sadcenter commented Nov 13, 2021

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/Electroid/mojang-api - I've heard this api is great, I'm also using this in my auth plugins.

@Sculas
Copy link
Collaborator

Sculas commented Nov 13, 2021

Spammed that API and Mojang's API a couple of times and it seems that Electroid's API is faster.

@Sculas
Copy link
Collaborator

Sculas commented Nov 13, 2021

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.

@Sculas
Copy link
Collaborator

Sculas commented Nov 13, 2021

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.

@andreasdc
Copy link
Author

You have maybe mojang api from different ips to bypass mojang's limit?

@sadcenter
Copy link
Contributor

Definetly faster, and also Electroid's api has no ratelimit.

@andreasdc
Copy link
Author

andreasdc commented Nov 13, 2021

It uses normal mojang urls, so it has 600 connections per 10 minutes, but I see it has its own url.

@sadcenter
Copy link
Contributor

There is a way to bypass rate limit.
https://github.com/Electroid/mojang-api#purpose

@Sculas Sculas added the bug Something isn't working label Nov 17, 2021
@sadcenter
Copy link
Contributor

sadcenter commented Nov 19, 2021

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

@Sculas
Copy link
Collaborator

Sculas commented Nov 19, 2021

@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.

@andreasdc
Copy link
Author

  • 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

@sadcenter
Copy link
Contributor

Okay, NVM after some tests I've concluded that parsing doesn't make a real difference here

@Sculas
Copy link
Collaborator

Sculas commented Nov 19, 2021

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.

@sadcenter
Copy link
Contributor

sadcenter commented Nov 19, 2021

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

@andreasdc
Copy link
Author

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.

@CyberFlameGO
Copy link
Contributor

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!

@andreasdc
Copy link
Author

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?

@sadcenter
Copy link
Contributor

I want to add accessibility to set online mode per player in PreLoginEvent which shouldn't be difficult

@Sculas
Copy link
Collaborator

Sculas commented Dec 17, 2021

@sadcenter Any updates? Might wanna PR this soon if possible so this issue can be closed :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants