Add support for headless
This commit is contained in:
parent
0ba96ca478
commit
0a42b24f09
7
main.go
7
main.go
@ -159,14 +159,17 @@ var worldLock sync.Mutex
|
|||||||
var totalRenderTime, totalGameLogicCatchUp, totalNormalGameLogic, totalTicking, totalScalingTime, totalRemotePlayerUpdate, tickCount, totalFrameTime, frameCount uint64
|
var totalRenderTime, totalGameLogicCatchUp, totalNormalGameLogic, totalTicking, totalScalingTime, totalRemotePlayerUpdate, tickCount, totalFrameTime, frameCount uint64
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
initializeSDL()
|
|
||||||
defer sdl.Quit()
|
|
||||||
configX, err := loadOrCreateConfig("config.json")
|
configX, err := loadOrCreateConfig("config.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
serverConfig = configX.ServerConfig
|
serverConfig = configX.ServerConfig
|
||||||
config = configX
|
config = configX
|
||||||
|
|
||||||
|
if !(config.Server && !config.DoKeymapPlayer && !config.DoJoyStickPlayers && !config.DoAllKeymapsPlayers && !config.MapWindow) {
|
||||||
|
initializeSDL()
|
||||||
|
defer sdl.Quit()
|
||||||
|
}
|
||||||
if config.ProfilerOn {
|
if config.ProfilerOn {
|
||||||
f, err := os.Create("cpuprofile")
|
f, err := os.Create("cpuprofile")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user