The grammar of ~ておりやした
I was watching the さらい屋五葉 anime, and there was a phrase in one of the episodes: 子供と遊んでおりやした, which was translated as "He was playing with a kid." Could you please explain the grammar behind 遊んでおりやした? I know that 遊んで is the "te-form" of 遊ぶ, but could you please break down the rest for me?