Compare commits
12 commits
2024051120
...
main
Author | SHA1 | Date | |
---|---|---|---|
31a51fd76f | |||
e4e071b551 | |||
![]() |
a21f5e04a4 | ||
![]() |
49f80a53be | ||
![]() |
bd754f04e6 | ||
![]() |
eaf293fc09 | ||
![]() |
bf1195bb49 | ||
![]() |
8ff5e2947e | ||
![]() |
0557862a0a | ||
![]() |
184cde85d5 | ||
![]() |
80dcc5fbf8 | ||
![]() |
c723c1b9ff |
15 changed files with 135 additions and 61 deletions
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
|
@ -9,7 +9,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
10
pom.xml
10
pom.xml
|
@ -52,6 +52,16 @@
|
||||||
<artifactId>github-api</artifactId>
|
<artifactId>github-api</artifactId>
|
||||||
<version>1.127</version>
|
<version>1.127</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sun.mail</groupId>
|
||||||
|
<artifactId>javax.mail</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>8.0.33</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.qtjambi</groupId>
|
<groupId>io.qtjambi</groupId>
|
||||||
<artifactId>qtjambi</artifactId>
|
<artifactId>qtjambi</artifactId>
|
||||||
|
|
|
@ -7,14 +7,11 @@ import java.net.URL;
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JProgressBar;
|
import javax.swing.JProgressBar;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
|
|
||||||
import api.GetApiData;
|
|
||||||
import gui.MainGUI;
|
import gui.MainGUI;
|
||||||
import readsafefile.SafeFileManager;
|
|
||||||
import settingsfunctions.LoadSettings;
|
import settingsfunctions.LoadSettings;
|
||||||
import settingsfunctions.MigrateData;
|
import settingsfunctions.MigrateData;
|
||||||
|
|
||||||
|
@ -86,13 +83,12 @@ public class DownloadLevels {
|
||||||
fileOutputStream.write(dataBuffer, 0, bytesRead);
|
fileOutputStream.write(dataBuffer, 0, bytesRead);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
area.append(" >> ERFOLGREICH \n");
|
area.append(" >> ERFOLGREICH \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
JOptionPane.showMessageDialog(null, "Alle " + ManageFiles.getMissinglevels().size() + " Level wurden erfolgreich heruntergeladen.", "Download abgeschlossen", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
main.dispose();
|
main.dispose();
|
||||||
|
|
||||||
MainGUI gui = new MainGUI();
|
MainGUI gui = new MainGUI();
|
||||||
|
|
|
@ -6,10 +6,9 @@ import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import database.DatabaseManager;
|
|
||||||
|
|
||||||
public class GuiData {
|
public class GuiData {
|
||||||
|
|
||||||
private ArrayList<String> localLevels = new ArrayList<String>();
|
private ArrayList<String> localLevels = new ArrayList<String>();
|
||||||
|
@ -66,9 +65,6 @@ public class GuiData {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void IndexData(ArrayList<String> migrate) throws IOException {
|
public void IndexData(ArrayList<String> migrate) throws IOException {
|
||||||
DatabaseManager mgr = new DatabaseManager();
|
|
||||||
|
|
||||||
|
|
||||||
File filelength = new File("C:\\ExtremeDemonList\\levels");
|
File filelength = new File("C:\\ExtremeDemonList\\levels");
|
||||||
File[] filelengthindex = filelength.listFiles();
|
File[] filelengthindex = filelength.listFiles();
|
||||||
|
|
||||||
|
@ -85,8 +81,15 @@ public class GuiData {
|
||||||
|
|
||||||
localLevels.add(obj.getString("name"));
|
localLevels.add(obj.getString("name"));
|
||||||
id.add(obj.getInt("id") + "");
|
id.add(obj.getInt("id") + "");
|
||||||
verifier.add(obj.getString("verifier"));
|
|
||||||
creator.add(obj.getString("author"));
|
try {
|
||||||
|
verifier.add(obj.getString("verifier"));
|
||||||
|
creator.add(obj.getString("author"));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
verifier.add(Long.toString(obj.getLong("verifier")));
|
||||||
|
creator.add(Long.toString(obj.getLong("author")));
|
||||||
|
}
|
||||||
|
|
||||||
qualification.add(obj.getInt("percentToQualify") + "");
|
qualification.add(obj.getInt("percentToQualify") + "");
|
||||||
ytlink.add(obj.getString("verification") + "");
|
ytlink.add(obj.getString("verification") + "");
|
||||||
creators.add(obj.getJSONArray("creators") + "");
|
creators.add(obj.getJSONArray("creators") + "");
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class DatabaseManager {
|
||||||
public void migrateData() {
|
public void migrateData() {
|
||||||
Sqlite database = new Sqlite("levels");
|
Sqlite database = new Sqlite("levels");
|
||||||
FetchData fetch = new FetchData();
|
FetchData fetch = new FetchData();
|
||||||
status = LoadingStatus.getInstance(); // Holen der Singleton-Instanz
|
status = LoadingStatus.getInstance();
|
||||||
|
|
||||||
status.initialize();
|
status.initialize();
|
||||||
|
|
||||||
|
|
|
@ -129,8 +129,8 @@ public class Sqlite {
|
||||||
+ " attempts INTEGER NOT NULL,\n"
|
+ " attempts INTEGER NOT NULL,\n"
|
||||||
+ " completed BOOLEAN NOT NULL,\n"
|
+ " completed BOOLEAN NOT NULL,\n"
|
||||||
+ " locked BOOLEAN NOT NULL,\n" // Neue Spalte
|
+ " locked BOOLEAN NOT NULL,\n" // Neue Spalte
|
||||||
+ " personalBest STRING,\n"
|
+ " personalBest STRING NOT NULL,\n"
|
||||||
+ " levelLength String\n"
|
+ " levelLength String NOT NULL\n"
|
||||||
+ ");";
|
+ ");";
|
||||||
|
|
||||||
try (Connection conn = DriverManager.getConnection(url);
|
try (Connection conn = DriverManager.getConnection(url);
|
||||||
|
@ -176,36 +176,40 @@ public class Sqlite {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void queryData(String tablename) {
|
public void queryData(String tablename) {
|
||||||
|
FetchData fetch = new FetchData();
|
||||||
|
|
||||||
String sql = "SELECT * FROM " + tablename;
|
String sql = "SELECT levelname, levelID, author, creators, verifier, verificationLink, " +
|
||||||
|
"percentToQualify, completed, records, levelNameRaw, attempts, locked, " +
|
||||||
|
"personalBest, levelLength FROM " + tablename + " WHERE levelNameRaw = ?";
|
||||||
|
|
||||||
try (Connection conn = DriverManager.getConnection(url);
|
try (Connection conn = DriverManager.getConnection(url);
|
||||||
Statement stmt = conn.createStatement();
|
PreparedStatement pstmt = conn.prepareStatement(sql)) {
|
||||||
ResultSet rs = stmt.executeQuery(sql)) {
|
|
||||||
|
|
||||||
// loop through the result set
|
|
||||||
while (rs.next()) {
|
|
||||||
levelname.add(rs.getString("levelname"));
|
|
||||||
levelID.add(rs.getInt("levelID") + "");
|
|
||||||
author.add(rs.getString("author"));
|
|
||||||
creators.add(rs.getString("creators"));
|
|
||||||
verifier.add(rs.getString("verifier"));
|
|
||||||
verificationLink.add(rs.getString("verificationLink"));
|
|
||||||
percenttoqualify.add(rs.getInt("percentToQualify") + "");
|
|
||||||
completed.add(rs.getBoolean("completed") + "");
|
|
||||||
records.add(rs.getString("records"));
|
|
||||||
rawLevelNames.add(rs.getString("levelNameRaw"));
|
|
||||||
attempts.add(rs.getInt("attempts"));
|
|
||||||
locked.add(rs.getBoolean("locked")); // Get the value of the new column
|
|
||||||
pbarr.add(rs.getString("personalBest"));
|
|
||||||
levelLength.add(rs.getString("levelLength"));
|
|
||||||
|
|
||||||
|
for (int i = 0; i < fetch.allLevels().size(); i++) {
|
||||||
|
pstmt.setString(1, fetch.allLevels().get(i));
|
||||||
|
try (ResultSet rs = pstmt.executeQuery()) {
|
||||||
|
while (rs.next()) { // Sicherstellen, dass alle Zeilen verarbeitet werden
|
||||||
|
levelname.add(rs.getString("levelname"));
|
||||||
|
levelID.add(rs.getInt("levelID") + "");
|
||||||
|
author.add(rs.getString("author"));
|
||||||
|
creators.add(rs.getString("creators"));
|
||||||
|
verifier.add(rs.getString("verifier"));
|
||||||
|
verificationLink.add(rs.getString("verificationLink"));
|
||||||
|
percenttoqualify.add(rs.getInt("percentToQualify") + "");
|
||||||
|
completed.add(rs.getBoolean("completed") + "");
|
||||||
|
records.add(rs.getString("records"));
|
||||||
|
rawLevelNames.add(rs.getString("levelNameRaw"));
|
||||||
|
attempts.add(rs.getInt("attempts"));
|
||||||
|
locked.add(rs.getBoolean("locked"));
|
||||||
|
pbarr.add(rs.getString("personalBest"));
|
||||||
|
levelLength.add(rs.getString("levelLength"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sortData(String tablename) throws SQLException {
|
public void sortData(String tablename) throws SQLException {
|
||||||
|
@ -368,21 +372,17 @@ status = LoadingStatus.getInstance(); // Holen der Singleton-Instanz
|
||||||
public void checkColumns(String tablename) {
|
public void checkColumns(String tablename) {
|
||||||
String[] spalten = {"placement", "levelname", "levelnameRaw", "levelID", "author", "creators", "verifier", "verificationLink", "percentToQualify", "records", "attempts", "completed", "locked", "personalBest", "levelLength"};
|
String[] spalten = {"placement", "levelname", "levelnameRaw", "levelID", "author", "creators", "verifier", "verificationLink", "percentToQualify", "records", "attempts", "completed", "locked", "personalBest", "levelLength"};
|
||||||
|
|
||||||
// Datenbankverbindung
|
|
||||||
try (Connection connection = DriverManager.getConnection(url)) {
|
try (Connection connection = DriverManager.getConnection(url)) {
|
||||||
DatabaseMetaData metaData = connection.getMetaData();
|
DatabaseMetaData metaData = connection.getMetaData();
|
||||||
ResultSet resultSet;
|
ResultSet resultSet;
|
||||||
|
|
||||||
int missing = 0;
|
int missing = 0;
|
||||||
|
|
||||||
// Schleife über die Spalten
|
|
||||||
for (String spalte : spalten) {
|
for (String spalte : spalten) {
|
||||||
// Abfrage der Spalteninformationen
|
|
||||||
resultSet = metaData.getColumns(null, null, tablename, spalte);
|
resultSet = metaData.getColumns(null, null, tablename, spalte);
|
||||||
|
|
||||||
if (!resultSet.next()) {
|
if (!resultSet.next()) {
|
||||||
System.out.println("Spalte " + spalte + " existiert nicht. Eine neue Spalte wird erstellt.");
|
System.out.println("Spalte " + spalte + " existiert nicht. Eine neue Spalte wird erstellt.");
|
||||||
// Eine neue Spalte erstellen
|
|
||||||
createNewColumn(tablename, spalte);
|
createNewColumn(tablename, spalte);
|
||||||
missing++;
|
missing++;
|
||||||
}
|
}
|
||||||
|
@ -398,7 +398,7 @@ status = LoadingStatus.getInstance(); // Holen der Singleton-Instanz
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createNewColumn(String tablename, String columnName) {
|
private void createNewColumn(String tablename, String columnName) {
|
||||||
String sql = "ALTER TABLE " + tablename + " ADD COLUMN " + columnName + " TEXT";
|
String sql = "ALTER TABLE " + tablename + " ADD COLUMN " + columnName + " TEXT NOT NULL";
|
||||||
try (Connection conn = DriverManager.getConnection(url);
|
try (Connection conn = DriverManager.getConnection(url);
|
||||||
Statement stmt = conn.createStatement()) {
|
Statement stmt = conn.createStatement()) {
|
||||||
stmt.executeUpdate(sql);
|
stmt.executeUpdate(sql);
|
||||||
|
@ -407,6 +407,7 @@ status = LoadingStatus.getInstance(); // Holen der Singleton-Instanz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void moveDataToNewDatabase(String tablename) {
|
public void moveDataToNewDatabase(String tablename) {
|
||||||
// Neuen Tabellennamen für die Kopie
|
// Neuen Tabellennamen für die Kopie
|
||||||
String newTableName = tablename + "_new";
|
String newTableName = tablename + "_new";
|
||||||
|
|
21
src/errorhandler/ErrorHandler.java
Normal file
21
src/errorhandler/ErrorHandler.java
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package errorhandler;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
public class ErrorHandler {
|
||||||
|
|
||||||
|
public void newError(Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
|
e.printStackTrace(pw);
|
||||||
|
|
||||||
|
JOptionPane.showMessageDialog(null, sw.toString() + "", e.getMessage(), JOptionPane.ERROR_MESSAGE);
|
||||||
|
System.exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
18
src/errorhandler/ErrorSubmission.java
Normal file
18
src/errorhandler/ErrorSubmission.java
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
package errorhandler;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.mail.Authenticator;
|
||||||
|
import javax.mail.Message;
|
||||||
|
import javax.mail.MessagingException;
|
||||||
|
import javax.mail.PasswordAuthentication;
|
||||||
|
import javax.mail.Session;
|
||||||
|
import javax.mail.Transport;
|
||||||
|
import javax.mail.internet.InternetAddress;
|
||||||
|
import javax.mail.internet.MimeMessage;
|
||||||
|
|
||||||
|
public class ErrorSubmission {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -23,6 +23,13 @@ public class LoadingStatus {
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static synchronized LoadingStatus getInstance() {
|
||||||
|
if (instance == null) {
|
||||||
|
instance = new LoadingStatus();
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
main.setSize(400, 300);
|
main.setSize(400, 300);
|
||||||
main.setLayout(null);
|
main.setLayout(null);
|
||||||
|
@ -53,13 +60,6 @@ public class LoadingStatus {
|
||||||
main.setVisible(true);
|
main.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized LoadingStatus getInstance() {
|
|
||||||
if (instance == null) {
|
|
||||||
instance = new LoadingStatus();
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update(String level, int barValue) {
|
public void update(String level, int barValue) {
|
||||||
area.append(level + "\n");
|
area.append(level + "\n");
|
||||||
bar.setValue(barValue + 1);
|
bar.setValue(barValue + 1);
|
||||||
|
|
|
@ -3,7 +3,6 @@ package gui;
|
||||||
import java.awt.Button;
|
import java.awt.Button;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
|
||||||
import java.awt.GridLayout;
|
import java.awt.GridLayout;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
import java.awt.Toolkit;
|
import java.awt.Toolkit;
|
||||||
|
@ -18,10 +17,6 @@ import java.awt.event.KeyListener;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseListener;
|
import java.awt.event.MouseListener;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.ProtocolException;
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
|
@ -334,10 +329,14 @@ public class MainGUI {
|
||||||
attemptslabel.setText("Attempts: " + data.getAttempts().get(index));
|
attemptslabel.setText("Attempts: " + data.getAttempts().get(index));
|
||||||
level.setVerticalAlignment(SwingConstants.CENTER);
|
level.setVerticalAlignment(SwingConstants.CENTER);
|
||||||
|
|
||||||
String levellength = data.getLevelLength().get(index);
|
|
||||||
lengthLabel.setText("Länge: lädt...");
|
lengthLabel.setText("Länge: lädt...");
|
||||||
|
|
||||||
if(data.getLevelLength().get(index).equals("N/A")) {
|
String levellength = data.getLevelLength().get(index);
|
||||||
|
|
||||||
|
System.out.println("test:" + data.getLevelLength().get(index) + ".");
|
||||||
|
|
||||||
|
|
||||||
|
if(data.getLevelLength().get(index).equals("N/A") || data.getLevelLength().get(index) == null) {
|
||||||
levellength = api.getLevelLength(Integer.parseInt(data.getLevelID().get(index)));
|
levellength = api.getLevelLength(Integer.parseInt(data.getLevelID().get(index)));
|
||||||
data.modifyData(data.getLevelname().get(index), comp[index], Integer.parseInt(attempts.getText()), lockbool[index], data.getPbarr().get(index), levellength);
|
data.modifyData(data.getLevelname().get(index), comp[index], Integer.parseInt(attempts.getText()), lockbool[index], data.getPbarr().get(index), levellength);
|
||||||
System.out.println("request");
|
System.out.println("request");
|
||||||
|
@ -397,7 +396,6 @@ public class MainGUI {
|
||||||
if(show.getSelectedIndex() == 1) {
|
if(show.getSelectedIndex() == 1) {
|
||||||
if(!(Integer.parseInt(rank.getName()) >= 0 && Integer.parseInt(rank.getName()) <= 2)) {
|
if(!(Integer.parseInt(rank.getName()) >= 0 && Integer.parseInt(rank.getName()) <= 2)) {
|
||||||
levelpanel.remove(contents);
|
levelpanel.remove(contents);
|
||||||
|
|
||||||
levelpanel.repaint();
|
levelpanel.repaint();
|
||||||
levelpanel.revalidate();
|
levelpanel.revalidate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,14 @@ package main;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.zip.DataFormatException;
|
import java.util.zip.DataFormatException;
|
||||||
|
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
import api.GetApiData;
|
import api.GetApiData;
|
||||||
import data.FetchData;
|
import data.FetchData;
|
||||||
import data.ManageFiles;
|
import data.ManageFiles;
|
||||||
import database.DatabaseManager;
|
import database.DatabaseManager;
|
||||||
import database.Sqlite;
|
import database.Sqlite;
|
||||||
|
import errorhandler.ErrorHandler;
|
||||||
import filestructure.CreateFileStructure;
|
import filestructure.CreateFileStructure;
|
||||||
import gui.LoadMenu;
|
import gui.LoadMenu;
|
||||||
import preload.PreChecks;
|
import preload.PreChecks;
|
||||||
|
@ -16,6 +19,16 @@ import settingsfunctions.LoadSettings;
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException, DataFormatException {
|
public static void main(String[] args) throws IOException, DataFormatException {
|
||||||
|
|
||||||
|
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
|
||||||
|
@Override
|
||||||
|
public void uncaughtException(Thread t, Throwable e) {
|
||||||
|
ErrorHandler error = new ErrorHandler();
|
||||||
|
error.newError(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
LoadMenu load = new LoadMenu();
|
LoadMenu load = new LoadMenu();
|
||||||
load.onLoad();
|
load.onLoad();
|
||||||
|
@ -54,6 +67,10 @@ public class Main {
|
||||||
|
|
||||||
load.updateBar("Ladevorgang abgeschlossen");
|
load.updateBar("Ladevorgang abgeschlossen");
|
||||||
load.close();
|
load.close();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("fehler");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,5 @@
|
||||||
requires java.xml;
|
requires java.xml;
|
||||||
requires org.apache.commons.codec;
|
requires org.apache.commons.codec;
|
||||||
requires github.api;
|
requires github.api;
|
||||||
|
requires java.mail;
|
||||||
}
|
}
|
|
@ -24,5 +24,4 @@ public class PreChecks {
|
||||||
migration.migrateData();
|
migration.migrateData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.apache.commons.codec.binary.Base64;
|
||||||
|
|
||||||
public class DecryptXOR {
|
public class DecryptXOR {
|
||||||
|
|
||||||
private static final String[] SAVES = {"CCGameManager.dat"};
|
private static final String[] SAVES = {"CCGameManager.dat"};
|
||||||
private static final int XOR_KEY = 11;
|
private static final int XOR_KEY = 11;
|
||||||
|
|
||||||
private static byte[] xor(byte[] data, int key) {
|
private static byte[] xor(byte[] data, int key) {
|
||||||
|
|
|
@ -22,6 +22,10 @@ public class SafeFileManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadIndexAttempts() throws IOException {
|
public void ReadIndexAttempts() throws IOException {
|
||||||
|
Thread thread = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
read.readAttempts();
|
read.readAttempts();
|
||||||
|
|
||||||
|
@ -40,8 +44,6 @@ public class SafeFileManager {
|
||||||
|
|
||||||
lengthComp.putAll(read.lengthMap);
|
lengthComp.putAll(read.lengthMap);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String attempts;
|
String attempts;
|
||||||
String percent;
|
String percent;
|
||||||
String length;
|
String length;
|
||||||
|
@ -63,9 +65,17 @@ public class SafeFileManager {
|
||||||
prog.update(database.getLevelname().get(i), Integer.parseInt(attempts), Integer.parseInt(percent), i);
|
prog.update(database.getLevelname().get(i), Integer.parseInt(attempts), Integer.parseInt(percent), i);
|
||||||
if(!database.getLocked().get(i)) {
|
if(!database.getLocked().get(i)) {
|
||||||
database.modifyData(database.getLevelname().get(i), Boolean.parseBoolean(database.getCompleted().get(i)), Integer.parseInt(attempts), database.getLocked().get(i), percent, lengthArr[Integer.parseInt(length)]);
|
database.modifyData(database.getLevelname().get(i), Boolean.parseBoolean(database.getCompleted().get(i)), Integer.parseInt(attempts), database.getLocked().get(i), percent, lengthArr[Integer.parseInt(length)]);
|
||||||
|
} else {
|
||||||
|
database.modifyData(database.getLevelname().get(i), Boolean.parseBoolean(database.getCompleted().get(i)), database.getAttempts().get(i), database.getLocked().get(i), database.getRecords().get(i), lengthArr[Integer.parseInt(length)]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
prog.close();
|
prog.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue