@@ -32,12 +32,10 @@ public class ServerConstants {
|
|||||||
public static final boolean USE_PARTY_SEARCH = false;
|
public static final boolean USE_PARTY_SEARCH = false;
|
||||||
public static final boolean USE_AUTOBAN = false; //commands the server to detect infractors automatically.
|
public static final boolean USE_AUTOBAN = false; //commands the server to detect infractors automatically.
|
||||||
public static final boolean USE_ANOTHER_AUTOASSIGN = true; //based on distributing AP accordingly with higher secondary stat on equipments.
|
public static final boolean USE_ANOTHER_AUTOASSIGN = true; //based on distributing AP accordingly with higher secondary stat on equipments.
|
||||||
public static final boolean USE_REFRESH_RANK_MOVE = true;
|
|
||||||
|
|
||||||
public static final int MAX_AP = 999;
|
public static final int MAX_AP = 999;
|
||||||
public static final long BLOCK_DUEY_RACE_COND = (long)(0.5 * 1000);
|
public static final long BLOCK_DUEY_RACE_COND = (long)(0.5 * 1000);
|
||||||
public static final long PET_LOOT_UPON_ATTACK = (long)(0.7 * 1000); //time the pet must wait before trying to pick items up.
|
public static final long PET_LOOT_UPON_ATTACK = (long)(0.8 * 1000); //time the pet must wait before trying to pick items up.
|
||||||
|
|
||||||
//Some Gameplay Enhancing Configurations
|
//Some Gameplay Enhancing Configurations
|
||||||
public static final boolean USE_PERFECT_SCROLLING = true; //scrolls doesn't use slots upon failure.
|
public static final boolean USE_PERFECT_SCROLLING = true; //scrolls doesn't use slots upon failure.
|
||||||
public static final boolean USE_ENHANCED_CHSCROLL = true; //equips even more powerful with chaos upgrade
|
public static final boolean USE_ENHANCED_CHSCROLL = true; //equips even more powerful with chaos upgrade
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import java.sql.ResultSet;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import client.MapleJob;
|
import client.MapleJob;
|
||||||
import tools.DatabaseConnection;
|
import tools.DatabaseConnection;
|
||||||
import constants.ServerConstants;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Matze
|
* @author Matze
|
||||||
@@ -36,17 +35,11 @@ import constants.ServerConstants;
|
|||||||
public class RankingWorker implements Runnable {
|
public class RankingWorker implements Runnable {
|
||||||
private Connection con;
|
private Connection con;
|
||||||
private long lastUpdate = System.currentTimeMillis();
|
private long lastUpdate = System.currentTimeMillis();
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
con = DatabaseConnection.getConnection();
|
con = DatabaseConnection.getConnection();
|
||||||
con.setAutoCommit(false);
|
con.setAutoCommit(false);
|
||||||
|
|
||||||
if(ServerConstants.USE_REFRESH_RANK_MOVE == true) {
|
|
||||||
resetMoveRank(true);
|
|
||||||
resetMoveRank(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateRanking(null);
|
updateRanking(null);
|
||||||
for (int i = 0; i < 3; i += 2) {
|
for (int i = 0; i < 3; i += 2) {
|
||||||
for (int j = 1; j < 6; j++) {
|
for (int j = 1; j < 6; j++) {
|
||||||
@@ -57,22 +50,13 @@ public class RankingWorker implements Runnable {
|
|||||||
con.setAutoCommit(true);
|
con.setAutoCommit(true);
|
||||||
lastUpdate = System.currentTimeMillis();
|
lastUpdate = System.currentTimeMillis();
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
ex.printStackTrace();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
con.rollback();
|
con.rollback();
|
||||||
con.setAutoCommit(true);
|
con.setAutoCommit(true);
|
||||||
} catch (SQLException ex2) {
|
} 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 {
|
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 ";
|
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 ";
|
||||||
|
|||||||
@@ -168,11 +168,11 @@ public class Server implements Runnable {
|
|||||||
MapleItemInformationProvider.getInstance().getAllItems();
|
MapleItemInformationProvider.getInstance().getAllItems();
|
||||||
|
|
||||||
CashItemFactory.getSpecialCashItems();
|
CashItemFactory.getSpecialCashItems();
|
||||||
System.out.println("Items loaded in " + ((System.currentTimeMillis() - timeToTake) / 1000.0) + " seconds");
|
System.out.println("Items loaded in " + ((System.currentTimeMillis() - timeToTake) / 1000.0) + " seconds\r\n");
|
||||||
|
|
||||||
timeToTake = System.currentTimeMillis();
|
timeToTake = System.currentTimeMillis();
|
||||||
MapleQuest.loadAllQuest();
|
MapleQuest.loadAllQuest();
|
||||||
System.out.println("Quest loaded in " + ((System.currentTimeMillis() - timeToTake) / 1000.0) + " seconds\r\n");
|
System.out.println("Quest loaded in " + ((System.currentTimeMillis() - timeToTake) / 1000.0) + " seconds\r\n");
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user