How can a player be attacked if they are offline?
And if the player is offline, as said, there is no need to regenerate gradually as the user wouldn't see the gradual change but just a jump to a new hp level on their next login.
Example: I end my session with 34hp at 1:35, (assuming the...