Пример #1
0
func New(c net.Conn) *Player {
	return &Player{
		net:   c,
		Conn:  c,
		since: time.Now().Unix(),
		eid:   id.Get(),
	}
}
Пример #2
0
func (s *Server) doTick() {
	// This id *NEVER* gets released
	s.AddTicker(id.Get(), s)
	for _ = range time.Tick(50 * time.Millisecond) {
		s.TickAll(s.ticks)
		s.ticks++
	}
}