[FEATURE] nettyAddress

This commit is contained in:
Gravit 2019-02-20 17:20:00 +07:00
parent 57fc3b1c04
commit 2fa638d3c6
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
4 changed files with 18 additions and 0 deletions

View file

@ -188,6 +188,7 @@ public class NettyConfig
public boolean clientEnabled;
public String launcherURL;
public String launcherEXEURL;
public String address;
}
public class GuardLicenseConf
{

View file

@ -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 = ");

View file

@ -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);

View file

@ -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;