mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
Merge branch 'master' of github.com:Jake0oo0/crafatar
This commit is contained in:
commit
6a4a78767c
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
skins/
|
||||
skins/*.png
|
||||
*.log
|
||||
node_modules/
|
||||
.DS_Store
|
||||
|
||||
@ -4,10 +4,10 @@ var redis = null;
|
||||
|
||||
function connect_redis() {
|
||||
console.log("connecting to redis");
|
||||
if (process.env.REDISTOGO_URL) {
|
||||
var rtg = require("url").parse(process.env.REDISTOGO_URL);
|
||||
redis = require("redis").createClient(rtg.port, rtg.hostname);
|
||||
redis.auth(rtg.auth.split(":")[1]);
|
||||
if (process.env.REDISCLOUD_URL) {
|
||||
var redisURL = require("url").parse(process.env.REDISCLOUD_URL);
|
||||
redis = require("redis").createClient(redisURL.port, redisURL.hostname);
|
||||
redis.auth(redisURL.auth.split(":")[1]);
|
||||
} else {
|
||||
redis = require("redis").createClient();
|
||||
}
|
||||
|
||||
@ -31,8 +31,8 @@ function store_images(uuid, details, callback) {
|
||||
} else {
|
||||
// hash has changed
|
||||
console.log(uuid + "new hash: " + hash);
|
||||
var facepath = config.faces_dir + hash + ".png";
|
||||
var helmpath = config.helms_dir + hash + ".png";
|
||||
var facepath = __dirname + '/../' + config.faces_dir + hash + ".png";
|
||||
var helmpath = __dirname + '/../' + config.helms_dir + hash + ".png";
|
||||
// download skin, extract face/helm
|
||||
networking.skin_file(skinurl, facepath, helmpath, function(err) {
|
||||
if (err) {
|
||||
@ -114,7 +114,7 @@ exp.get_avatar = function(uuid, helm, size, callback) {
|
||||
console.log("\nrequest: " + uuid);
|
||||
get_image_hash(uuid, function(err, status, hash) {
|
||||
if (hash) {
|
||||
var filepath = (helm ? config.helms_dir : config.faces_dir) + hash + ".png";
|
||||
var filepath = __dirname + '/../' + (helm ? config.helms_dir : config.faces_dir) + hash + ".png";
|
||||
skins.resize_img(filepath, size, function(img_err, result) {
|
||||
if (img_err) {
|
||||
callback(img_err, -1, null);
|
||||
|
||||
0
skins/faces/.gitkeep
Normal file
0
skins/faces/.gitkeep
Normal file
0
skins/helms/.gitkeep
Normal file
0
skins/helms/.gitkeep
Normal file
Loading…
x
Reference in New Issue
Block a user