mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-12 20:34:36 +01:00
Cleanup + Bump version to 1.1.0
This commit is contained in:
@@ -29,7 +29,7 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
version = '1.0.1'
|
||||
version = '1.1.0'
|
||||
|
||||
var shouldGenerateProto = System.getenv("GENERATE_PROTO") == "true"
|
||||
System.out.println(shouldGenerateProto ? "Generating proto files" : "Skipping proto generation")
|
||||
|
||||
@@ -109,7 +109,7 @@ public class Nebula {
|
||||
|
||||
// Start servers
|
||||
try {
|
||||
// Always run http server as it is needed by for dispatch and gateserver
|
||||
// Always run http server as it is needed by for login and game server
|
||||
httpServer = new HttpServer(serverType);
|
||||
httpServer.start();
|
||||
} catch (Exception exception) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.List;
|
||||
import dev.morphia.annotations.Entity;
|
||||
|
||||
import emu.nebula.GameConstants;
|
||||
import emu.nebula.Nebula;
|
||||
import emu.nebula.data.GameData;
|
||||
import emu.nebula.data.resources.PotentialDef;
|
||||
import emu.nebula.data.resources.StarTowerDef;
|
||||
|
||||
@@ -50,15 +50,15 @@ public class HttpServer {
|
||||
}
|
||||
|
||||
private HttpConnectionFactory getHttpFactory() {
|
||||
HttpConfiguration httpsConfig = new HttpConfiguration();
|
||||
SecureRequestCustomizer src = new SecureRequestCustomizer();
|
||||
var httpsConfig = new HttpConfiguration();
|
||||
var src = new SecureRequestCustomizer();
|
||||
src.setSniHostCheck(false);
|
||||
httpsConfig.addCustomizer(src);
|
||||
return new HttpConnectionFactory(httpsConfig);
|
||||
}
|
||||
|
||||
private SslContextFactory.Server getSSLContextFactory() {
|
||||
SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
|
||||
var sslContextFactory = new SslContextFactory.Server();
|
||||
sslContextFactory.setKeyStorePath(Nebula.getConfig().getKeystore().getPath());
|
||||
sslContextFactory.setKeyStorePassword(Nebula.getConfig().getKeystore().getPassword());
|
||||
sslContextFactory.setSniRequired(false);
|
||||
@@ -102,23 +102,29 @@ public class HttpServer {
|
||||
// Start server
|
||||
|
||||
public void start() {
|
||||
if (this.started)
|
||||
if (this.started) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.started = true;
|
||||
|
||||
// Http server
|
||||
if (getServerConfig().isUseSSL()) {
|
||||
ServerConnector sslConnector = new ServerConnector(getApp().jettyServer().server(), getSSLContextFactory(),
|
||||
getHttpFactory());
|
||||
ServerConnector sslConnector = new ServerConnector(getApp().jettyServer().server(), getSSLContextFactory(), getHttpFactory());
|
||||
sslConnector.setHost(getServerConfig().getBindAddress());
|
||||
sslConnector.setPort(getServerConfig().getBindPort());
|
||||
getApp().jettyServer().server().addConnector(sslConnector);
|
||||
|
||||
getApp().start();
|
||||
} else {
|
||||
getApp().start(getServerConfig().getBindAddress(), getServerConfig().getBindPort());
|
||||
}
|
||||
|
||||
|
||||
if (type.runGame()) {
|
||||
Nebula.getLogger().info("Nebula PS is free server software.");
|
||||
Nebula.getLogger().info("Github: https://github.com/Melledy/Nebula");
|
||||
Nebula.getLogger().info("Discord: https://discord.gg/cskCWBqdJk");
|
||||
}
|
||||
|
||||
// Done
|
||||
Nebula.getLogger().info("Http Server started on " + getServerConfig().getBindPort());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user