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:
@@ -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) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class RankingLoginWorker implements Runnable {
|
||||
if (job != -1) {
|
||||
sqlCharSelect += "AND c.job DIV 100 = ? ";
|
||||
}
|
||||
sqlCharSelect += "ORDER BY c.level DESC , c.exp DESC , c.fame DESC , c.meso DESC";
|
||||
sqlCharSelect += "ORDER BY c.level DESC , c.exp DESC , c.lastExpGainTime ASC, c.fame DESC , c.meso DESC";
|
||||
|
||||
PreparedStatement charSelect = con.prepareStatement(sqlCharSelect);
|
||||
charSelect.setInt(1, world);
|
||||
|
||||
Reference in New Issue
Block a user