Skip to content

Commit

Permalink
don't forget to add files to readlist
Browse files Browse the repository at this point in the history
  • Loading branch information
Lori3f6 committed Mar 20, 2020
1 parent 7663306 commit ef7f9e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
7 changes: 2 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
pipeline {
agent any
tools {
maven 'Maven 3.3.9'
jdk 'jdk8'
}
stages {
stage('Build') {
steps {
sh 'maven clean install'
sh 'mvn clean install'
}
}
}

post {
always {
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/moe/langua/lab/minecraft/scoop/BootStrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ public void onEnable() {
if (!this.getDataFolder().exists()) {
try {
this.getDataFolder().mkdir();
this.getLogger().info(ChatColor.DARK_AQUA + "Starting to read player data from log files...");
this.getLogger().info(ChatColor.DARK_AQUA+"Initializing...");
setup();
save();
} catch (IOException e) {
e.printStackTrace();
this.getServer().getPluginManager().disablePlugin(this);
this.getLogger().warning("Exception occurred when reading player data... Plugin will be disabled automatically. Please check the stack trace and delete the plugin data folder before next startup to restart player database build.");
this.getLogger().warning("Exception occurred when loading player data... Plugin will be disabled automatically. Please check the stack trace and delete the plugin data folder before next startup to restart player database build.");
return;
}
} else {
try {
this.getLogger().info(ChatColor.DARK_AQUA + "Reading player data...");
this.getLogger().info(ChatColor.DARK_AQUA + "Loading player data...");
load();
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
Expand All @@ -67,12 +67,16 @@ private void setup() throws IOException {
File[] logFiles = logFileFolder.listFiles();
assert logFiles != null;
HashMap<Long, File> fileHashMap = new HashMap<>();
for(File x:logFiles){
fileHashMap.put(x.lastModified(),x);
}
ArrayList<Long> timeList = sort(fileHashMap.keySet());
Collections.reverse(timeList);
int fileNumber = logFiles.length;
int readed = 0;
int fileNumber = timeList.size();
int read = 0;
BufferedReader reader;
for (long x : timeList) {
this.getLogger().info(ChatColor.DARK_AQUA +"Processing log file generated in "+dateFormatter.format(new Date(x))+" ("+(read++) + " out of "+ fileNumber + " files completed)");
File file = fileHashMap.get(x);
if (!file.getName().endsWith(".gz")) {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8));
Expand Down Expand Up @@ -121,7 +125,6 @@ private void setup() throws IOException {
}
} catch (IndexOutOfBoundsException ignore) { /*ignore unknown IndexOutOfBoundsException*/}
}
this.getLogger().info(ChatColor.DARK_AQUA + "Reading server log files... " + (++readed) + "/" + fileNumber + " completed.");
}
}

Expand Down

0 comments on commit ef7f9e8

Please sign in to comment.