Revert "MapleSolaxiaV2 Revision 1"

This reverts commit 090aea9891.
This commit is contained in:
ronancpl
2015-11-06 13:25:17 -02:00
parent 090aea9891
commit 4cb24a5e3f
3 changed files with 6 additions and 24 deletions

View File

@@ -27,7 +27,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import client.MapleJob;
import tools.DatabaseConnection;
import constants.ServerConstants;
/**
* @author Matze
@@ -36,17 +35,11 @@ import constants.ServerConstants;
public class RankingWorker implements Runnable {
private Connection con;
private long lastUpdate = System.currentTimeMillis();
public void run() {
try {
con = DatabaseConnection.getConnection();
con.setAutoCommit(false);
if(ServerConstants.USE_REFRESH_RANK_MOVE == true) {
resetMoveRank(true);
resetMoveRank(false);
}
updateRanking(null);
for (int i = 0; i < 3; i += 2) {
for (int j = 1; j < 6; j++) {
@@ -57,22 +50,13 @@ public class RankingWorker implements Runnable {
con.setAutoCommit(true);
lastUpdate = System.currentTimeMillis();
} catch (SQLException ex) {
ex.printStackTrace();
try {
con.rollback();
con.setAutoCommit(true);
} catch (SQLException ex2) {
ex2.printStackTrace();
}
}
}
private void resetMoveRank(boolean job) throws SQLException {
String query = "UPDATE characters SET " + (job == true ? "jobRankMove = 0" : "rankMove = 0");
PreparedStatement reset = con.prepareStatement(query);
ResultSet rs = reset.executeQuery();
}
private void updateRanking(MapleJob job) throws SQLException {
String sqlCharSelect = "SELECT c.id, " + (job != null ? "c.jobRank, c.jobRankMove" : "c.rank, c.rankMove") + ", a.lastlogin AS lastlogin, a.loggedin FROM characters AS c LEFT JOIN accounts AS a ON c.accountid = a.id WHERE c.gm = 0 ";