[FIX] Удалён неиспользуемый код.

This commit is contained in:
zaxar163 2019-01-18 19:36:19 +03:00
parent f00c0489a7
commit ec572b349c
No known key found for this signature in database
GPG key ID: E3B309DD3852DE06
3 changed files with 2 additions and 41 deletions

View file

@ -41,9 +41,7 @@ public static void registerHandlers() {
if (!registredHandl) {
registerHandler("null", NullAuthHandler.class);
registerHandler("memory", MemoryAuthHandler.class);
// Auth handler that doesn't do nothing :D
registerHandler("binaryFile", BinaryFileAuthHandler.class);
registerHandler("file", FileAuthHandler.class);
registerHandler("mysql", MySQLAuthHandler.class);
registredHandl = true;
}

View file

@ -1,37 +0,0 @@
package ru.gravit.launchserver.auth.handler;
import ru.gravit.launcher.serialize.HInput;
import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.utils.helper.IOHelper;
import java.io.IOException;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
public final class BinaryFileAuthHandler extends FileAuthHandler {
@Override
protected void readAuthFile() throws IOException {
try (HInput input = new HInput(IOHelper.newInput(file))) {
int count = input.readLength(0);
for (int i = 0; i < count; i++) {
UUID uuid = input.readUUID();
Entry entry = new Entry(input);
addAuth(uuid, entry);
}
}
}
@Override
protected void writeAuthFileTmp() throws IOException {
Set<Map.Entry<UUID, Entry>> entrySet = entrySet();
try (HOutput output = new HOutput(IOHelper.newOutput(fileTmp))) {
output.writeLength(entrySet.size(), 0);
for (Map.Entry<UUID, Entry> entry : entrySet) {
output.writeUUID(entry.getKey());
entry.getValue().write(output);
}
}
}
}

View file

@ -10,7 +10,7 @@
import java.net.URL;
public final class JsonAuthProvider extends AuthProvider {
private static Gson gson = new Gson();
private static final Gson gson = new Gson();
private URL url;
private String apiKey;