예제 #1
0
func main() {
	cfg.Load()
	db.InitPool(cfg.Database.Host, cfg.Database.Port, 8)
	server.ExportConfig(cfg)
	server.InitLeaderboard(leaderboard.New())
	server.SpawnDbMissions()

	s := server.NewServer(
		cfg.Server.Host,
		cfg.Server.Port,
	)
	go final(s)

	s.Start()
}
예제 #2
0
func init() {
	var cfg config.Config
	cfg.Load()
	db.InitPool(cfg.Database.Host, cfg.Database.Port, 13)
	conn := db.Pool.Get()
	defer conn.Close()

	conn.Do("FLUSHDB")
	testServer = NewServer(
		cfg.Server.Host,
		7013,
	)

	go testServer.Start()
	for !testServer.isRunning {
		time.Sleep(100 * time.Millisecond)
	}
}