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 66import net .olympiccode .vhackos .bot .core .config .AdvancedConfigFile ;
77import net .olympiccode .vhackos .bot .core .config .AdvancedConfigValues ;
88import net .olympiccode .vhackos .bot .core .config .ConfigFile ;
9+ import net .olympiccode .vhackos .bot .core .config .ConfigValues ;
910import net .olympiccode .vhackos .bot .core .misc .MiscConfigValues ;
1011import net .olympiccode .vhackos .bot .core .misc .MiscService ;
1112import 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 ();
You can’t perform that action at this time.
0 commit comments