func (r *Runner) leaveGame(ctx context.Context, m message.Message) {
	playerGames, ok := r.playerGames[m.PlayerName]
	if !ok {
		return
	}
	switch {
	case m.Game != nil:
		delete(playerGames, m.Game.ID)
	case len(m.Addr) != 0:
		for gID, addr := range playerGames {
			if addr == m.Addr {
				delete(playerGames, gID)
				break
			}
		}
	}
	if len(playerGames) == 0 {
		delete(r.playerGames, m.PlayerName)
	}
}
// leaveGame removes the socket from any game it is in.
leaveGame removes the socket from any game it is in.
// leaveGame removes the socket from any game it is in .
func (r *Runner) leaveGame(ctx context.Context, m message.Message) {
	playerGames, ok := r.playerGames[m.PlayerName]
	if !ok {
		return
	}
	switch {
	case m.Game != nil:
		delete(playerGames, m.Game.ID)
	case len(m.Addr) != 0:
		for gID, addr := range playerGames {
			if addr == m.Addr {
				delete(playerGames, gID)
				break
			}
		}
	}
	if len(playerGames) == 0 {
		delete(r.playerGames, m.PlayerName)
	}
}
func ( r * Runner ) leaveGame ( ctx context . Context , m message . Message ) { playerGames , ok := r . playerGames [ m . PlayerName ] if ! ok { return } switch { case m . Game != nil : delete ( playerGames , m . Game . ID ) case len ( m . Addr ) != 0 : for gID , addr := range playerGames { if addr == m . Addr { delete ( playerGames , gID ) break } } } if len ( playerGames ) == 0 { delete ( r . playerGames , m . PlayerName ) } }
leaveGame removes the socket from any game it is in.
leaveGame removes the socket from any game it is in .