mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +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
|
*.log
|
||||||
node_modules/
|
node_modules/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
@ -4,10 +4,10 @@ var redis = null;
|
|||||||
|
|
||||||
function connect_redis() {
|
function connect_redis() {
|
||||||
console.log("connecting to redis");
|
console.log("connecting to redis");
|
||||||
if (process.env.REDISTOGO_URL) {
|
if (process.env.REDISCLOUD_URL) {
|
||||||
var rtg = require("url").parse(process.env.REDISTOGO_URL);
|
var redisURL = require("url").parse(process.env.REDISCLOUD_URL);
|
||||||
redis = require("redis").createClient(rtg.port, rtg.hostname);
|
redis = require("redis").createClient(redisURL.port, redisURL.hostname);
|
||||||
redis.auth(rtg.auth.split(":")[1]);
|
redis.auth(redisURL.auth.split(":")[1]);
|
||||||
} else {
|
} else {
|
||||||
redis = require("redis").createClient();
|
redis = require("redis").createClient();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,8 +31,8 @@ function store_images(uuid, details, callback) {
|
|||||||
} else {
|
} else {
|
||||||
// hash has changed
|
// hash has changed
|
||||||
console.log(uuid + "new hash: " + hash);
|
console.log(uuid + "new hash: " + hash);
|
||||||
var facepath = config.faces_dir + hash + ".png";
|
var facepath = __dirname + '/../' + config.faces_dir + hash + ".png";
|
||||||
var helmpath = config.helms_dir + hash + ".png";
|
var helmpath = __dirname + '/../' + config.helms_dir + hash + ".png";
|
||||||
// download skin, extract face/helm
|
// download skin, extract face/helm
|
||||||
networking.skin_file(skinurl, facepath, helmpath, function(err) {
|
networking.skin_file(skinurl, facepath, helmpath, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -114,7 +114,7 @@ exp.get_avatar = function(uuid, helm, size, callback) {
|
|||||||
console.log("\nrequest: " + uuid);
|
console.log("\nrequest: " + uuid);
|
||||||
get_image_hash(uuid, function(err, status, hash) {
|
get_image_hash(uuid, function(err, status, hash) {
|
||||||
if (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) {
|
skins.resize_img(filepath, size, function(img_err, result) {
|
||||||
if (img_err) {
|
if (img_err) {
|
||||||
callback(img_err, -1, null);
|
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