2
0
Эх сурвалжийг харах

mhf_alex should default to mhf_alex if skin not accessible

We only use the 'hard stored' mhf_alex skin when it's part of the 'default' query parameter.
In the rare event that mhf_alex is requested but the skin is not accessible, we would fall back to 'mhf_steve' because it's the default for usernames.
This commit adds the special case to use the stored version of the 'mhf_alex' skin when it's not accessible otherwise
jomo 9 жил өмнө
parent
commit
8367c1e519
1 өөрчлөгдсөн 6 нэмэгдсэн , 2 устгасан
  1. 6 2
      lib/skins.js

+ 6 - 2
lib/skins.js

@@ -104,8 +104,12 @@ exp.resize_img = function(inname, size, callback) {
 // returns "mhf_alex" or "mhf_steve" calculated by the +uuid+
 exp.default_skin = function(uuid) {
   if (uuid.length <= 16) {
-    // we can't get the skin type by username
-    return "mhf_steve";
+    if (uuid.toLowerCase() === "mhf_alex") {
+      return uuid;
+    } else {
+      // we can't get the skin type by username
+      return "mhf_steve";
+    }
   } else {
     // great thanks to Minecrell for research into Minecraft and Java's UUID hashing!
     // https://git.io/xJpV