mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-09 09:09:46 +03:00
[FEATURE] nettyAddress
This commit is contained in:
parent
57fc3b1c04
commit
2fa638d3c6
4 changed files with 18 additions and 0 deletions
|
@ -188,6 +188,7 @@ public class NettyConfig
|
|||
public boolean clientEnabled;
|
||||
public String launcherURL;
|
||||
public String launcherEXEURL;
|
||||
public String address;
|
||||
}
|
||||
public class GuardLicenseConf
|
||||
{
|
||||
|
|
|
@ -70,6 +70,11 @@ public void setAddress(String address) {
|
|||
body.append(address);
|
||||
body.append("\";");
|
||||
}
|
||||
public void setNettyAddress(String address) {
|
||||
body.append("this.nettyAddress = \"");
|
||||
body.append(address);
|
||||
body.append("\";");
|
||||
}
|
||||
|
||||
public void setProjectName(String name) {
|
||||
body.append("this.projectname = \"");
|
||||
|
@ -134,6 +139,11 @@ public void setDownloadJava(boolean b) {
|
|||
body.append(b ? "true" : "false");
|
||||
body.append(";");
|
||||
}
|
||||
public void setNettyEnabled(boolean b) {
|
||||
body.append("this.isNettyEnabled = ");
|
||||
body.append(b ? "true" : "false");
|
||||
body.append(";");
|
||||
}
|
||||
|
||||
public void setWarningMissArchJava(boolean b) {
|
||||
body.append("this.isWarningMissArchJava = ");
|
||||
|
|
|
@ -130,14 +130,19 @@ public Path process(Path inputJar) throws IOException {
|
|||
server.buildHookManager.hook(context);
|
||||
jaConfigurator.setAddress(server.config.getAddress());
|
||||
jaConfigurator.setPort(server.config.port);
|
||||
jaConfigurator.setNettyEnabled(server.config.netty.clientEnabled);
|
||||
if(server.config.netty.clientEnabled)
|
||||
{
|
||||
jaConfigurator.setNettyPort(server.config.netty.port);
|
||||
jaConfigurator.setNettyAddress(server.config.netty.address);
|
||||
}
|
||||
if(server.config.guardLicense != null)
|
||||
jaConfigurator.setGuardLicense(server.config.guardLicense.name, server.config.guardLicense.key, server.config.guardLicense.encryptKey);
|
||||
jaConfigurator.setProjectName(server.config.projectName);
|
||||
jaConfigurator.setSecretKey(SecurityHelper.randomStringAESKey());
|
||||
jaConfigurator.setClientPort(32148 + SecurityHelper.newRandom().nextInt(512));
|
||||
jaConfigurator.setUsingWrapper(server.config.isUsingWrapper);
|
||||
jaConfigurator.setWarningMissArchJava(server.config.isWarningMissArchJava);
|
||||
jaConfigurator.setDownloadJava(server.config.isDownloadJava);
|
||||
jaConfigurator.setEnv(server.config.env);
|
||||
server.buildHookManager.registerAllClientModuleClass(jaConfigurator);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
public class AutogenConfig {
|
||||
public String projectname;
|
||||
public String address;
|
||||
public String nettyAddress;
|
||||
public int port;
|
||||
public int nettyPort;
|
||||
public int clientPort;
|
||||
|
@ -10,6 +11,7 @@ public class AutogenConfig {
|
|||
private boolean isInitModules;
|
||||
public boolean isUsingWrapper;
|
||||
public boolean isDownloadJava; //Выставление этого флага требует модификации runtime части
|
||||
public boolean isNettyEnabled;
|
||||
public String secretKeyClient;
|
||||
public String guardLicenseName;
|
||||
public String guardLicenseKey;
|
||||
|
|
Loading…
Reference in a new issue