|
@@ -30,9 +30,9 @@ function store_skin(rid, userId, profile, cache_details, callback) {
|
|
|
});
|
|
|
} else {
|
|
|
logging.log(rid, "new skin hash:", skin_hash);
|
|
|
- var facepath = path.join(__dirname, "..", config.directories.faces_dir, skin_hash + ".png");
|
|
|
- var helmpath = path.join(__dirname, "..", config.directories.helms_dir, skin_hash + ".png");
|
|
|
- var skinpath = path.join(__dirname, "..", config.directories.skins_dir, 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 skinpath = path.join(__dirname, "..", config.directories.skins, skin_hash + ".png");
|
|
|
fs.exists(facepath, function(exists) {
|
|
|
if (exists) {
|
|
|
logging.log(rid, "skin already exists, not downloading");
|
|
@@ -87,7 +87,7 @@ function store_cape(rid, userId, profile, cache_details, callback) {
|
|
|
});
|
|
|
} else {
|
|
|
logging.log(rid, "new cape hash:", cape_hash);
|
|
|
- var capepath = path.join(__dirname, "..", config.directories.capes_dir, cape_hash + ".png");
|
|
|
+ var capepath = path.join(__dirname, "..", config.directories.capes, cape_hash + ".png");
|
|
|
fs.exists(capepath, function(exists) {
|
|
|
if (exists) {
|
|
|
logging.log(rid, "cape already exists, not downloading");
|
|
@@ -223,7 +223,7 @@ exp.get_image_hash = function(rid, userId, type, callback) {
|
|
|
if (err) {
|
|
|
callback(err, -1, null);
|
|
|
} else {
|
|
|
- if (cache_details && cache_details[type] !== undefined && cache_details.time + config.caching.local_cache_time * 1000 >= Date.now()) {
|
|
|
+ if (cache_details && cache_details[type] !== undefined && cache_details.time + config.caching.local * 1000 >= Date.now()) {
|
|
|
// use cached image
|
|
|
logging.log(rid, "userId cached & recently updated");
|
|
|
callback(null, (cached_hash ? 1 : 0), cached_hash);
|
|
@@ -261,8 +261,8 @@ exp.get_image_hash = function(rid, userId, type, callback) {
|
|
|
exp.get_avatar = function(rid, userId, helm, size, callback) {
|
|
|
exp.get_image_hash(rid, userId, "skin", function(err, status, skin_hash) {
|
|
|
if (skin_hash) {
|
|
|
- var facepath = path.join(__dirname, "..", config.directories.faces_dir, skin_hash + ".png");
|
|
|
- var helmpath = path.join(__dirname, "..", config.directories.helms_dir, 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 filepath = facepath;
|
|
|
fs.exists(helmpath, function(exists) {
|
|
|
if (helm && exists) {
|
|
@@ -288,7 +288,7 @@ exp.get_avatar = function(rid, userId, helm, size, callback) {
|
|
|
exp.get_skin = function(rid, userId, callback) {
|
|
|
exp.get_image_hash(rid, userId, "skin", function(err, status, skin_hash) {
|
|
|
if (skin_hash) {
|
|
|
- var skinpath = path.join(__dirname, "..", config.directories.skins_dir, skin_hash + ".png");
|
|
|
+ var skinpath = path.join(__dirname, "..", config.directories.skins, skin_hash + ".png");
|
|
|
fs.exists(skinpath, function(exists) {
|
|
|
if (exists) {
|
|
|
logging.log(rid, "skin already exists, not downloading");
|
|
@@ -323,7 +323,7 @@ exp.get_render = function(rid, userId, scale, helm, body, callback) {
|
|
|
callback(err, status, skin_hash, null);
|
|
|
return;
|
|
|
}
|
|
|
- var renderpath = path.join(__dirname, "..", config.directories.renders_dir, [skin_hash, scale, get_type(helm, body)].join("-") + ".png");
|
|
|
+ var renderpath = path.join(__dirname, "..", config.directories.renders, [skin_hash, scale, get_type(helm, body)].join("-") + ".png");
|
|
|
fs.exists(renderpath, function(exists) {
|
|
|
if (exists) {
|
|
|
renders.open_render(rid, renderpath, function(render_err, rendered_img) {
|
|
@@ -362,7 +362,7 @@ exp.get_cape = function(rid, userId, callback) {
|
|
|
callback(err, null, status, null);
|
|
|
return;
|
|
|
}
|
|
|
- var capepath = path.join(__dirname, "..", config.directories.capes_dir, cape_hash + ".png");
|
|
|
+ var capepath = path.join(__dirname, "..", config.directories.capes, cape_hash + ".png");
|
|
|
fs.exists(capepath, function(exists) {
|
|
|
if (exists) {
|
|
|
logging.log(rid, "cape already exists, not downloading");
|