func (w *WebSocketTestSuite) SetupTest() {
	var err error

	w.message = make(map[string]interface{})
	w.conn = db.Pool.Get()
	w.conn.Do("FLUSHDB")
	w.ws, err = w.Dial()
	if err != nil {
		log.Fatal(err)
	}

	cfg.Load()
	cfg.Twitter.SecureLogin = false
	InitLeaderboard(leaderboard.New())
}
Exemple #2
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()
}
func initLeaderboard() *leaderboard.Leaderboard {
	l := leaderboard.New()
	l.Add(&leaderboard.Player{Username: "******", Planets: 10})
	l.Add(&leaderboard.Player{Username: "******", Planets: 8})
	return l
}