|
|
@ -52,42 +52,9 @@ public class HourlyJobThread implements Runnable { |
|
|
|
Logger.error( e.toString()); |
|
|
|
Logger.error( e.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//updateMines.
|
|
|
|
// Open or Close mines for the current mine window.
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Mine> mines = Mine.getMines(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Mine mine : mines) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Open Errant Mines
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mine.getOwningGuild() == null) { |
|
|
|
|
|
|
|
mine.handleStartMineWindow(); |
|
|
|
|
|
|
|
Mine.setLastChange(System.currentTimeMillis()); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Open Mines with a current guild hour
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mine.getOwningGuild().getMineTime() == |
|
|
|
|
|
|
|
LocalDateTime.now().getHour()) { |
|
|
|
|
|
|
|
mine.handleStartMineWindow(); |
|
|
|
|
|
|
|
Mine.setLastChange(System.currentTimeMillis()); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Close all other mines
|
|
|
|
|
|
|
|
if (mine.handleEndMineWindow()) |
|
|
|
|
|
|
|
Mine.setLastChange(System.currentTimeMillis()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
processMineWindow(); |
|
|
|
Logger.error ("mineID: " + mine.getObjectUUID(), e.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error( e.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Mine mine : Mine.getMines()) { |
|
|
|
for (Mine mine : Mine.getMines()) { |
|
|
|
|
|
|
|
|
|
|
@ -126,4 +93,43 @@ public class HourlyJobThread implements Runnable { |
|
|
|
Logger.info( MessageDispatcher.getNetstatString()); |
|
|
|
Logger.info( MessageDispatcher.getNetstatString()); |
|
|
|
Logger.info(PurgeOprhans.recordsDeleted.toString() + "orphaned items deleted"); |
|
|
|
Logger.info(PurgeOprhans.recordsDeleted.toString() + "orphaned items deleted"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void processMineWindow() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Mine> mines = Mine.getMines(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Mine mine : mines) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Open Errant Mines
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mine.getOwningGuild() == null) { |
|
|
|
|
|
|
|
mine.handleStartMineWindow(); |
|
|
|
|
|
|
|
Mine.setLastChange(System.currentTimeMillis()); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Open Mines with a current guild hour
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mine.getOwningGuild().getMineTime() == |
|
|
|
|
|
|
|
LocalDateTime.now().getHour()) { |
|
|
|
|
|
|
|
mine.handleStartMineWindow(); |
|
|
|
|
|
|
|
Mine.setLastChange(System.currentTimeMillis()); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Close all other mines
|
|
|
|
|
|
|
|
if (mine.handleEndMineWindow()) |
|
|
|
|
|
|
|
Mine.setLastChange(System.currentTimeMillis()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error ("mineID: " + mine.getObjectUUID(), e.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error( e.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|