Fix the score order

This commit is contained in:
Aaron Mueller 2013-05-16 22:56:23 +02:00
parent 9faee5f9d8
commit 5b4db62137

View file

@ -149,18 +149,22 @@ ig.module(
loadScores: function() { loadScores: function() {
ig.global.scores = undefined; ig.global.scores = undefined;
$.post('https://www.scoreoid.com/api/getScores', this.scoreoid, function(data) { data = $.extend({}, {
order: 'desc',
order_by: 'score',
limit: 10
}, this.scoreoid);
$.post('https://www.scoreoid.com/api/getBestScores', data, function(data) {
ig.global.scores = data; ig.global.scores = data;
}); });
}, },
saveScore: function(username, score, cb) { saveScore: function(username, score, cb) {
$.post('https://www.scoreoid.com/api/createScore', { data = $.extend({}, {
api_key: this.scoreoid.api_key, score: score,
game_id: this.scoreoid.game_id, username: username
score: score, }, this.scoreoid);
username: username $.post('https://www.scoreoid.com/api/createScore', data, cb(this));
}, cb(this));
}, },
draw: function() { draw: function() {