From c32b8415d06776a336b17dabea142fa03ec8b8fd Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 23 Jun 2021 20:32:12 -0400 Subject: Stop activity when character starts resting, to prevent potential exploit of gaining rested time while timer runs down --- app/models/character.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/models/character.rb b/app/models/character.rb index 2f4ad62..a7d5829 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -339,6 +339,7 @@ class Character < ApplicationRecord def start_resting return false if self.started_resting_at + stop_activity self.update(started_resting_at: Time.now) end -- cgit v1.2.3