if (player.getUptime() >= val*60*60*1000)
val stands for hours.
and for reseting the time, go at Logout.java and add this line:
player.setUptime(0);
By the way, dunno what project are you using. The codes that I wrote you are based on l2jfrozen methods.
DDoS Protection: Mostly HyperFilter.com but depends the company of the dedicated machine.
Bot Protection (L2Walker, L2Tower, L2Phx and such): LameGuard the best option.
Plus you need some protection for SQL Injection or such things.