Online Yet Attacked

Today, I opened Royal Revolt 2 and I saw 2 crossed swords on the top left of the screen. When I clicked on it, it said I was being attacked. How is this possible as I was online?

The attack started just before you got online and was still in progress, hence the swords in the corner.

Thanx for the help.