Implemented King Of The Hill

This commit is contained in:
2019-06-16 01:47:15 +10:00
parent 85f136f9bc
commit 3917aca276
7 changed files with 75 additions and 23 deletions
+1
View File
@@ -111,6 +111,7 @@ const isSpying = (connection, user, cb) => {
const getLadderData = (connection, field, start, length, cb) => {
//moved here for reusability
//TODO: implement the field parameter
let query = 'SELECT accounts.id AS id, username, soldiers, recruits, gold FROM accounts JOIN profiles ON accounts.id = profiles.accountId ORDER BY -ladderRank DESC LIMIT ?, ?;';
connection.query(query, [Math.max(0, start || 0), Math.max(0, length || 0)], (err, results) => {
cb(err, results);