mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 00:15:08 +01:00
make launcher server optional
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
"devmode": true,
|
"devmode": true,
|
||||||
"devmodeoptions": {
|
"devmodeoptions": {
|
||||||
"serverName" : "",
|
"serverName" : "",
|
||||||
|
"EnableLauncherServer": false,
|
||||||
"hideLoginNotice": false,
|
"hideLoginNotice": false,
|
||||||
"loginNotice": "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9 (Patch 1)!<BR><BODY><LEFT><SIZE_2><C_5>Erupe is experimental software<C_7>, we are not liable for any<BR><BODY>issues caused by installing the software!<BR><BODY><BR><BODY><C_4>■Report bugs on Discord!<C_7><BR><BODY><BR><BODY><C_4>■Test everything!<C_7><BR><BODY><BR><BODY><C_4>■Don't talk to softlocking NPCs!<C_7><BR><BODY><BR><BODY><C_4>■Fork the code on GitHub!<C_7><BR><BODY><BR><BODY>Thank you to all of the contributors,<BR><BODY><BR><BODY>this wouldn't exist without you.",
|
"loginNotice": "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9 (Patch 1)!<BR><BODY><LEFT><SIZE_2><C_5>Erupe is experimental software<C_7>, we are not liable for any<BR><BODY>issues caused by installing the software!<BR><BODY><BR><BODY><C_4>■Report bugs on Discord!<C_7><BR><BODY><BR><BODY><C_4>■Test everything!<C_7><BR><BODY><BR><BODY><C_4>■Don't talk to softlocking NPCs!<C_7><BR><BODY><BR><BODY><C_4>■Fork the code on GitHub!<C_7><BR><BODY><BR><BODY>Thank you to all of the contributors,<BR><BODY><BR><BODY>this wouldn't exist without you.",
|
||||||
"cleandb": false,
|
"cleandb": false,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ type Config struct {
|
|||||||
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
||||||
type DevModeOptions struct {
|
type DevModeOptions struct {
|
||||||
ServerName string // To get specific instance server about (Current Players/Event Week)
|
ServerName string // To get specific instance server about (Current Players/Event Week)
|
||||||
|
EnableLauncherServer bool // Enables the launcher server to be served on port 80
|
||||||
HideLoginNotice bool // Hide the Erupe notice on login
|
HideLoginNotice bool // Hide the Erupe notice on login
|
||||||
LoginNotice string // MHFML string of the login notice displayed
|
LoginNotice string // MHFML string of the login notice displayed
|
||||||
CleanDB bool // Automatically wipes the DB on server reset.
|
CleanDB bool // Automatically wipes the DB on server reset.
|
||||||
|
|||||||
7
main.go
7
main.go
@@ -125,7 +125,9 @@ func main() {
|
|||||||
// Now start our server(s).
|
// Now start our server(s).
|
||||||
|
|
||||||
// Launcher HTTP server.
|
// Launcher HTTP server.
|
||||||
launcherServer := launcherserver.NewServer(
|
var launcherServer *launcherserver.Server
|
||||||
|
if erupeConfig.DevMode && erupeConfig.DevModeOptions.EnableLauncherServer {
|
||||||
|
launcherServer = launcherserver.NewServer(
|
||||||
&launcherserver.Config{
|
&launcherserver.Config{
|
||||||
Logger: logger.Named("launcher"),
|
Logger: logger.Named("launcher"),
|
||||||
ErupeConfig: erupeConfig,
|
ErupeConfig: erupeConfig,
|
||||||
@@ -137,6 +139,7 @@ func main() {
|
|||||||
preventClose(fmt.Sprintf("Failed to start launcher server: %s", err.Error()))
|
preventClose(fmt.Sprintf("Failed to start launcher server: %s", err.Error()))
|
||||||
}
|
}
|
||||||
logger.Info("Started launcher server")
|
logger.Info("Started launcher server")
|
||||||
|
}
|
||||||
|
|
||||||
// Entrance server.
|
// Entrance server.
|
||||||
entranceServer := entranceserver.NewServer(
|
entranceServer := entranceserver.NewServer(
|
||||||
@@ -219,7 +222,9 @@ func main() {
|
|||||||
}
|
}
|
||||||
signServer.Shutdown()
|
signServer.Shutdown()
|
||||||
entranceServer.Shutdown()
|
entranceServer.Shutdown()
|
||||||
|
if erupeConfig.DevModeOptions.EnableLauncherServer {
|
||||||
launcherServer.Shutdown()
|
launcherServer.Shutdown()
|
||||||
|
}
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user