Merge branch 'master' of github.com:Jake0oo0/crafatar

This commit is contained in:
jomo 2014-11-02 16:10:30 +01:00
commit 6a4a78767c
6 changed files with 9 additions and 8 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
skins/
skins/*.png
*.log
node_modules/
.DS_Store

1
Procfile Normal file
View File

@ -0,0 +1 @@
web: npm start

View File

@ -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();
}

View File

@ -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
View File

0
skins/helms/.gitkeep Normal file
View File