From 2b0f2f74cb85fb9a02f9499beadbdcb9b81ef647 Mon Sep 17 00:00:00 2001 From: Ceris White <60857285+CerisWhite@users.noreply.github.com> Date: Sun, 20 Aug 2023 13:47:08 -0500 Subject: [PATCH] Update RegionHandler.java (#2295) Who decided to regex it like that??? --- .../emu/grasscutter/server/http/dispatch/RegionHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java index fd2737953..ce7b71ee2 100644 --- a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java +++ b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java @@ -176,13 +176,13 @@ public final class RegionHandler implements Router { Logger logger = Grasscutter.getLogger(); if (ctx.queryParamMap().containsKey("version") && ctx.queryParamMap().containsKey("platform")) { String versionName = ctx.queryParam("version"); - String versionCode = versionName.replaceAll("[/.0-9]*", ""); + String versionCode = versionName.substring(0,8); String platformName = ctx.queryParam("platform"); // Determine the region list to use based on the version and platform. if ("CNRELiOS".equals(versionCode) || "CNRELWin".equals(versionCode) - || "CNRELAndroid".equals(versionCode)) { + || "CNRELAnd".equals(versionCode)) { // Use the CN region list. QueryAllRegionsEvent event = new QueryAllRegionsEvent(regionListResponseCN); event.call(); @@ -191,7 +191,7 @@ public final class RegionHandler implements Router { ctx.result(event.getRegionList()); } else if ("OSRELiOS".equals(versionCode) || "OSRELWin".equals(versionCode) - || "OSRELAndroid".equals(versionCode)) { + || "OSRELAnd".equals(versionCode)) { // Use the OS region list. QueryAllRegionsEvent event = new QueryAllRegionsEvent(regionListResponse); event.call();