Refactor dispatch (now called HTTP) server (pt. 1)

This commit is contained in:
KingRainbow44
2022-05-13 11:39:40 -04:00
parent a0067b664e
commit 840f4706b5
17 changed files with 828 additions and 67 deletions

View File

@@ -96,8 +96,10 @@ public class ConfigContainer {
public ServerDebugMode debugLevel = ServerDebugMode.NONE;
public ServerRunMode runMode = ServerRunMode.HYBRID;
public Dispatch dispatch = new Dispatch();
public HTTP http = new HTTP();
public Game game = new Game();
public Dispatch dispatch = new Dispatch();
}
public static class Language {
@@ -111,8 +113,8 @@ public class ConfigContainer {
}
/* Server options. */
public static class Dispatch {
public static class HTTP {
public String bindAddress = "0.0.0.0";
/* This is the address used in URLs. */
public String accessAddress = "127.0.0.1";
@@ -120,12 +122,9 @@ public class ConfigContainer {
public int bindPort = 443;
/* This is the port used in URLs. */
public int accessPort = 0;
public Encryption encryption = new Encryption();
public Policies policies = new Policies();
public Region[] regions = {};
public String defaultName = "Grasscutter";
}
public static class Game {
@@ -144,6 +143,12 @@ public class ConfigContainer {
/* Data containers. */
public static class Dispatch {
public Region[] regions = {};
public String defaultName = "Grasscutter";
}
public static class Encryption {
public boolean useEncryption = true;
/* Should 'https' be appended to URLs? */
@@ -226,6 +231,18 @@ public class ConfigContainer {
/* Objects. */
public static class Region {
public Region() { }
public Region(
String name, String title,
String address, int port
) {
this.Name = name;
this.Title = title;
this.Ip = address;
this.Port = port;
}
public String Name = "os_usa";
public String Title = "Grasscutter";
public String Ip = "127.0.0.1";