3fa3b491dc
variable of dayStart for processing, instead of having the object directly
updated at the time of edit.
Modified website/views/options/settings.jade to allow a timestamp to be
cast to an iso timestamp because lastCron is saved as an iso timestamp,
and as a straight moment()-based timestamp in order to compare timestamps.
Modified website/public/js/controllers/settingsCtrl.js to do the
following:
Accept the new proposed dayStart
Calculate the timestamp of the old dayStart and the new dayStart
These two steps were necessary because dayStart is an integer between
and including 0 and 23. I tested and confirmed the current production
dayStart does not allow 24 to be entered but does allow 0. I was
careful to NOT change how that worked.
Cast the old dayStart, the new dayStart and lastCron to the moment()
version of time so they could be compared.
Cast the new dayStart to the iso timestamp for storage in lastCron
The important change is the following:
if oldDayStart < lastCron AND lastCron < newDayStart then lastCron
should be set to newDayStart. I modified this to include if oldDayStart
= lastCron, although I think that's pretty unlikely to be possible.
When I tested this, my lastCron was a mere 17 seconds after my
oldDayStart, so it seemed to me that the equal case should be included
with the less than case.
Common
Shared resources useful for the multiple HabitRPG repositories, that way all the repositories remain in-sync with common characteristics. Includes things like:
- Assets - sprites, images, etc
- CSS - especially, esp. sprite-sheet mapping
- Algorithms - level up algorithm, scoring functions, etc
- View helper functions that may come in handy for multiple client MVCs
- Item definitions - weapons, armor, pets
Compiling spritesheets
Because of some wonkiness with Heroku, the spritesheet compilation is not part of the production build process and must be done manually when new images are added by running:
grunt compile:sprites