-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserver.go
More file actions
59 lines (55 loc) · 2.23 KB
/
Copy pathserver.go
File metadata and controls
59 lines (55 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Package main is the entry point for StationeersServerUI, a tool for managing Stationeers servers.
// It coordinates setup, configuration, logging, resource loading, and a web-based UI.
//
// The server initializes by running the setup process, loading resources, and starting a web server.
// Key functionality is provided by the following subpackages:
// - src/config: Manages server configuration.
// - src/configchanger: Handles configuration changes.
// - src/gamemgr: Manages process management.
// - src/loader: Handles resource loading and detection initialization.
// - src/logger: Provides logging utilities.
// - src/setup: Performs initial server setup.
// - src/web: Runs the web-based user interface.
// - src/discordbot: Handles Discord bot functionality.
// - src/backupmgr: Manages backups of the server's world.
// - src/detectionmgr: Manages event detection and processing.
// - src/setup: Performs initial server setup.
// - src/ssestream: Handles Server-Sent Events (SSE) streaming.
// - src/security: Handles security-related tasks.
//
// For detailed documentation, see the subpackages or the project Wiki on GitHub.
package main
import (
"embed"
"sync"
"github.com/JacksonTheMaster/StationeersServerUI/v5/src/cli"
"github.com/JacksonTheMaster/StationeersServerUI/v5/src/core/loader"
"github.com/JacksonTheMaster/StationeersServerUI/v5/src/logger"
"github.com/JacksonTheMaster/StationeersServerUI/v5/src/setup"
"github.com/JacksonTheMaster/StationeersServerUI/v5/src/web"
)
//go:embed UIMod/onboard_bundled
var v1uiFS embed.FS
func main() {
var wg sync.WaitGroup
logger.ConfigureConsole()
loader.ParseFlags()
loader.HandleSanityCheckFlag()
loader.SanityCheck()
logger.Main.Info("Initializing resources...")
loader.InitVirtFS(v1uiFS)
logger.Install.Info("Starting setup...")
loader.ReloadConfig() // Load the config file before starting the setup process
loader.HandleFlags()
setup.Install(&wg)
wg.Wait()
logger.Main.Debug("Initializing Backend...")
loader.InitBackend()
logger.Main.Debug("Starting webserver...")
web.StartWebServer(&wg)
logger.Main.Debug("Initializing after start tasks...")
loader.AfterStartComplete()
logger.Main.Debug("Initializing SSUICLI...")
cli.StartConsole(&wg)
wg.Wait()
}