func (r *Runner) handleSocketMessage(ctx context.Context, m message.Message, out chan<- message.Message) {
	if err := r.validateSocketMessage(m); err != nil {
		r.log.Printf("invalid message from socket: %v: %v", err, m)
		return
	}
	switch m.Type {
	case message.SocketClose:
		r.removeSocket(ctx, m)
	case message.LeaveGame:
		r.leaveGame(ctx, m)
	default:
		message.Send(m, out, r.Debug, r.log)
	}
}
// handleSocketMessage writes the socket message to to the out channel, possibly taking action.
handleSocketMessage writes the socket message to to the out channel, possibly taking action.
// handleSocketMessage writes the socket message to to the out channel possibly taking action .
func (r *Runner) handleSocketMessage(ctx context.Context, m message.Message, out chan<- message.Message) {
	if err := r.validateSocketMessage(m); err != nil {
		r.log.Printf("invalid message from socket: %v: %v", err, m)
		return
	}
	switch m.Type {
	case message.SocketClose:
		r.removeSocket(ctx, m)
	case message.LeaveGame:
		r.leaveGame(ctx, m)
	default:
		message.Send(m, out, r.Debug, r.log)
	}
}
func ( r * Runner ) handleSocketMessage ( ctx context . Context , m message . Message , out chan <- message . Message ) { if err := r . validateSocketMessage ( m ) ; err != nil { r . log . Printf ( " " , err , m ) return } switch m . Type { case message . SocketClose : r . removeSocket ( ctx , m ) case message . LeaveGame : r . leaveGame ( ctx , m ) default : message . Send ( m , out , r . Debug , r . log ) } }
handleSocketMessage writes the socket message to to the out channel, possibly taking action.
handleSocketMessage writes the socket message to to the out channel possibly taking action .