mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
use MHF_Steve and MHF_Alex instead of steve and alex in default parameter
See #142 (not fixed by this commit!) Basically, this just adds mhf_steve and mhf_alex as special cases for the default parameter only
This commit is contained in:
@@ -7,7 +7,7 @@ var url = require("url");
|
||||
|
||||
function handle_default(img_status, userId, size, def, req, err, callback) {
|
||||
def = def || skins.default_skin(userId);
|
||||
if (def !== "steve" && def !== "alex") {
|
||||
if (def !== "steve" && def !== "mhf_steve" && def !== "alex" && def !== "mhf_alex") {
|
||||
if (helpers.id_valid(def)) {
|
||||
// clean up the old URL to match new image
|
||||
var parsed = req.url;
|
||||
@@ -29,6 +29,9 @@ function handle_default(img_status, userId, size, def, req, err, callback) {
|
||||
}
|
||||
} else {
|
||||
// handle steve and alex
|
||||
if (def.substr(0, 4) !== "mhf_") {
|
||||
def = "mhf_" + def;
|
||||
}
|
||||
skins.resize_img(path.join(__dirname, "..", "public", "images", def + ".png"), size, function(resize_err, image) {
|
||||
callback({
|
||||
status: img_status,
|
||||
|
||||
@@ -12,7 +12,7 @@ var fs = require("fs");
|
||||
// helmet is query param
|
||||
function handle_default(rid, scale, helm, body, img_status, userId, size, def, req, err, callback) {
|
||||
def = def || skins.default_skin(userId);
|
||||
if (def !== "steve" && def !== "alex") {
|
||||
if (def !== "steve" && def !== "mhf_steve" && def !== "alex" && def !== "mhf_alex") {
|
||||
if (helpers.id_valid(def)) {
|
||||
// clean up the old URL to match new image
|
||||
var parsed = req.url;
|
||||
@@ -34,6 +34,9 @@ function handle_default(rid, scale, helm, body, img_status, userId, size, def, r
|
||||
}
|
||||
} else {
|
||||
// handle steve and alex
|
||||
if (def.substr(0, 4) !== "mhf_") {
|
||||
def = "mhf_" + def;
|
||||
}
|
||||
fs.readFile(path.join(__dirname, "..", "public", "images", def + "_skin.png"), function (fs_err, buf) {
|
||||
// we render the default skins, but not custom images
|
||||
renders.draw_model(rid, buf, scale, helm, body, function(render_err, def_img) {
|
||||
|
||||
@@ -8,7 +8,7 @@ var url = require("url");
|
||||
|
||||
function handle_default(img_status, userId, def, req, err, callback) {
|
||||
def = def || skins.default_skin(userId);
|
||||
if (def !== "steve" && def !== "alex") {
|
||||
if (def !== "steve" && def !== "mhf_steve" && def !== "alex" && def !== "mhf_alex") {
|
||||
if (helpers.id_valid(def)) {
|
||||
// clean up the old URL to match new image
|
||||
var parsed = req.url;
|
||||
@@ -30,6 +30,9 @@ function handle_default(img_status, userId, def, req, err, callback) {
|
||||
}
|
||||
} else {
|
||||
// handle steve and alex
|
||||
if (def.substr(0, 4) !== "mhf_") {
|
||||
def = "mhf_" + def;
|
||||
}
|
||||
lwip.open(path.join(__dirname, "..", "public", "images", def + "_skin.png"), function(lwip_err, image) {
|
||||
if (image) {
|
||||
image.toBuffer("png", function(buf_err, buffer) {
|
||||
|
||||
Reference in New Issue
Block a user