forked from TuxCoding/FastLogin
Fix loading of settings
This commit is contained in:
@@ -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