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

Commit 64ca40c

Browse files
committed
some token login boi
1 parent c63bdc3 commit 64ca40c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies {
2020
compile 'com.google.code.gson:gson:2.8.2'
2121
compile 'ch.qos.logback:logback-classic:1.2.3'
2222
compile 'com.google.guava:guava:24.0-jre'
23-
compile 'net.olympiccode:vHackOSAPI-Java:8fa096f72b'
23+
compile 'net.olympiccode:vHackOSAPI-Java:master-SNAPSHOT'
2424
compile 'io.sentry:sentry:1.7.1'
2525
}
2626
mainClassName = "net.olympiccode.vhackos.bot.core.vHackOSBot"

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

+7
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,14 @@ public void run() throws LoginException, InterruptedException {
9696
LOG.error("Please set your login data in the config file");
9797
System.exit(0);
9898
}
99+
if (!AdvancedConfigValues.token.equals("---") && !AdvancedConfigValues.token.equals("---")) {
100+
api = new vHackOSAPIBuilder().setUsername(ConfigValues.username).setPassword(ConfigValues.password).setPreLogin(AdvancedConfigValues.token, AdvancedConfigValues.uid).buildBlocking();
101+
} else {
99102
api = new vHackOSAPIBuilder().setUsername(ConfigValues.username).setPassword(ConfigValues.password).buildBlocking();
103+
}
104+
advConfig.getConfigJson().addProperty("login.accesstoken", ((vHackOSAPIImpl) api).getAccessToken());
105+
advConfig.getConfigJson().addProperty("login.uid", ((vHackOSAPIImpl) api).getUid());
106+
advConfig.save();
100107
Sentry.getContext().setUser(
101108
new UserBuilder().setUsername(ConfigValues.username).build()
102109
);

0 commit comments

Comments
 (0)