Skip to content

Commit

Permalink
Update RegionHandler.java (Grasscutters#2295)
Browse files Browse the repository at this point in the history
Who decided to regex it like that???
  • Loading branch information
CerisWhite authored and Simplxss committed Aug 21, 2023
1 parent 088d00e commit cd369a6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ private static void queryRegionList(Context ctx) {
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();
Expand All @@ -189,7 +189,7 @@ private static void queryRegionList(Context ctx) {
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();
Expand Down

0 comments on commit cd369a6

Please sign in to comment.