If you want to stay and resist:

Go all food-production if you're not already and build a few warehouses. This will allow you, if you close your gates at night, to keep your army from being killed from attacks and also it will keep them from starving (up to a certain size of army).

Now it depends on how aggressive the player is. If they are going to try to zero you, it won't matter - they will keep attacking until your loyalty is 5, gates open, and they can kill the army.

But if it's just stealing resources, at least you can keep enough of an army e.g. to farming 5s during the day. Then just use all of those resources before you get off for the night, either putting it into troop production (make sure the troops don't finish cooking until when you'll be online the next day) or building up, etc.

That will be a start