Exemple #1
0
func run() {
	os.MkdirAll("data", os.ModePerm)
	d, err := db.NewDb("data/game.db")
	if err != nil {
		log.Println("Can't open DB:", err)
		time.Sleep(100 * time.Millisecond)
		return
	}
	defer d.Close()

	flag.StringVar(&adminToken, "token", adminToken, "admin token")

	srv.LoadConfig()
	InitPlayerMgr()
	StartWeb()
	RunTests()
	srv.WaitForServers()
	srv.SaveState()
	time.Sleep(10 * time.Millisecond) //logger cooldown
}
Exemple #2
0
func SetAutoRestart(val bool) {
	srv.GetState().OSet("auto_restart", val)
	srv.SaveState()
}