[ANY] Удалены остатки т старой системы сокетов (ещё с 4.xx). + [ANY] Обновлены модули.

This commit is contained in:
Zaxar163 2020-04-05 13:46:04 +03:00
parent 49a2d79ce1
commit c0824a84cd
5 changed files with 3 additions and 44 deletions

View file

@ -1,30 +0,0 @@
package pro.gravit.launcher.request;
import pro.gravit.launcher.serialize.HInput;
import pro.gravit.launcher.serialize.stream.EnumSerializer;
import java.io.IOException;
public enum RequestType implements EnumSerializer.Itf {
PING(0), // Ping request
LEGACYLAUNCHER(1), UPDATE(2), UPDATE_LIST(3), // Update requests
AUTH(4), JOIN_SERVER(5), CHECK_SERVER(6), // Auth requests
PROFILE_BY_USERNAME(7), PROFILE_BY_UUID(8), BATCH_PROFILE_BY_USERNAME(9), // Profile requests
PROFILES(10), SERVERAUTH(11), SETPROFILE(12), LAUNCHER(13), CHANGESERVER(14), EXECCOMMAND(15),
CUSTOM(255); // Custom requests
private static final EnumSerializer<RequestType> SERIALIZER = new EnumSerializer<>(RequestType.class);
private final int n;
RequestType(int n) {
this.n = n;
}
public static RequestType read(HInput input) throws IOException {
return SERIALIZER.read(input);
}
@Override
public int getNumber() {
return n;
}
}

View file

@ -4,7 +4,6 @@
import pro.gravit.launcher.events.request.BatchProfileByUsernameRequestEvent;
import pro.gravit.launcher.request.Request;
import pro.gravit.launcher.request.websockets.WebSocketRequest;
import pro.gravit.launcher.serialize.SerializeLimits;
import pro.gravit.utils.helper.IOHelper;
import pro.gravit.utils.helper.VerifyHelper;
@ -20,7 +19,7 @@ public BatchProfileByUsernameRequest(String... usernames) throws IOException {
this.list[i].client = "";
this.list[i].username = usernames[i];
}
IOHelper.verifyLength(usernames.length, SerializeLimits.MAX_BATCH_SIZE);
IOHelper.verifyLength(usernames.length, IOHelper.MAX_BATCH_SIZE);
for (String username : usernames)
VerifyHelper.verifyUsername(username);
}

View file

@ -1,10 +0,0 @@
package pro.gravit.launcher.serialize;
public class SerializeLimits {
public static final int MAX_BATCH_SIZE = 128;
public static final byte EXPECTED_BYTE = 0b01010101;
public static final int MAX_DIGEST = 512;
}

View file

@ -23,7 +23,7 @@ public final class IOHelper {
public static final long MB32 = 1 << 25;
public static final Charset UNICODE_CHARSET = StandardCharsets.UTF_8;
public static final Charset ASCII_CHARSET = StandardCharsets.US_ASCII;
public static final int MAX_BATCH_SIZE = 128;
// Charset
public static final int SOCKET_TIMEOUT = VerifyHelper.verifyInt(
Integer.parseUnsignedInt(System.getProperty("launcher.socketTimeout", Integer.toString(30000))),

@ -1 +1 @@
Subproject commit 1d04cc3261679c21951c878e2c1a8b34417c5816
Subproject commit 5fed180f06a8b86f70202fc74282a8ab09583a96