|
@@ -30,9 +30,9 @@ function store_skin(rid, userId, profile, cache_details, callback) {
|
|
|
});
|
|
|
} else {
|
|
|
logging.debug(rid, "new skin hash:", skin_hash);
|
|
|
- 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");
|
|
|
+ var facepath = path.join(config.directories.faces, skin_hash + ".png");
|
|
|
+ var helmpath = path.join(config.directories.helms, skin_hash + ".png");
|
|
|
+ var skinpath = path.join(config.directories.skins, skin_hash + ".png");
|
|
|
fs.exists(facepath, function(exists) {
|
|
|
if (exists) {
|
|
|
logging.debug(rid, "skin already exists, not downloading");
|
|
@@ -87,7 +87,7 @@ function store_cape(rid, userId, profile, cache_details, callback) {
|
|
|
});
|
|
|
} else {
|
|
|
logging.debug(rid, "new cape hash:", cape_hash);
|
|
|
- var capepath = path.join(__dirname, "..", config.directories.capes, cape_hash + ".png");
|
|
|
+ var capepath = path.join(config.directories.capes, cape_hash + ".png");
|
|
|
fs.exists(capepath, function(exists) {
|
|
|
if (exists) {
|
|
|
logging.debug(rid, "cape already exists, not downloading");
|
|
@@ -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, skin_hash + ".png");
|
|
|
- var helmpath = path.join(__dirname, "..", config.directories.helms, skin_hash + ".png");
|
|
|
+ var facepath = path.join(config.directories.faces, skin_hash + ".png");
|
|
|
+ var helmpath = path.join(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, skin_hash + ".png");
|
|
|
+ var skinpath = path.join(config.directories.skins, skin_hash + ".png");
|
|
|
fs.exists(skinpath, function(exists) {
|
|
|
if (exists) {
|
|
|
logging.debug(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, [skin_hash, scale, get_type(helm, body)].join("-") + ".png");
|
|
|
+ var renderpath = path.join(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, cape_hash + ".png");
|
|
|
+ var capepath = path.join(config.directories.capes, cape_hash + ".png");
|
|
|
fs.exists(capepath, function(exists) {
|
|
|
if (exists) {
|
|
|
logging.debug(rid, "cape already exists, not downloading");
|