Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 11896d1

Browse files
committed
Fixed shit for first release
1 parent b19891b commit 11896d1

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package net.olympiccode.vhackos.bot.core.config;
2+
3+
public class ConfigValues {
4+
5+
@ConfigOption(path = "username", defaultValue = "***", options = {""})
6+
public static String username;
7+
8+
@ConfigOption(path = "password", defaultValue = "***", options = {""})
9+
public static String password;
10+
}

src/main/java/net/olympiccode/vhackos/bot/core/vHackOSBot.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import net.olympiccode.vhackos.bot.core.config.AdvancedConfigFile;
77
import net.olympiccode.vhackos.bot.core.config.AdvancedConfigValues;
88
import net.olympiccode.vhackos.bot.core.config.ConfigFile;
9+
import net.olympiccode.vhackos.bot.core.config.ConfigValues;
910
import net.olympiccode.vhackos.bot.core.misc.MiscConfigValues;
1011
import net.olympiccode.vhackos.bot.core.misc.MiscService;
1112
import net.olympiccode.vhackos.bot.core.networking.NetworkingConfigValues;
@@ -45,19 +46,22 @@ public void run() {
4546
}));
4647

4748
advConfig.setupConfig();
48-
49+
config.setupConfig();
4950
// ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
5051
// root.setLevel(Level.valueOf(AdvancedConfigValues.logLevel));
51-
52+
if (ConfigValues.username.equals("***") || ConfigValues.password.equals("***")) {
53+
LOG.error("Please set your login data in the config file");
54+
System.exit(0);
55+
}
5256
try {
53-
api = new vHackOSAPIBuilder().setUsername("Checki2").setPassword("12345678").buildBlocking();
57+
api = new vHackOSAPIBuilder().setUsername(ConfigValues.username).setPassword(ConfigValues.password).buildBlocking();
5458
} catch (LoginException e) {
5559
LOG.error("vHack returned invalid username/password.");
5660
} catch (InterruptedException e) {
5761
LOG.error("There was a problem initializing the vHackOSBot.");
5862
}
5963

60-
config.setupConfig();
64+
6165
if (UpdateConfigValues.enabled) updateService.setup();
6266
if (MiscConfigValues.enabled) miscService.setup();
6367
if (NetworkingConfigValues.enabled) networkingService.setup();

0 commit comments

Comments
 (0)