|
@@ -29,13 +29,13 @@ function store_skin(rid, userId, profile, cache_details, callback) {
|
|
callback(cache_err, skin_hash);
|
|
callback(cache_err, skin_hash);
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- logging.log(rid, "new skin hash:", skin_hash);
|
|
|
|
|
|
+ logging.debug(rid, "new skin hash:", skin_hash);
|
|
var facepath = path.join(__dirname, "..", config.directories.faces, skin_hash + ".png");
|
|
var facepath = path.join(__dirname, "..", config.directories.faces, skin_hash + ".png");
|
|
var helmpath = path.join(__dirname, "..", config.directories.helms, skin_hash + ".png");
|
|
var helmpath = path.join(__dirname, "..", config.directories.helms, skin_hash + ".png");
|
|
var skinpath = path.join(__dirname, "..", config.directories.skins, skin_hash + ".png");
|
|
var skinpath = path.join(__dirname, "..", config.directories.skins, skin_hash + ".png");
|
|
fs.exists(facepath, function(exists) {
|
|
fs.exists(facepath, function(exists) {
|
|
if (exists) {
|
|
if (exists) {
|
|
- logging.log(rid, "skin already exists, not downloading");
|
|
|
|
|
|
+ logging.debug(rid, "skin already exists, not downloading");
|
|
callback(null, skin_hash);
|
|
callback(null, skin_hash);
|
|
} else {
|
|
} else {
|
|
networking.get_from(rid, url, function(img, response, err1) {
|
|
networking.get_from(rid, url, function(img, response, err1) {
|
|
@@ -86,11 +86,11 @@ function store_cape(rid, userId, profile, cache_details, callback) {
|
|
callback(cache_err, cape_hash);
|
|
callback(cache_err, cape_hash);
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- logging.log(rid, "new cape hash:", cape_hash);
|
|
|
|
|
|
+ logging.debug(rid, "new cape hash:", cape_hash);
|
|
var capepath = path.join(__dirname, "..", config.directories.capes, cape_hash + ".png");
|
|
var capepath = path.join(__dirname, "..", config.directories.capes, cape_hash + ".png");
|
|
fs.exists(capepath, function(exists) {
|
|
fs.exists(capepath, function(exists) {
|
|
if (exists) {
|
|
if (exists) {
|
|
- logging.log(rid, "cape already exists, not downloading");
|
|
|
|
|
|
+ logging.debug(rid, "cape already exists, not downloading");
|
|
callback(null, cape_hash);
|
|
callback(null, cape_hash);
|
|
} else {
|
|
} else {
|
|
networking.get_from(rid, url, function(img, response, net_err) {
|
|
networking.get_from(rid, url, function(img, response, net_err) {
|
|
@@ -225,14 +225,14 @@ exp.get_image_hash = function(rid, userId, type, callback) {
|
|
} else {
|
|
} else {
|
|
if (cache_details && cache_details[type] !== undefined && cache_details.time + config.caching.local * 1000 >= Date.now()) {
|
|
if (cache_details && cache_details[type] !== undefined && cache_details.time + config.caching.local * 1000 >= Date.now()) {
|
|
// use cached image
|
|
// use cached image
|
|
- logging.log(rid, "userId cached & recently updated");
|
|
|
|
|
|
+ logging.debug(rid, "userId cached & recently updated");
|
|
callback(null, (cached_hash ? 1 : 0), cached_hash);
|
|
callback(null, (cached_hash ? 1 : 0), cached_hash);
|
|
} else {
|
|
} else {
|
|
// download image
|
|
// download image
|
|
if (cache_details) {
|
|
if (cache_details) {
|
|
- logging.log(rid, "userId cached, but too old");
|
|
|
|
|
|
+ logging.debug(rid, "userId cached, but too old");
|
|
} else {
|
|
} else {
|
|
- logging.log(rid, "userId not cached");
|
|
|
|
|
|
+ logging.debug(rid, "userId not cached");
|
|
}
|
|
}
|
|
store_images(rid, userId, cache_details, type, function(store_err, new_hash) {
|
|
store_images(rid, userId, cache_details, type, function(store_err, new_hash) {
|
|
if (store_err) {
|
|
if (store_err) {
|
|
@@ -244,7 +244,7 @@ exp.get_image_hash = function(rid, userId, type, callback) {
|
|
} else {
|
|
} else {
|
|
var status = cache_details && (cached_hash === new_hash) ? 3 : 2;
|
|
var status = cache_details && (cached_hash === new_hash) ? 3 : 2;
|
|
logging.debug(rid, "cached hash:", (cache_details && cached_hash));
|
|
logging.debug(rid, "cached hash:", (cache_details && cached_hash));
|
|
- logging.log(rid, "new hash:", new_hash);
|
|
|
|
|
|
+ logging.debug(rid, "new hash:", new_hash);
|
|
callback(null, status, new_hash);
|
|
callback(null, status, new_hash);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -291,7 +291,7 @@ exp.get_skin = function(rid, userId, callback) {
|
|
var skinpath = path.join(__dirname, "..", config.directories.skins, skin_hash + ".png");
|
|
var skinpath = path.join(__dirname, "..", config.directories.skins, skin_hash + ".png");
|
|
fs.exists(skinpath, function(exists) {
|
|
fs.exists(skinpath, function(exists) {
|
|
if (exists) {
|
|
if (exists) {
|
|
- logging.log(rid, "skin already exists, not downloading");
|
|
|
|
|
|
+ logging.debug(rid, "skin already exists, not downloading");
|
|
skins.open_skin(rid, skinpath, function(skin_err, img) {
|
|
skins.open_skin(rid, skinpath, function(skin_err, img) {
|
|
callback(skin_err || err, skin_hash, status, img);
|
|
callback(skin_err || err, skin_hash, status, img);
|
|
});
|
|
});
|
|
@@ -365,7 +365,7 @@ exp.get_cape = function(rid, userId, callback) {
|
|
var capepath = path.join(__dirname, "..", config.directories.capes, cape_hash + ".png");
|
|
var capepath = path.join(__dirname, "..", config.directories.capes, cape_hash + ".png");
|
|
fs.exists(capepath, function(exists) {
|
|
fs.exists(capepath, function(exists) {
|
|
if (exists) {
|
|
if (exists) {
|
|
- logging.log(rid, "cape already exists, not downloading");
|
|
|
|
|
|
+ logging.debug(rid, "cape already exists, not downloading");
|
|
skins.open_skin(rid, capepath, function(skin_err, img) {
|
|
skins.open_skin(rid, capepath, function(skin_err, img) {
|
|
callback(skin_err || err, cape_hash, status, img);
|
|
callback(skin_err || err, cape_hash, status, img);
|
|
});
|
|
});
|