mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
Finish merging
This commit is contained in:
parent
3def0910bc
commit
c428499959
@ -41,7 +41,7 @@ function store_skin(uuid, profile, details, callback) {
|
|||||||
callback(err, null);
|
callback(err, null);
|
||||||
} else {
|
} else {
|
||||||
logging.log(uuid + " face extracted");
|
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.log(uuid + " helm extracted");
|
||||||
logging.debug(helmpath);
|
logging.debug(helmpath);
|
||||||
callback(err, hash);
|
callback(err, hash);
|
||||||
@ -241,7 +241,7 @@ exp.get_skin = function(uuid, callback) {
|
|||||||
callback(err, hash, img);
|
callback(err, hash, img);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
networking.save_skin(uuid, hash, skinpath, function(err, img) {
|
networking.save_texture(uuid, hash, skinpath, function(err, img) {
|
||||||
callback(err, hash, img);
|
callback(err, hash, img);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -303,7 +303,7 @@ exp.get_skin = function(uuid, callback) {
|
|||||||
fs.exists(skinpath, function(exists) {
|
fs.exists(skinpath, function(exists) {
|
||||||
if (exists) {
|
if (exists) {
|
||||||
logging.log("skin already exists, not downloading");
|
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);
|
callback(err, hash, img);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -328,7 +328,7 @@ exp.get_cape = function(uuid, callback) {
|
|||||||
fs.exists(capepath, function(exists) {
|
fs.exists(capepath, function(exists) {
|
||||||
if (exists) {
|
if (exists) {
|
||||||
logging.log("cape already exists, not downloading");
|
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);
|
callback(err, hash, img);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -41,7 +41,7 @@ exp.extract_cape_url = function(profile) {
|
|||||||
// specified. +callback+ contains the body, response,
|
// specified. +callback+ contains the body, response,
|
||||||
// and error buffer. get_from helper method is available
|
// and error buffer. get_from helper method is available
|
||||||
exp.get_from_options = function(url, options, callback) {
|
exp.get_from_options = function(url, options, callback) {
|
||||||
request.get({
|
request({
|
||||||
url: url,
|
url: url,
|
||||||
headers: {
|
headers: {
|
||||||
"User-Agent": "https://crafatar.com"
|
"User-Agent": "https://crafatar.com"
|
||||||
|
|||||||
@ -96,7 +96,7 @@ exp.default_skin = function(uuid) {
|
|||||||
// helper method for opening a skin file from +skinpath+
|
// helper method for opening a skin file from +skinpath+
|
||||||
// callback contains error, image buffer
|
// callback contains error, image buffer
|
||||||
exp.open_skin = function(uuid, skinpath, callback) {
|
exp.open_skin = function(uuid, skinpath, callback) {
|
||||||
fs.readFile(skinpath, function (err, buf) {
|
fs.readFile(skinpath, function(err, buf) {
|
||||||
if (err) {
|
if (err) {
|
||||||
logging.error(uuid + " error while opening skin file: " + err);
|
logging.error(uuid + " error while opening skin file: " + err);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,8 +14,4 @@ for uuid in `cat "$dir/uuids.txt"`; do
|
|||||||
helm="&helm"
|
helm="&helm"
|
||||||
fi
|
fi
|
||||||
curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" "http://$host/avatars/$uuid?size=$size$helm"
|
curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" "http://$host/avatars/$uuid?size=$size$helm"
|
||||||
<<<<<<< HEAD
|
|
||||||
done
|
done
|
||||||
=======
|
|
||||||
done
|
|
||||||
>>>>>>> Network rewrite/major cleanup, major caching changes, etc
|
|
||||||
|
|||||||
@ -145,11 +145,7 @@ describe("Crafatar", function() {
|
|||||||
it("should time out on skin download", function(done) {
|
it("should time out on skin download", function(done) {
|
||||||
var original_timeout = config.http_timeout;
|
var original_timeout = config.http_timeout;
|
||||||
config.http_timeout = 1;
|
config.http_timeout = 1;
|
||||||
<<<<<<< HEAD
|
|
||||||
networking.get_skin("http://textures.minecraft.net/texture/477be35554684c28bdeee4cf11c591d3c88afb77e0b98da893fd7bc318c65184", uuid, function(err, img) {
|
networking.get_skin("http://textures.minecraft.net/texture/477be35554684c28bdeee4cf11c591d3c88afb77e0b98da893fd7bc318c65184", uuid, function(err, img) {
|
||||||
=======
|
|
||||||
networking.get_from("http://textures.minecraft.net/texture/477be35554684c28bdeee4cf11c591d3c88afb77e0b98da893fd7bc318c65184", function(img, response, err) {
|
|
||||||
>>>>>>> Network rewrite/major cleanup, major caching changes, etc
|
|
||||||
assert.strictEqual(err.code, "ETIMEDOUT");
|
assert.strictEqual(err.code, "ETIMEDOUT");
|
||||||
config.http_timeout = original_timeout;
|
config.http_timeout = original_timeout;
|
||||||
done();
|
done();
|
||||||
@ -157,11 +153,7 @@ describe("Crafatar", function() {
|
|||||||
});
|
});
|
||||||
it("should not find the skin", function(done) {
|
it("should not find the skin", function(done) {
|
||||||
assert.doesNotThrow(function() {
|
assert.doesNotThrow(function() {
|
||||||
<<<<<<< HEAD
|
|
||||||
networking.get_skin("http://textures.minecraft.net/texture/this-does-not-exist", uuid, function(err, img) {
|
|
||||||
=======
|
|
||||||
networking.get_from("http://textures.minecraft.net/texture/this-does-not-exist", function(img, response, err) {
|
networking.get_from("http://textures.minecraft.net/texture/this-does-not-exist", function(img, response, err) {
|
||||||
>>>>>>> Network rewrite/major cleanup, major caching changes, etc
|
|
||||||
assert.strictEqual(err, null); // no error here, but it shouldn't throw exceptions
|
assert.strictEqual(err, null); // no error here, but it shouldn't throw exceptions
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -371,8 +371,4 @@ block content
|
|||||||
img.preload(src="/avatars/020242a17b9441799eff511eea1221da?size=64&helm", alt="preloaded image")
|
img.preload(src="/avatars/020242a17b9441799eff511eea1221da?size=64&helm", alt="preloaded image")
|
||||||
img.preload(src="/avatars/9769ecf6331448f3ace67ae06cec64a3?size=64&helm", alt="preloaded image")
|
img.preload(src="/avatars/9769ecf6331448f3ace67ae06cec64a3?size=64&helm", alt="preloaded image")
|
||||||
img.preload(src="/avatars/f8cdb6839e9043eea81939f85d9c5d69?size=64&helm", alt="preloaded image")
|
img.preload(src="/avatars/f8cdb6839e9043eea81939f85d9c5d69?size=64&helm", alt="preloaded image")
|
||||||
<<<<<<< HEAD
|
|
||||||
img.preload(src="/skins/jeb_", alt="preloaded image")
|
img.preload(src="/skins/jeb_", alt="preloaded image")
|
||||||
=======
|
|
||||||
img.preload(src="/skins/jeb_", alt="preloaded image")
|
|
||||||
>>>>>>> Network rewrite/major cleanup, major caching changes, etc
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user