Skip to content

Commit

Permalink
Support ~region(us) format
Browse files Browse the repository at this point in the history
  • Loading branch information
yanorei32 committed Jun 18, 2021
1 parent c08e8ba commit 8592894
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ public string IdWithoutWorldId {
continue;

switch (this.Region) {
case ServerRegion.US:
id += "";
break;

case ServerRegion.USWithIdentifier:
id += "~region(us)";
break;

case ServerRegion.JP:
id += "~region(jp)";
break;
Expand All @@ -49,10 +57,6 @@ public string IdWithoutWorldId {
id += "~region(eu)";
break;

case ServerRegion.US:
id += "";
break;

case ServerRegion.Custom:
id += "~region(" + this.CustomRegion + ")";
break;
Expand Down Expand Up @@ -126,6 +130,7 @@ public string RegionName {
get {
switch (this.Region) {
case ServerRegion.US:
case ServerRegion.USWithIdentifier:
return "US";
case ServerRegion.EU:
return "EU";
Expand Down Expand Up @@ -252,6 +257,10 @@ void parseId(string id) {
argumentPositions[InstanceArgument.Region] = i * 10;

switch (pValue) {
case "us":
this.Region = ServerRegion.USWithIdentifier;
break;

case "eu":
this.Region = ServerRegion.EU;
break;
Expand Down
1 change: 1 addition & 0 deletions src/ServerRegion.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
enum ServerRegion {
US,
USWithIdentifier,
EU,
JP,
Custom,
Expand Down

0 comments on commit 8592894

Please sign in to comment.