There isn't really a great way to handle this. If you allow a truly persistent world...then you should be able to be attacked while logged off the game.
All of us have to wake up for work, school, and so on - we really didn`t want to add the stress to wake up and see your town in ruins
Dawn of Fantasy is persistent in all aspects of gameplay other than PvP. Player vs Player or AI vs Player combat is only allowed while your online - and feeling up for a 20+ minute battle.
Otherwise - as have been mentioned in this post - you could simply pay off the attacker - spending some of your hard-earned resourced for an hour without PvP.
Sure - some may say this is not entirely realistic - but there is so much more you could do in the Dawn of Fantasy world - outside of PvP, that we`d rather have you thinking about - the next PvP or PvE battle, fortification upgrade or a quest you`lll do during you next time online, without having to worry about finding your empire in ruin.
There is a famous saying - @#$% happens - not in The Dawn of Fantasy
At least now while your enjoying your 8 hours of sleep:P