aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-09 15:19:26 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-09 15:19:26 +0900
commit2976b083cbe99626fd815f73c0b904d0f9339b15 (patch)
tree6f9c767b59dfcdf5dff119a9de81061a3ed2f11c /src/main/java/kr/syeyoung
parent977adfc6f08216ba240c9c6d207a8ad37554f5d5 (diff)
downloadSkyblock-Dungeons-Guide-2976b083cbe99626fd815f73c0b904d0f9339b15.tar.gz
Skyblock-Dungeons-Guide-2976b083cbe99626fd815f73c0b904d0f9339b15.tar.bz2
Skyblock-Dungeons-Guide-2976b083cbe99626fd815f73c0b904d0f9339b15.zip
read whole jar maybe
Diffstat (limited to 'src/main/java/kr/syeyoung')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java11
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java24
2 files changed, 30 insertions, 5 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java b/src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java
index eb6cecb6..80f5a94d 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java
@@ -139,9 +139,14 @@ public class Authenticator {
ZipInputStream inputStream1 = new ZipInputStream(cipherInputStream);
ZipEntry zipEntry;
while ((zipEntry=inputStream1.getNextEntry()) != null) {
- byte[] content = new byte[(int) zipEntry.getSize()];
- IOUtils.readFully(inputStream1, content);
- dynamicResources.put(zipEntry.getName(), content);
+ byte[] buffer = new byte[256];
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ int size = 0;
+ while((size = inputStream1.read(buffer)) > 0) {
+ baos.write(buffer, 0, size);
+ }
+
+ dynamicResources.put(zipEntry.getName(), buffer);
}
huc.disconnect();
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java
index 54d10a51..2e21e33e 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java
@@ -14,8 +14,13 @@ import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
+import javax.crypto.BadPaddingException;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
import java.io.*;
import java.net.URL;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
@Mod(modid = DungeonsGuideMain.MODID, version = DungeonsGuideMain.VERSION)
@@ -67,12 +72,27 @@ public class DungeonsGuideMain
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
+ } catch (NoSuchPaddingException e) {
+ e.printStackTrace();
+ } catch (InvalidKeyException e) {
+ e.printStackTrace();
+ } catch (InvalidAlgorithmParameterException e) {
+ e.printStackTrace();
+ } catch (IllegalBlockSizeException e) {
+ e.printStackTrace();
+ } catch (BadPaddingException e) {
+ e.printStackTrace();
}
error(new String[]{
"Can't validate current installation of Dungeons Guide",
- "Please contact mod author if you purchased this mod and getting this error",
- "And if you haven't purchased the mod, please consider doing so"
+ "Steps to fix",
+ "1. check if other people can't join minecraft servers. If they can't it's impossible to validate",
+ "2. restart minecraft launcher",
+ "3. make sure you're on the right account",
+ "4. restart your computer",
+ "If the problem persists after following these steps, please contact developer",
+ "If you haven't purchased the mod, please consider doing so"
});
}