mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-19 17:19:58 +02:00
Cleanup + Bump version to 1.1.0
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ java {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
version = '1.0.1'
|
version = '1.1.0'
|
||||||
|
|
||||||
var shouldGenerateProto = System.getenv("GENERATE_PROTO") == "true"
|
var shouldGenerateProto = System.getenv("GENERATE_PROTO") == "true"
|
||||||
System.out.println(shouldGenerateProto ? "Generating proto files" : "Skipping proto generation")
|
System.out.println(shouldGenerateProto ? "Generating proto files" : "Skipping proto generation")
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class Nebula {
|
|||||||
|
|
||||||
// Start servers
|
// Start servers
|
||||||
try {
|
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 = new HttpServer(serverType);
|
||||||
httpServer.start();
|
httpServer.start();
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import java.util.List;
|
|||||||
import dev.morphia.annotations.Entity;
|
import dev.morphia.annotations.Entity;
|
||||||
|
|
||||||
import emu.nebula.GameConstants;
|
import emu.nebula.GameConstants;
|
||||||
import emu.nebula.Nebula;
|
|
||||||
import emu.nebula.data.GameData;
|
import emu.nebula.data.GameData;
|
||||||
import emu.nebula.data.resources.PotentialDef;
|
import emu.nebula.data.resources.PotentialDef;
|
||||||
import emu.nebula.data.resources.StarTowerDef;
|
import emu.nebula.data.resources.StarTowerDef;
|
||||||
|
|||||||
@@ -50,15 +50,15 @@ public class HttpServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private HttpConnectionFactory getHttpFactory() {
|
private HttpConnectionFactory getHttpFactory() {
|
||||||
HttpConfiguration httpsConfig = new HttpConfiguration();
|
var httpsConfig = new HttpConfiguration();
|
||||||
SecureRequestCustomizer src = new SecureRequestCustomizer();
|
var src = new SecureRequestCustomizer();
|
||||||
src.setSniHostCheck(false);
|
src.setSniHostCheck(false);
|
||||||
httpsConfig.addCustomizer(src);
|
httpsConfig.addCustomizer(src);
|
||||||
return new HttpConnectionFactory(httpsConfig);
|
return new HttpConnectionFactory(httpsConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SslContextFactory.Server getSSLContextFactory() {
|
private SslContextFactory.Server getSSLContextFactory() {
|
||||||
SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
|
var sslContextFactory = new SslContextFactory.Server();
|
||||||
sslContextFactory.setKeyStorePath(Nebula.getConfig().getKeystore().getPath());
|
sslContextFactory.setKeyStorePath(Nebula.getConfig().getKeystore().getPath());
|
||||||
sslContextFactory.setKeyStorePassword(Nebula.getConfig().getKeystore().getPassword());
|
sslContextFactory.setKeyStorePassword(Nebula.getConfig().getKeystore().getPassword());
|
||||||
sslContextFactory.setSniRequired(false);
|
sslContextFactory.setSniRequired(false);
|
||||||
@@ -102,23 +102,29 @@ public class HttpServer {
|
|||||||
// Start server
|
// Start server
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
if (this.started)
|
if (this.started) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.started = true;
|
this.started = true;
|
||||||
|
|
||||||
// Http server
|
// Http server
|
||||||
if (getServerConfig().isUseSSL()) {
|
if (getServerConfig().isUseSSL()) {
|
||||||
ServerConnector sslConnector = new ServerConnector(getApp().jettyServer().server(), getSSLContextFactory(),
|
ServerConnector sslConnector = new ServerConnector(getApp().jettyServer().server(), getSSLContextFactory(), getHttpFactory());
|
||||||
getHttpFactory());
|
|
||||||
sslConnector.setHost(getServerConfig().getBindAddress());
|
sslConnector.setHost(getServerConfig().getBindAddress());
|
||||||
sslConnector.setPort(getServerConfig().getBindPort());
|
sslConnector.setPort(getServerConfig().getBindPort());
|
||||||
getApp().jettyServer().server().addConnector(sslConnector);
|
getApp().jettyServer().server().addConnector(sslConnector);
|
||||||
|
|
||||||
getApp().start();
|
getApp().start();
|
||||||
} else {
|
} else {
|
||||||
getApp().start(getServerConfig().getBindAddress(), getServerConfig().getBindPort());
|
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
|
// Done
|
||||||
Nebula.getLogger().info("Http Server started on " + getServerConfig().getBindPort());
|
Nebula.getLogger().info("Http Server started on " + getServerConfig().getBindPort());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user