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

detect if user is alex or steve? #250

Closed
jredfox opened this issue Jun 16, 2018 · 12 comments
Closed

detect if user is alex or steve? #250

jredfox opened this issue Jun 16, 2018 · 12 comments

Comments

@jredfox
Copy link

jredfox commented Jun 16, 2018

detect if user is alex or steve? I used https://crafatar.com/skins/853c80ef3c3749fdaa49938b674adae6?default=MHF_Alex for a steve skin and it resulted in no 404 error.

The point of your site it for when mojang's cooldown isn't right you have to use your site the issue is the model of the player doesn't get stored anywhere and there is no model(steve/alex) section so confused.

I think you should have a json section where it tells you the user's name,uuid,model,cape everything about said player

@jomo
Copy link
Contributor

jomo commented Jun 17, 2018

The default model depends on the UUID. The function that calculates it can be found here:

crafatar/lib/skins.js

Lines 137 to 141 in 1816b18

var lsbs_even = parseInt(uuid[ 7], 16) ^
parseInt(uuid[15], 16) ^
parseInt(uuid[23], 16) ^
parseInt(uuid[31], 16);
return lsbs_even ? "mhf_alex" : "mhf_steve";

The model type of a player is stored, as can be seen here:

crafatar/lib/cache.js

Lines 73 to 74 in 1816b18

// set model type to value of *slim*
exp.set_slim = function(rid, userId, slim, callback) {

Your text isn't very accurate and I don't really understand what you're trying to say. Are you reporting a bug? In that case, please specify steps to reproduce and the expected vs. actual outcome.

@jredfox
Copy link
Author

jredfox commented Jun 17, 2018

parseInt() without showing a method and using index array rather then showing how to get that array that doesn't help me.

Also players can change their model with a skin change your telling me their uuid changes each time I think not. but, for when textures props are not filled I would like to see the actual source to get the isSteve/isAlex method from uuid

I am saying it's not throwing a 404 error when I say give me alex skin for url when alex isn't being applied to jeb therefore I have no way to know what the model is That's why I switched to mojang api even if it's annoying to get the cooldowns right because craftar doesn't tell you what the model is nor if user has a cape. There is no craftar.com/uuid.json link anywhere telling me this info so the process will be actually slower to get the info and even then I still don't know for sure what the model is for the skin

@jomo
Copy link
Contributor

jomo commented Jun 17, 2018

The default skin (Alex/Steve) is based on the UUID. The model type used by a player is returned by the Mojang API and retrieved here:

slim = Object.get(profile, "textures.SKIN.metadata.model") === "slim";

I'm still not sure what you're asking for or trying to do. Can you please specify?

@jredfox
Copy link
Author

jredfox commented Jun 17, 2018

that's if and only if they don't set their model and skin

@jomo
Copy link
Contributor

jomo commented Jun 17, 2018

I'm still not sure what you're asking for or trying to do. Can you please specify?

@jredfox
Copy link
Author

jredfox commented Jun 17, 2018

I want the entire skin data info to be cached from craftar but, your api doesn't provide enough info:
https://bugs.mojang.com/secure/attachment/133164/Skin%20Issue.png

issues:
alex isn't detectable since there is no crafatar.com/uuid.json or username.json
alex model can be set on changing skin so saying it's based on uuid is not accurate if the user has an actual skin
the only way to test if player has cape is to do the whole url connect process which takes up to a whole second rather then just having a json file per player that I can see what all the data is.

What craftar needs to become a replacement for mojang api(solution):
https://pastebin.com/Fsgd71VA

what I am trying to do is cache skin data so my mod doesn't have to fetch it each launch

@jomo
Copy link
Contributor

jomo commented Jun 17, 2018

Crafatar is an API for simple player avatars and similar things. It's not trying to be or become a replacement for the Mojang API.

However, I would accept a PR that adds the slim/classic model info as an HTTP header to the response.

@jredfox
Copy link
Author

jredfox commented Jun 17, 2018

Well maybe just suggest adding a json and doing what you said above. look at it this way you cache the data anyways right so why not allow users to just look at the cache? why? because mojangs api has a 32+ second cooldown and your site does not Mojangs api resaults in bugs if you don't have a manual tick handler to fix it and even so your steve/alex for 32 seconds to everyone on the server

@jomo
Copy link
Contributor

jomo commented Jun 17, 2018

I see. Feel free to submit a PR for something like /info/<uuid>.json that exposes our cached information (after fetching it from Mojang, if necessary).

@jredfox
Copy link
Author

jredfox commented Jun 17, 2018

in issues or where?

@jomo
Copy link
Contributor

jomo commented Jun 17, 2018

@jredfox
Copy link
Author

jredfox commented Jun 17, 2018

yeah I don't code html but,you people can

@jomo jomo closed this as completed Mar 29, 2020
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

No branches or pull requests

2 participants