This repository was archived by the owner on Nov 24, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
src/main/java/net/olympiccode/vhackos/bot/core Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change 6
6
import net .olympiccode .vhackos .bot .core .config .AdvancedConfigFile ;
7
7
import net .olympiccode .vhackos .bot .core .config .AdvancedConfigValues ;
8
8
import net .olympiccode .vhackos .bot .core .config .ConfigFile ;
9
+ import net .olympiccode .vhackos .bot .core .config .ConfigValues ;
9
10
import net .olympiccode .vhackos .bot .core .misc .MiscConfigValues ;
10
11
import net .olympiccode .vhackos .bot .core .misc .MiscService ;
11
12
import net .olympiccode .vhackos .bot .core .networking .NetworkingConfigValues ;
@@ -45,19 +46,22 @@ public void run() {
45
46
}));
46
47
47
48
advConfig .setupConfig ();
48
-
49
+ config . setupConfig ();
49
50
// ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
50
51
// 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
+ }
52
56
try {
53
- api = new vHackOSAPIBuilder ().setUsername ("Checki2" ).setPassword ("12345678" ).buildBlocking ();
57
+ api = new vHackOSAPIBuilder ().setUsername (ConfigValues . username ).setPassword (ConfigValues . password ).buildBlocking ();
54
58
} catch (LoginException e ) {
55
59
LOG .error ("vHack returned invalid username/password." );
56
60
} catch (InterruptedException e ) {
57
61
LOG .error ("There was a problem initializing the vHackOSBot." );
58
62
}
59
63
60
- config . setupConfig ();
64
+
61
65
if (UpdateConfigValues .enabled ) updateService .setup ();
62
66
if (MiscConfigValues .enabled ) miscService .setup ();
63
67
if (NetworkingConfigValues .enabled ) networkingService .setup ();
You can’t perform that action at this time.
0 commit comments