Implementation of Gradle build framework (#369)

* Cleanup

* Add build file

* The great migration

* Restore MINA to 1.1.7

* Removed .gradle

* Added flatdir for libs with no artifact repository

* Add README.md, rename Implementation-Title
This commit is contained in:
Damion
2020-02-04 09:13:57 +11:00
committed by GitHub
parent 54f42aaf8a
commit 02b4df2666
858 changed files with 99 additions and 124579 deletions
@@ -0,0 +1,45 @@
package com.rebotted.integrations;
import org.json.JSONObject;
import com.rebotted.GameEngine;
import com.rebotted.integrations.discord.JavaCord;
import java.io.*;
import java.util.stream.Collectors;
public class SettingsLoader {
private static void initialize() {
JSONObject main = new JSONObject();
main
.put("bot-token", "")
.put("websitepass", "")
.put("erssecret", "");
try {
BufferedWriter br = new BufferedWriter(new FileWriter("data/secrets.json"));
br.write(main.toString());
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void loadSettings() throws IOException {
if (!new File("data/secrets.json").exists()) {
initialize();
System.out.println("Please open \"data/secrets.json\" file and enter your discord token bot there!");
System.out.println("Please open \"data/secrets.json\" file and enter your Website Password there!");
} else {
BufferedReader br = new BufferedReader(new FileReader("data/secrets.json"));
String out = br.lines().collect(Collectors.joining("\n"));
JSONObject obj = new JSONObject(out);
JavaCord.token = obj.getString("bot-token");
PlayersOnlineWebsite.password = obj.getString("websitepass");
RegisteredAccsWebsite.password = obj.getString("websitepass");
GameEngine.ersSecret = obj.getString("erssecret");
}
}
}