mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-11 18:57:30 +03:00
Произошол троллинг
This commit is contained in:
parent
8e7aabc7f7
commit
60a16923bf
1 changed files with 23 additions and 10 deletions
|
@ -5,12 +5,14 @@
|
||||||
import ru.gravit.utils.helper.LogHelper;
|
import ru.gravit.utils.helper.LogHelper;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public final class RequestAuthHandler extends CachedAuthHandler {
|
public final class RequestAuthHandler extends CachedAuthHandler {
|
||||||
private String url;
|
private transient String url;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
|
@ -19,27 +21,38 @@ public void init() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Entry fetchEntry(UUID uuid) throws IOException {
|
protected Entry fetchEntry(UUID uuid) throws IOException {
|
||||||
// Входные данные - uuid ^, выходные - username
|
throw new UnsupportedOperationException("Произошол троллинг...");
|
||||||
String uuidTOstring = uuid.toString();
|
|
||||||
// вот запрос например этот выглядит так: localhost/auth.php?type = GetUsername & uuid = переменная uuidTOstring
|
|
||||||
return IOHelper.request(new URL(CommonHelper.replace(url, "type", "GetUsername", "uuid", IOHelper.urlEncode(uuidTOstring))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Entry fetchEntry(String username) throws IOException {
|
protected Entry fetchEntry(String username) throws IOException {
|
||||||
// тут надо с точностью наоборот как выше, вместо uuid входные данные username
|
throw new UnsupportedOperationException("Произошол троллинг...");
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean updateAuth(UUID uuid, String username, String accessToken) throws IOException {
|
protected boolean updateAuth(UUID uuid, String username, String accessToken) throws IOException {
|
||||||
return false;
|
throw new UnsupportedOperationException("Произошол троллинг...");
|
||||||
// тут и ниже пока не трогай
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean updateServerID(UUID uuid, String serverID) throws IOException {
|
protected boolean updateServerID(UUID uuid, String serverID) throws IOException {
|
||||||
return false;
|
return proceedServerID(uuid, serverID).equals("ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String proceedServerID(final UUID uuid, final String serverID) throws IOException {
|
||||||
|
final String type = "SetServerID";
|
||||||
|
final String encodedUUID = IOHelper.urlEncode(Objects.toString(uuid));
|
||||||
|
final String encodedID = IOHelper.urlEncode(serverID);
|
||||||
|
final URL formattedUrl = new URL(
|
||||||
|
CommonHelper.replace(url,
|
||||||
|
"type",
|
||||||
|
type,
|
||||||
|
"uuid",
|
||||||
|
encodedUUID,
|
||||||
|
"ServerID",
|
||||||
|
encodedID));
|
||||||
|
|
||||||
|
return IOHelper.request(formattedUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue