Skip to content

Commit

Permalink
Update RegionHandler.java (#2295)
Browse files Browse the repository at this point in the history
Who decided to regex it like that???
  • Loading branch information
CerisWhite authored Aug 20, 2023
1 parent b8fd2e2 commit 2b0f2f7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,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 @@ -191,7 +191,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

1 comment on commit 2b0f2f7

@TotallyNotOndre
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG NO WEI GIVE THIS MAN A HEAD ADMIN ROLE!!!!!

Please sign in to comment.