Squid Game 3
Today took FOREVER to code. I don't even know when I started, let me check... I started at around 11AM, and it is now 8PM. To be fair, I had like a 3 hour nap today, but still generally around 6 hours of coding/trying, give or take an hour.
Today, I continued working on the timer. Yesterday, I had a timer that could run code at specified dates. The next step, what I worked on today, was making the timer able to retrieve the times for each round that is already stored in the database, and run code at those times. Basically, this time, the times are retrieved dynamically from my database, which is how it will be when the games are actually ran, rather than being hardcoded into the code, as it was previously for the sake of seeing if I can get scheduled code to run.
To be honest, this also took way longer than necessary. A really irritating part of doing this was figuring out that I cannot just story my database times in a global variable in my Node file, because querying is an asynchronous task. As such, I have to do everything in my asynchronous function after I have gotten my data. Thinking about this too much makes my brain hurt tbh HAHA!
So now that my code can automatically run stuff based off of times in my database, tomorrow I have to create Schemas for my players, with a property that says if they are in the game or not. Then, once a round is over, my code has to query the database and see if these players have submitted their task, and if they haven't, their eligibility must be switched.
Productive day I guess! Super cool seeing my code being able to run stuff at times defined in my database. I don't have to push a button :D