drop support for usernames

Mojang has disabled their legacy skins API:
https://twitter.com/MojangSupport/status/964511258601865216

With their API rate limits, it's now practially impossible
for us to support usernames.

Fixes #142. The default parameter allows using:

- UUID
- URL
- MHF_Alex
- MHF_Steve
- Alex
- Steve

Contrary to UUIDs, using alex/steve doesn't redirect
and instead provides the skin from a locally stored file.
This commit is contained in:
jomo
2018-02-16 18:01:41 +01:00
parent a187fb26d4
commit dff58c66e7
11 changed files with 176 additions and 582 deletions

View File

@@ -4,7 +4,7 @@
<title>Crafatar A blazing fast API for Minecraft faces!</title>
<meta charset="utf-8">
<link rel="icon" sizes="16x16" type="image/png" href="/favicon.png">
<%# FIXME: Use CDN %><link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/style.css">
<meta name="description" content="A blazing fast API for Minecraft faces with support for avatars, skins, and 3D renders!">
<meta name="keywords" content="minecraft, avatar, renders, skins, uuid">
@@ -62,10 +62,9 @@
<section id="documentation">
<div id="alerts">
<div class="alert alert-danger" role="alert">
<h5>Usernames are deprecated!</h5>
You should only use usernames for <i>testing</i>.<br>
Updates are slower, some features are not available, and it may <strong>break anytime</strong>!<br>
<i>We strongly advise you to use UUIDs instead of usernames.</i> <small><a href="#meta-usernames">more info</a></small>
<h5>Usernames are no longer supported!</h5>
Please use UUIDs.
<small><a href="#meta-usernames">more info</a></small>
</div>
</div>
@@ -74,7 +73,7 @@
<form id="tryit" action="#">
<div class="row">
<div class="col-md-11">
<input id="tryname" type="text" placeholder="Enter valid username or UUID">
<input id="tryname" type="text" placeholder="Enter valid UUID">
</div>
<div class="col-md-1">
<input type="submit" value="Go!">
@@ -167,7 +166,6 @@
<section id="meta">
<h2><a href="#meta">Meta</a></h2>
<p>
In the examples above, you can generally use usernames instead of <mark class="green">uuid</mark>. However, apart from the special cases <code><a href="/renders/body/0?default=MHF_Steve" target="_blank">MHF_Steve</a></code> and <code><a href="/renders/body/0?default=MHF_Alex" target="_blank">MHF_Alex</a></code> this is discouraged as explained below.<br>
You can append <code>.png</code> or any other file extension to the URL path if you like to, but all images are PNG.
</p>
@@ -193,8 +191,8 @@
<li><b>scale</b>: The scale factor for renders. <code><%= config.renders.min_scale %> - <%= config.renders.max_scale %></code>
<li><b>overlay</b>: Apply the <span title="Also known as 'hat' or 'jacket' or 'helm'">overlay</span> to the avatar. Presence of this parameter implies <code>true</code>. This option was previously known as <code>helm</code>.
<li>
<b>default</b>: The fallback to be used when the requested image cannot be served. You can use a <span title="Make sure to properly percent-encode this!">custom URL</span> or any <mark class="green">uuid</mark>.<br>
The option defaults to either <code>MHF_Steve</code> or <code>MHF_Alex</code>, depending on the requested UUID. All usernames default to <code>MHF_Steve</code>.
<b>default</b>: The fallback to be used when the requested image cannot be served. You can use a <span title="Make sure to properly percent-encode this!">custom URL</span>, any <mark class="green">uuid</mark>, or <code>MHF_Steve</code>/<code>MHF_Alex</code>.<br>
The option defaults to either <code>MHF_Steve</code> or <code>MHF_Alex</code>, depending on Minecraft's default for the requested UUID.
</ul>
</section>
@@ -207,13 +205,9 @@
<section id="meta-usernames">
<h3><a href="#meta-usernames">About Usernames</a></h3>
<p>
We <strong>strongly</strong> advise you to use UUIDs instead of usernames! UUIDs never change while usernames do.<br>
Looking up players by username has officially been deprecated by Mojang ever since UUIDs were introduced.<br>
Crafatar uses a legacy <span title="Mojang interface we get data from">API</span> which updates very slowly to retrieve skins for usernames.<br>
Skins come without any details, including whether a player uses the Alex or Steve skin model.<br>
Additionally, Mojang has stated that this legacy interface may be disabled anytime, causing all requests to fail.
By <a href="https://twitter.com/MojangSupport/status/964511258601865216" target="_blank">disabling</a> a legacy API in 2018, Mojang has made it practically impossible for Crafatar to support usernames. Please use UUIDs instead!
</p>
<p>Malformed usernames are rejected.</p>
<p>All usernames are rejected.</p>
</section>
<section id="meta-caching">