no lol that hurt so bad
All checks were successful
/ Build BaseBand Loader (push) Successful in 1m8s

This commit is contained in:
Jess H 2024-06-20 01:44:04 +01:00
parent 39d4713c9d
commit 7a3d903bff
Signed by: UnixSystemV
GPG key ID: 9B21C50B68D67F19

View file

@ -6,14 +6,12 @@ import de.com.baseband.launcher.security.impl.AntiInstrumentationImpl;
import de.com.baseband.launcher.security.impl.JVMArgImpl;
import de.com.baseband.launcher.util.GitHash;
import de.com.baseband.launcher.util.RSAKey;
import de.com.baseband.launcher.util.SecondCounter;
import de.com.baseband.launcher.util.Util;
import de.tudbut.io.TypedInputStream;
import de.tudbut.io.TypedOutputStream;
import de.tudbut.net.http.HTTPUtils;
import de.tudbut.parsing.TCN;
import de.tudbut.tools.Hasher;
import de.tudbut.tools.Lock;
import de.tudbut.tools.Tools;
import de.tudbut.tools.encryption.Key;
import de.tudbut.tools.encryption.RawKey;
@ -31,7 +29,6 @@ import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@ -91,19 +88,6 @@ public class Loader implements Util {
exit();
} else if(status == Response.OK) {
LOGGER.info(status.name);
SecondCounter secondCounter = new SecondCounter();
AtomicBoolean downloaded = new AtomicBoolean(false);
Thread thread = new Thread(() -> {
while(!downloaded.get()) {
new Lock().waitHere(2000);
if (secondCounter.getCount() == 0) {
LOGGER.warn("BaseBand appears to have stopped downloading.");
} else {
LOGGER.warn("BaseBand is downloading at a rate of " + (secondCounter.getCount() / 1024) + " kilobytes per second. (if this seems low then restart your game.)");
}
}
});
thread.start();
try {
TCN clientData = TCN.readMap(Tools.stringToMap(key.decryptString(inputStream.readString())));
@ -111,14 +95,9 @@ public class Loader implements Util {
RawKey rk = new RawKey(key.toBytes());
int n = inputStream.readInt();
for (int i = 0; i < n; i++) {
String name = inputStream.readString();
byte[] bytes = inputStream.readByteArray();
data.put(rk.decryptString(name), rk.decryptBytes(bytes));
secondCounter.increment(bytes.length);
data.put(rk.decryptString(inputStream.readString()), rk.decryptBytes(inputStream.readByteArray()));
}
downloaded.set(true);
LOGGER.info("BaseBand downloaded: {} classes.", data.size());
thread.stop();
classLoader = new CustomClassLoader(data);
classLoader.inject();
classLoader.informClient(clientData);