Sort rankings by time of last EXP gain (#352)

* Sort rankings by time of last EXP gain

* Fix prepared values order
This commit is contained in:
MedicOP
2019-01-21 21:02:32 +01:00
committed by Ronan Lana
parent 3a0ea6fc77
commit 224f5c677b
4 changed files with 13 additions and 5 deletions

View File

@@ -784,7 +784,7 @@ public class Server {
worldQuery = (" AND `characters`.`world` >= 0 AND `characters`.`world` <= " + Math.abs(worldid));
}
ps = con.prepareStatement("SELECT `characters`.`name`, `characters`.`level`, `characters`.`world` FROM `characters` LEFT JOIN accounts ON accounts.id = characters.accountid WHERE `characters`.`gm` < 2 AND `accounts`.`banned` = '0'" + worldQuery + " ORDER BY " + (!ServerConstants.USE_WHOLE_SERVER_RANKING ? "world, " : "") + "level DESC, exp DESC LIMIT 50");
ps = con.prepareStatement("SELECT `characters`.`name`, `characters`.`level`, `characters`.`world` FROM `characters` LEFT JOIN accounts ON accounts.id = characters.accountid WHERE `characters`.`gm` < 2 AND `accounts`.`banned` = '0'" + worldQuery + " ORDER BY " + (!ServerConstants.USE_WHOLE_SERVER_RANKING ? "world, " : "") + "level DESC, exp DESC, lastExpGainTime ASC LIMIT 50");
rs = ps.executeQuery();
if (!ServerConstants.USE_WHOLE_SERVER_RANKING) {