mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 03:42:55 +00:00
Merge pull request #126 from omg-xtao/development
Add PublicPort field to Dispatch server
This commit is contained in:
commit
5100729a5a
@ -27,6 +27,7 @@ public final class Config {
|
|||||||
public String Ip = "0.0.0.0";
|
public String Ip = "0.0.0.0";
|
||||||
public String PublicIp = "127.0.0.1";
|
public String PublicIp = "127.0.0.1";
|
||||||
public int Port = 443;
|
public int Port = 443;
|
||||||
|
public int PublicPort = 0;
|
||||||
public String KeystorePath = "./keystore.p12";
|
public String KeystorePath = "./keystore.p12";
|
||||||
public String KeystorePassword = "";
|
public String KeystorePassword = "";
|
||||||
public Boolean UseSSL = true;
|
public Boolean UseSSL = true;
|
||||||
@ -53,6 +54,7 @@ public final class Config {
|
|||||||
public String Ip = "0.0.0.0";
|
public String Ip = "0.0.0.0";
|
||||||
public String PublicIp = "127.0.0.1";
|
public String PublicIp = "127.0.0.1";
|
||||||
public int Port = 22102;
|
public int Port = 22102;
|
||||||
|
public int PublicPort = 0;
|
||||||
|
|
||||||
public String DispatchServerDatabaseUrl = "mongodb://localhost:27017";
|
public String DispatchServerDatabaseUrl = "mongodb://localhost:27017";
|
||||||
public String DispatchServerDatabaseCollection = "grasscutter";
|
public String DispatchServerDatabaseCollection = "grasscutter";
|
||||||
|
@ -101,14 +101,14 @@ public final class DispatchServer {
|
|||||||
.setName("os_usa")
|
.setName("os_usa")
|
||||||
.setTitle(Grasscutter.getConfig().getGameServerOptions().Name)
|
.setTitle(Grasscutter.getConfig().getGameServerOptions().Name)
|
||||||
.setType("DEV_PUBLIC")
|
.setType("DEV_PUBLIC")
|
||||||
.setDispatchUrl("http" + (Grasscutter.getConfig().getDispatchOptions().FrontHTTPS ? "s" : "") + "://" + (Grasscutter.getConfig().getDispatchOptions().PublicIp.isEmpty() ? Grasscutter.getConfig().getDispatchOptions().Ip : Grasscutter.getConfig().getDispatchOptions().PublicIp) + ":" + getAddress().getPort() + "/query_cur_region_" + defaultServerName)
|
.setDispatchUrl("http" + (Grasscutter.getConfig().getDispatchOptions().FrontHTTPS ? "s" : "") + "://" + (Grasscutter.getConfig().getDispatchOptions().PublicIp.isEmpty() ? Grasscutter.getConfig().getDispatchOptions().Ip : Grasscutter.getConfig().getDispatchOptions().PublicIp) + ":" + (Grasscutter.getConfig().getDispatchOptions().PublicPort != 0 ? Grasscutter.getConfig().getDispatchOptions().PublicPort : Grasscutter.getConfig().getDispatchOptions().Port) + "/query_cur_region_" + defaultServerName)
|
||||||
.build();
|
.build();
|
||||||
usedNames.add(defaultServerName);
|
usedNames.add(defaultServerName);
|
||||||
servers.add(server);
|
servers.add(server);
|
||||||
|
|
||||||
RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder()
|
RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder()
|
||||||
.setIp((Grasscutter.getConfig().getGameServerOptions().PublicIp.isEmpty() ? Grasscutter.getConfig().getGameServerOptions().Ip : Grasscutter.getConfig().getGameServerOptions().PublicIp))
|
.setIp((Grasscutter.getConfig().getGameServerOptions().PublicIp.isEmpty() ? Grasscutter.getConfig().getGameServerOptions().Ip : Grasscutter.getConfig().getGameServerOptions().PublicIp))
|
||||||
.setPort(Grasscutter.getConfig().getGameServerOptions().Port)
|
.setPort(Grasscutter.getConfig().getGameServerOptions().PublicPort != 0 ? Grasscutter.getConfig().getGameServerOptions().PublicPort : Grasscutter.getConfig().getGameServerOptions().Port)
|
||||||
.setSecretKey(ByteString.copyFrom(FileUtils.read(Grasscutter.getConfig().KEY_FOLDER + "dispatchSeed.bin")))
|
.setSecretKey(ByteString.copyFrom(FileUtils.read(Grasscutter.getConfig().KEY_FOLDER + "dispatchSeed.bin")))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
|
|||||||
|
|
||||||
RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder()
|
RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder()
|
||||||
.setIp((Grasscutter.getConfig().getGameServerOptions().PublicIp.isEmpty() ? Grasscutter.getConfig().getGameServerOptions().Ip : Grasscutter.getConfig().getGameServerOptions().PublicIp))
|
.setIp((Grasscutter.getConfig().getGameServerOptions().PublicIp.isEmpty() ? Grasscutter.getConfig().getGameServerOptions().Ip : Grasscutter.getConfig().getGameServerOptions().PublicIp))
|
||||||
.setPort(Grasscutter.getConfig().getGameServerOptions().Port)
|
.setPort(Grasscutter.getConfig().getGameServerOptions().PublicPort != 0 ? Grasscutter.getConfig().getGameServerOptions().PublicPort : Grasscutter.getConfig().getGameServerOptions().Port)
|
||||||
.setSecretKey(ByteString.copyFrom(FileUtils.read(Grasscutter.getConfig().KEY_FOLDER + "dispatchSeed.bin")))
|
.setSecretKey(ByteString.copyFrom(FileUtils.read(Grasscutter.getConfig().KEY_FOLDER + "dispatchSeed.bin")))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user