Use existing connection for loading new year + family
Move async tasks earlier for lower chance of having to wait
This commit is contained in:
@@ -182,97 +182,95 @@ public class MapleFamily {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadAllFamilies() {
|
public static void loadAllFamilies(Connection con) {
|
||||||
try(Connection con = DatabaseConnection.getConnection()) {
|
List<Pair<Pair<Integer, Integer>, MapleFamilyEntry>> unmatchedJuniors = new ArrayList<>(200); // <<world, seniorid> familyEntry>
|
||||||
List<Pair<Pair<Integer, Integer>, MapleFamilyEntry>> unmatchedJuniors = new ArrayList<>(200); // <<world, seniorid> familyEntry>
|
try (PreparedStatement psEntries = con.prepareStatement("SELECT * FROM family_character")) {
|
||||||
try(PreparedStatement psEntries = con.prepareStatement("SELECT * FROM family_character")) {
|
ResultSet rsEntries = psEntries.executeQuery();
|
||||||
ResultSet rsEntries = psEntries.executeQuery();
|
while (rsEntries.next()) { // can be optimized
|
||||||
while(rsEntries.next()) { // can be optimized
|
int cid = rsEntries.getInt("cid");
|
||||||
int cid = rsEntries.getInt("cid");
|
String name = null;
|
||||||
String name = null;
|
int level = -1;
|
||||||
int level = -1;
|
int jobID = -1;
|
||||||
int jobID = -1;
|
int world = -1;
|
||||||
int world = -1;
|
try (PreparedStatement ps = con.prepareStatement("SELECT world, name, level, job FROM characters WHERE id = ?")) {
|
||||||
try(PreparedStatement ps = con.prepareStatement("SELECT world, name, level, job FROM characters WHERE id = ?")) {
|
ps.setInt(1, cid);
|
||||||
ps.setInt(1, cid);
|
ResultSet rs = ps.executeQuery();
|
||||||
ResultSet rs = ps.executeQuery();
|
if (rs.next()) {
|
||||||
if(rs.next()) {
|
world = rs.getInt("world");
|
||||||
world = rs.getInt("world");
|
name = rs.getString("name");
|
||||||
name = rs.getString("name");
|
level = rs.getInt("level");
|
||||||
level = rs.getInt("level");
|
jobID = rs.getInt("job");
|
||||||
jobID = rs.getInt("job");
|
|
||||||
} else {
|
|
||||||
FilePrinter.printError(FilePrinter.FAMILY_ERROR, "Could not load character information of " + cid + " in loadAllFamilies(). (RECORD DOES NOT EXIST)");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} catch(SQLException e) {
|
|
||||||
FilePrinter.printError(FilePrinter.FAMILY_ERROR, e, "Could not load character information of " + cid + " in loadAllFamilies(). (SQL ERROR)");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
int familyid = rsEntries.getInt("familyid");
|
|
||||||
int seniorid = rsEntries.getInt("seniorid");
|
|
||||||
int reputation = rsEntries.getInt("reputation");
|
|
||||||
int todaysRep = rsEntries.getInt("todaysrep");
|
|
||||||
int totalRep = rsEntries.getInt("totalreputation");
|
|
||||||
int repsToSenior = rsEntries.getInt("reptosenior");
|
|
||||||
String precepts = rsEntries.getString("precepts");
|
|
||||||
//Timestamp lastResetTime = rsEntries.getTimestamp("lastresettime"); //taken care of by FamilyDailyResetTask
|
|
||||||
World wserv = Server.getInstance().getWorld(world);
|
|
||||||
if (wserv == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
MapleFamily family = wserv.getFamily(familyid);
|
|
||||||
if(family == null) {
|
|
||||||
family = new MapleFamily(familyid, world);
|
|
||||||
Server.getInstance().getWorld(world).addFamily(familyid, family);
|
|
||||||
}
|
|
||||||
MapleFamilyEntry familyEntry = new MapleFamilyEntry(family, cid, name, level, MapleJob.getById(jobID));
|
|
||||||
family.addEntry(familyEntry);
|
|
||||||
if(seniorid <= 0) {
|
|
||||||
family.setLeader(familyEntry);
|
|
||||||
family.setMessage(precepts, false);
|
|
||||||
}
|
|
||||||
MapleFamilyEntry senior = family.getEntryByID(seniorid);
|
|
||||||
if(senior != null) {
|
|
||||||
familyEntry.setSenior(family.getEntryByID(seniorid), false);
|
|
||||||
} else {
|
} else {
|
||||||
if(seniorid > 0) unmatchedJuniors.add(new Pair<>(new Pair<>(world, seniorid), familyEntry));
|
FilePrinter.printError(FilePrinter.FAMILY_ERROR, "Could not load character information of " + cid + " in loadAllFamilies(). (RECORD DOES NOT EXIST)");
|
||||||
}
|
continue;
|
||||||
familyEntry.setReputation(reputation);
|
|
||||||
familyEntry.setTodaysRep(todaysRep);
|
|
||||||
familyEntry.setTotalReputation(totalRep);
|
|
||||||
familyEntry.setRepsToSenior(repsToSenior);
|
|
||||||
//load used entitlements
|
|
||||||
try (PreparedStatement ps = con.prepareStatement("SELECT entitlementid FROM family_entitlement WHERE charid = ?")) {
|
|
||||||
ps.setInt(1, familyEntry.getChrId());
|
|
||||||
ResultSet rs = ps.executeQuery();
|
|
||||||
while(rs.next()) {
|
|
||||||
familyEntry.setEntitlementUsed(rs.getInt("entitlementid"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
FilePrinter.printError(FilePrinter.FAMILY_ERROR, e, "Could not load character information of " + cid + " in loadAllFamilies(). (SQL ERROR)");
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
} catch(SQLException e) {
|
int familyid = rsEntries.getInt("familyid");
|
||||||
FilePrinter.printError(FilePrinter.FAMILY_ERROR, e, "Could not get family_character entries.");
|
int seniorid = rsEntries.getInt("seniorid");
|
||||||
e.printStackTrace();
|
int reputation = rsEntries.getInt("reputation");
|
||||||
}
|
int todaysRep = rsEntries.getInt("todaysrep");
|
||||||
// link missing ones (out of order)
|
int totalRep = rsEntries.getInt("totalreputation");
|
||||||
for(Pair<Pair<Integer, Integer>, MapleFamilyEntry> unmatchedJunior : unmatchedJuniors) {
|
int repsToSenior = rsEntries.getInt("reptosenior");
|
||||||
int world = unmatchedJunior.getLeft().getLeft();
|
String precepts = rsEntries.getString("precepts");
|
||||||
int seniorid = unmatchedJunior.getLeft().getRight();
|
//Timestamp lastResetTime = rsEntries.getTimestamp("lastresettime"); //taken care of by FamilyDailyResetTask
|
||||||
MapleFamilyEntry junior = unmatchedJunior.getRight();
|
World wserv = Server.getInstance().getWorld(world);
|
||||||
MapleFamilyEntry senior = Server.getInstance().getWorld(world).getFamily(junior.getFamily().getID()).getEntryByID(seniorid);
|
if (wserv == null) {
|
||||||
if(senior != null) {
|
continue;
|
||||||
junior.setSenior(senior, false);
|
}
|
||||||
|
MapleFamily family = wserv.getFamily(familyid);
|
||||||
|
if (family == null) {
|
||||||
|
family = new MapleFamily(familyid, world);
|
||||||
|
Server.getInstance().getWorld(world).addFamily(familyid, family);
|
||||||
|
}
|
||||||
|
MapleFamilyEntry familyEntry = new MapleFamilyEntry(family, cid, name, level, MapleJob.getById(jobID));
|
||||||
|
family.addEntry(familyEntry);
|
||||||
|
if (seniorid <= 0) {
|
||||||
|
family.setLeader(familyEntry);
|
||||||
|
family.setMessage(precepts, false);
|
||||||
|
}
|
||||||
|
MapleFamilyEntry senior = family.getEntryByID(seniorid);
|
||||||
|
if (senior != null) {
|
||||||
|
familyEntry.setSenior(family.getEntryByID(seniorid), false);
|
||||||
} else {
|
} else {
|
||||||
FilePrinter.printError(FilePrinter.FAMILY_ERROR, "Missing senior for character " + junior.getName() + " in world " + world);
|
if (seniorid > 0) {
|
||||||
|
unmatchedJuniors.add(new Pair<>(new Pair<>(world, seniorid), familyEntry));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
familyEntry.setReputation(reputation);
|
||||||
|
familyEntry.setTodaysRep(todaysRep);
|
||||||
|
familyEntry.setTotalReputation(totalRep);
|
||||||
|
familyEntry.setRepsToSenior(repsToSenior);
|
||||||
|
//load used entitlements
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("SELECT entitlementid FROM family_entitlement WHERE charid = ?")) {
|
||||||
|
ps.setInt(1, familyEntry.getChrId());
|
||||||
|
ResultSet rs = ps.executeQuery();
|
||||||
|
while (rs.next()) {
|
||||||
|
familyEntry.setEntitlementUsed(rs.getInt("entitlementid"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(SQLException e) {
|
} catch (SQLException e) {
|
||||||
FilePrinter.printError(FilePrinter.FAMILY_ERROR, e, "Could not get DB connection.");
|
FilePrinter.printError(FilePrinter.FAMILY_ERROR, e, "Could not get family_character entries.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
for(World world : Server.getInstance().getWorlds()) {
|
// link missing ones (out of order)
|
||||||
for(MapleFamily family : world.getFamilies()) {
|
for (Pair<Pair<Integer, Integer>, MapleFamilyEntry> unmatchedJunior : unmatchedJuniors) {
|
||||||
|
int world = unmatchedJunior.getLeft().getLeft();
|
||||||
|
int seniorid = unmatchedJunior.getLeft().getRight();
|
||||||
|
MapleFamilyEntry junior = unmatchedJunior.getRight();
|
||||||
|
MapleFamilyEntry senior = Server.getInstance().getWorld(world).getFamily(junior.getFamily().getID()).getEntryByID(seniorid);
|
||||||
|
if (senior != null) {
|
||||||
|
junior.setSenior(senior, false);
|
||||||
|
} else {
|
||||||
|
FilePrinter.printError(FilePrinter.FAMILY_ERROR, "Missing senior for character " + junior.getName() + " in world " + world);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (World world : Server.getInstance().getWorlds()) {
|
||||||
|
for (MapleFamily family : world.getFamilies()) {
|
||||||
family.getLeader().doFullCount();
|
family.getLeader().doFullCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -340,21 +340,17 @@ public class NewYearCardRecord {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startPendingNewYearCardRequests() {
|
public static void startPendingNewYearCardRequests(Connection con) throws SQLException {
|
||||||
try (Connection con = DatabaseConnection.getConnection()) {
|
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM newyear WHERE timereceived = 0 AND senderdiscard = 0")) {
|
||||||
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM newyear WHERE timereceived = 0 AND senderdiscard = 0")) {
|
try (ResultSet rs = ps.executeQuery()) {
|
||||||
try (ResultSet rs = ps.executeQuery()) {
|
while (rs.next()) {
|
||||||
while (rs.next()) {
|
NewYearCardRecord newyear = new NewYearCardRecord(rs.getInt("senderid"), rs.getString("sendername"), rs.getInt("receiverid"), rs.getString("receivername"), rs.getString("message"));
|
||||||
NewYearCardRecord newyear = new NewYearCardRecord(rs.getInt("senderid"), rs.getString("sendername"), rs.getInt("receiverid"), rs.getString("receivername"), rs.getString("message"));
|
newyear.setExtraNewYearCardRecord(rs.getInt("id"), rs.getBoolean("senderdiscard"), rs.getBoolean("receiverdiscard"), rs.getBoolean("received"), rs.getLong("timesent"), rs.getLong("timereceived"));
|
||||||
newyear.setExtraNewYearCardRecord(rs.getInt("id"), rs.getBoolean("senderdiscard"), rs.getBoolean("receiverdiscard"), rs.getBoolean("received"), rs.getLong("timesent"), rs.getLong("timereceived"));
|
|
||||||
|
|
||||||
Server.getInstance().setNewYearCard(newyear);
|
Server.getInstance().setNewYearCard(newyear);
|
||||||
newyear.startNewYearCardTask();
|
newyear.startNewYearCardTask();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(SQLException sqle) {
|
|
||||||
sqle.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -704,7 +704,7 @@ public class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void installWorldPlayerRanking(int worldid) {
|
private void installWorldPlayerRanking(int worldid) {
|
||||||
List<Pair<Integer, List<Pair<String, Integer>>>> ranking = updatePlayerRankingFromDB(worldid);
|
List<Pair<Integer, List<Pair<String, Integer>>>> ranking = loadPlayerRankingFromDB(worldid);
|
||||||
if (!ranking.isEmpty()) {
|
if (!ranking.isEmpty()) {
|
||||||
wldWLock.lock();
|
wldWLock.lock();
|
||||||
try {
|
try {
|
||||||
@@ -736,7 +736,7 @@ public class Server {
|
|||||||
wldWLock.unlock();
|
wldWLock.unlock();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<Pair<Integer, List<Pair<String, Integer>>>> ranking = updatePlayerRankingFromDB(-1 * (this.getWorldsSize() - 2)); // update ranking list
|
List<Pair<Integer, List<Pair<String, Integer>>>> ranking = loadPlayerRankingFromDB(-1 * (this.getWorldsSize() - 2)); // update ranking list
|
||||||
|
|
||||||
wldWLock.lock();
|
wldWLock.lock();
|
||||||
try {
|
try {
|
||||||
@@ -748,40 +748,47 @@ public class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateWorldPlayerRanking() {
|
public void updateWorldPlayerRanking() {
|
||||||
List<Pair<Integer, List<Pair<String, Integer>>>> rankUpdates = updatePlayerRankingFromDB(-1 * (this.getWorldsSize() - 1));
|
List<Pair<Integer, List<Pair<String, Integer>>>> rankUpdates = loadPlayerRankingFromDB(-1 * (this.getWorldsSize() - 1));
|
||||||
if (!rankUpdates.isEmpty()) {
|
if (rankUpdates.isEmpty()) {
|
||||||
wldWLock.lock();
|
return;
|
||||||
try {
|
|
||||||
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
|
||||||
for (int i = playerRanking.size(); i <= rankUpdates.get(rankUpdates.size() - 1).getLeft(); i++) {
|
|
||||||
playerRanking.add(new ArrayList<>(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Pair<Integer, List<Pair<String, Integer>>> wranks : rankUpdates) {
|
|
||||||
playerRanking.set(wranks.getLeft(), wranks.getRight());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
playerRanking.set(0, rankUpdates.get(0).getRight());
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
wldWLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wldWLock.lock();
|
||||||
|
try {
|
||||||
|
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||||
|
for (int i = playerRanking.size(); i <= rankUpdates.get(rankUpdates.size() - 1).getLeft(); i++) {
|
||||||
|
playerRanking.add(new ArrayList<>(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Pair<Integer, List<Pair<String, Integer>>> wranks : rankUpdates) {
|
||||||
|
playerRanking.set(wranks.getLeft(), wranks.getRight());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
playerRanking.set(0, rankUpdates.get(0).getRight());
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
wldWLock.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initWorldPlayerRanking() {
|
private void initWorldPlayerRanking() {
|
||||||
if (YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
if (YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||||
playerRanking.add(new ArrayList<>(0));
|
wldWLock.lock();
|
||||||
|
try {
|
||||||
|
playerRanking.add(new ArrayList<>(0));
|
||||||
|
} finally {
|
||||||
|
wldWLock.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateWorldPlayerRanking();
|
updateWorldPlayerRanking();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Pair<Integer, List<Pair<String, Integer>>>> updatePlayerRankingFromDB(int worldid) {
|
private static List<Pair<Integer, List<Pair<String, Integer>>>> loadPlayerRankingFromDB(int worldid) {
|
||||||
List<Pair<Integer, List<Pair<String, Integer>>>> rankSystem = new ArrayList<>();
|
List<Pair<Integer, List<Pair<String, Integer>>>> rankSystem = new ArrayList<>();
|
||||||
List<Pair<String, Integer>> rankUpdate = new ArrayList<>(0);
|
|
||||||
|
|
||||||
try (Connection con = DatabaseConnection.getConnection()) {
|
try (Connection con = DatabaseConnection.getConnection()) {
|
||||||
|
|
||||||
String worldQuery;
|
String worldQuery;
|
||||||
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||||
if (worldid >= 0) {
|
if (worldid >= 0) {
|
||||||
@@ -793,6 +800,7 @@ public class Server {
|
|||||||
worldQuery = (" AND `characters`.`world` >= 0 AND `characters`.`world` <= " + Math.abs(worldid));
|
worldQuery = (" AND `characters`.`world` >= 0 AND `characters`.`world` <= " + Math.abs(worldid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Pair<String, Integer>> rankUpdate = new ArrayList<>(0);
|
||||||
try (PreparedStatement 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 " + (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING ? "world, " : "") + "level DESC, exp DESC, lastExpGainTime ASC LIMIT 50");
|
try (PreparedStatement 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 " + (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING ? "world, " : "") + "level DESC, exp DESC, lastExpGainTime ASC LIMIT 50");
|
||||||
ResultSet rs = ps.executeQuery()) {
|
ResultSet rs = ps.executeQuery()) {
|
||||||
|
|
||||||
@@ -836,22 +844,6 @@ public class Server {
|
|||||||
throw new IllegalStateException("Failed to initiate a connection to the database");
|
throw new IllegalStateException("Failed to initiate a connection to the database");
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeZone.setDefault(TimeZone.getTimeZone(YamlConfig.config.server.TIMEZONE));
|
|
||||||
|
|
||||||
try (Connection con = DatabaseConnection.getConnection()) {
|
|
||||||
setAllLoggedOut(con);
|
|
||||||
setAllMerchantsInactive(con);
|
|
||||||
cleanNxcodeCoupons(con);
|
|
||||||
loadCouponRates(con);
|
|
||||||
updateActiveCoupons(con);
|
|
||||||
MapleCashidGenerator.loadExistentCashIdsFromDb(con);
|
|
||||||
applyAllNameChanges(con); // -- name changes can be missed by INSTANT_NAME_CHANGE --
|
|
||||||
applyAllWorldTransfers(con);
|
|
||||||
} catch (SQLException sqle) {
|
|
||||||
log.error("Failed to run all startup-bound database tasks", sqle);
|
|
||||||
throw new IllegalStateException(sqle);
|
|
||||||
}
|
|
||||||
|
|
||||||
final ExecutorService initExecutor = Executors.newFixedThreadPool(10);
|
final ExecutorService initExecutor = Executors.newFixedThreadPool(10);
|
||||||
// Run slow operations asynchronously to make startup faster
|
// Run slow operations asynchronously to make startup faster
|
||||||
final List<Future<?>> futures = new ArrayList<>();
|
final List<Future<?>> futures = new ArrayList<>();
|
||||||
@@ -861,11 +853,30 @@ public class Server {
|
|||||||
futures.add(initExecutor.submit(() -> MapleSkillbookInformationProvider.loadAllSkillbookInformation()));
|
futures.add(initExecutor.submit(() -> MapleSkillbookInformationProvider.loadAllSkillbookInformation()));
|
||||||
futures.add(initExecutor.submit(() -> MaplePlayerNPCFactory.loadFactoryMetadata()));
|
futures.add(initExecutor.submit(() -> MaplePlayerNPCFactory.loadFactoryMetadata()));
|
||||||
|
|
||||||
|
TimeZone.setDefault(TimeZone.getTimeZone(YamlConfig.config.server.TIMEZONE));
|
||||||
|
|
||||||
|
try (Connection con = DatabaseConnection.getConnection()) {
|
||||||
|
setAllLoggedOut(con);
|
||||||
|
setAllMerchantsInactive(con);
|
||||||
|
cleanNxcodeCoupons(con);
|
||||||
|
loadCouponRates(con);
|
||||||
|
updateActiveCoupons(con);
|
||||||
|
NewYearCardRecord.startPendingNewYearCardRequests(con);
|
||||||
|
MapleCashidGenerator.loadExistentCashIdsFromDb(con);
|
||||||
|
applyAllNameChanges(con); // -- name changes can be missed by INSTANT_NAME_CHANGE --
|
||||||
|
applyAllWorldTransfers(con);
|
||||||
|
|
||||||
|
if (YamlConfig.config.server.USE_FAMILY_SYSTEM) {
|
||||||
|
MapleFamily.loadAllFamilies(con);
|
||||||
|
}
|
||||||
|
} catch (SQLException sqle) {
|
||||||
|
log.error("Failed to run all startup-bound database tasks", sqle);
|
||||||
|
throw new IllegalStateException(sqle);
|
||||||
|
}
|
||||||
|
|
||||||
ThreadManager.getInstance().start();
|
ThreadManager.getInstance().start();
|
||||||
initializeTimelyTasks(); // aggregated method for timely tasks thanks to lxconan
|
initializeTimelyTasks(); // aggregated method for timely tasks thanks to lxconan
|
||||||
|
|
||||||
NewYearCardRecord.startPendingNewYearCardRequests();
|
|
||||||
|
|
||||||
if (YamlConfig.config.server.USE_THREAD_TRACKER) {
|
if (YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||||
ThreadTracker.getInstance().registerThreadTrackerTask();
|
ThreadTracker.getInstance().registerThreadTrackerTask();
|
||||||
}
|
}
|
||||||
@@ -885,13 +896,6 @@ public class Server {
|
|||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (YamlConfig.config.server.USE_FAMILY_SYSTEM) {
|
|
||||||
long timeToTake = System.currentTimeMillis();
|
|
||||||
MapleFamily.loadAllFamilies();
|
|
||||||
final double familyLoadTime = (System.currentTimeMillis() - timeToTake) / 1000.0;
|
|
||||||
log.info("Families loaded in {} seconds", familyLoadTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wait on all async tasks to complete
|
// Wait on all async tasks to complete
|
||||||
for (Future<?> future : futures) {
|
for (Future<?> future : futures) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user