read heartbeats from queueing players
This commit is contained in:
parent
af9b287252
commit
9beb0c989e
@ -197,6 +197,14 @@ func (s *Server) Queue(w http.ResponseWriter, r *http.Request) {
|
||||
func (s *Server) joinAndServe(p person) {
|
||||
slog.Debug("joining", "player", p.id)
|
||||
ctx, stop := context.WithTimeoutCause(context.Background(), 10*time.Minute, errQueueEmpty)
|
||||
go func() {
|
||||
for {
|
||||
_, _, err := p.conn.Read(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
id, chall, deal := s.l.Queue(ctx, p.id)
|
||||
stop()
|
||||
if id == (lobby.GameID{}) {
|
||||
|
Loading…
Reference in New Issue
Block a user