Fix loading of settings
This commit is contained in:
1 parent
acab4766b1
commit
da266c7e91
15 files changed
+57
-48
No files matched your search
+2
-2
@@ -19,7 +19,7 @@
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<version>2.4.7</version>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--Logging framework implements slf4j which is required by hikari-->
|
||||
@@ -32,7 +32,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>10.0</version>
|
||||
<version>10.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -66,8 +66,7 @@ public abstract class FastLoginCore<P> {
|
||||
private final Set<UUID> pendingConfirms = Sets.newHashSet();
|
||||
private final SharedConfig sharedConfig;
|
||||
|
||||
private final MojangApiConnector apiConnector;
|
||||
|
||||
private MojangApiConnector apiConnector;
|
||||
private AuthStorage storage;
|
||||
private PasswordGenerator<P> passwordGenerator = new DefaultPasswordGenerator<>();
|
||||
private AuthPlugin<P> authPlugin;
|
||||
@@ -75,7 +74,9 @@ public abstract class FastLoginCore<P> {
|
||||
public FastLoginCore(Map<String, Object> config) {
|
||||
this.pendingLogins = FastLoginCore.buildCache(5, 0);
|
||||
this.sharedConfig = new SharedConfig(config);
|
||||
|
||||
}
|
||||
|
||||
public void setApiConnector() {
|
||||
List<String> ipAddresses = sharedConfig.get("ip-addresses");
|
||||
int requestLimit = sharedConfig.get("mojang-request-limit");
|
||||
this.apiConnector = makeApiConnector(getLogger(), ipAddresses, requestLimit);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.github.games647.fastlogin.core.shared;
|
||||
|
||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||
import com.github.games647.fastlogin.core.PlayerProfile;
|
||||
import com.github.games647.fastlogin.core.SharedConfig;
|
||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
||||
+4
-3
@@ -7,6 +7,7 @@ import com.google.common.io.CharStreams;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.InetAddress;
|
||||
import java.net.URL;
|
||||
@@ -126,9 +127,9 @@ public abstract class MojangApiConnector {
|
||||
return null;
|
||||
}
|
||||
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(httpConnection.getInputStream()));
|
||||
String input = CharStreams.toString(reader);
|
||||
return FastLoginCore.parseId(getUUIDFromJson(input));
|
||||
Reader reader = new InputStreamReader(httpConnection.getInputStream());
|
||||
String json = CharStreams.toString(reader);
|
||||
return FastLoginCore.parseId(getUUIDFromJson(json));
|
||||
} catch (IOException iOException) {
|
||||
logger.log(Level.SEVERE, "Tried converting name->uuid from third-party api", iOException);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user