Commit 6949711e authored by Benj's avatar Benj Committed by Luke H-W
Browse files

Actually fix RegionHandler

parent ce1f9b2e
...@@ -28,6 +28,7 @@ import java.security.spec.X509EncodedKeySpec; ...@@ -28,6 +28,7 @@ import java.security.spec.X509EncodedKeySpec;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.security.Signature; import java.security.Signature;
import java.util.regex.Pattern;
import static emu.grasscutter.config.Configuration.*; import static emu.grasscutter.config.Configuration.*;
import static emu.grasscutter.net.proto.QueryRegionListHttpRspOuterClass.QueryRegionListHttpRsp; import static emu.grasscutter.net.proto.QueryRegionListHttpRspOuterClass.QueryRegionListHttpRsp;
...@@ -140,9 +141,10 @@ public final class RegionHandler implements Router { ...@@ -140,9 +141,10 @@ public final class RegionHandler implements Router {
regionData = region.getBase64(); regionData = region.getBase64();
} }
int versionMajor = Integer.parseInt(versionName.split(".")[0]); String[] versionCode = versionName.replaceAll(Pattern.compile("[a-zA-Z]").pattern(), "").split("\\.");
int versionMinor = Integer.parseInt(versionName.split(".")[1]); int versionMajor = Integer.parseInt(versionCode[0]);
int versionFix = Integer.parseInt(versionName.split(".")[2]); int versionMinor = Integer.parseInt(versionCode[1]);
int versionFix = Integer.parseInt(versionCode[2]);
if (versionMajor >= 3 || (versionMajor == 2 && versionMinor == 7 && versionFix >= 50) || (versionMajor == 2 && versionMinor == 8)) { if (versionMajor >= 3 || (versionMajor == 2 && versionMinor == 7 && versionFix >= 50) || (versionMajor == 2 && versionMinor == 8)) {
try { try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment