mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 19:10:38 +02:00
Finish merging
This commit is contained in:
@@ -41,7 +41,7 @@ function store_skin(uuid, profile, details, callback) {
|
||||
callback(err, null);
|
||||
} else {
|
||||
logging.log(uuid + " face extracted");
|
||||
skins.extract_helm(facepath, img, helmpath, function(err) {
|
||||
skins.extract_helm(uuid, facepath, img, helmpath, function(err) {
|
||||
logging.log(uuid + " helm extracted");
|
||||
logging.debug(helmpath);
|
||||
callback(err, hash);
|
||||
@@ -241,7 +241,7 @@ exp.get_skin = function(uuid, callback) {
|
||||
callback(err, hash, img);
|
||||
});
|
||||
} else {
|
||||
networking.save_skin(uuid, hash, skinpath, function(err, img) {
|
||||
networking.save_texture(uuid, hash, skinpath, function(err, img) {
|
||||
callback(err, hash, img);
|
||||
});
|
||||
}
|
||||
@@ -303,7 +303,7 @@ exp.get_skin = function(uuid, callback) {
|
||||
fs.exists(skinpath, function(exists) {
|
||||
if (exists) {
|
||||
logging.log("skin already exists, not downloading");
|
||||
skins.open_skin(skinpath, function(err, img) {
|
||||
skins.open_skin(uuid, skinpath, function(err, img) {
|
||||
callback(err, hash, img);
|
||||
});
|
||||
} else {
|
||||
@@ -328,7 +328,7 @@ exp.get_cape = function(uuid, callback) {
|
||||
fs.exists(capepath, function(exists) {
|
||||
if (exists) {
|
||||
logging.log("cape already exists, not downloading");
|
||||
skins.open_skin(capepath, function(err, img) {
|
||||
skins.open_skin(uuid, capepath, function(err, img) {
|
||||
callback(err, hash, img);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -41,7 +41,7 @@ exp.extract_cape_url = function(profile) {
|
||||
// specified. +callback+ contains the body, response,
|
||||
// and error buffer. get_from helper method is available
|
||||
exp.get_from_options = function(url, options, callback) {
|
||||
request.get({
|
||||
request({
|
||||
url: url,
|
||||
headers: {
|
||||
"User-Agent": "https://crafatar.com"
|
||||
|
||||
@@ -96,7 +96,7 @@ exp.default_skin = function(uuid) {
|
||||
// helper method for opening a skin file from +skinpath+
|
||||
// callback contains error, image buffer
|
||||
exp.open_skin = function(uuid, skinpath, callback) {
|
||||
fs.readFile(skinpath, function (err, buf) {
|
||||
fs.readFile(skinpath, function(err, buf) {
|
||||
if (err) {
|
||||
logging.error(uuid + " error while opening skin file: " + err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user