it’s REDISin’ time!
wait is that… not the line from the movie?
(also SORRY this should have been at least a couple devlogs lol, please forgive me)
I’ve finally been working on the state management for LARPARDY! This turns out to be a MUCH harder task than I originally thought it would be, particularly because I’m trying to make sure that this will be safe and work well in a real environment.
Redis
First of all, instead of keeping state in the server’s memory, I have added a Redis DB to the project. This is part of why I wanted Docker set up, as this is now just in the docker-compose.yml!
I have NEVER personally used Redis before, so some time of the time from this devlog was admittedly stumbling my way through figuring out how to use Redis correctly.
CORRECTLY is the key word, to be clear. I’m building basically a wrapper class around the Redis database, StateManager, which abstracts away the nasty database stuff so the main code doesn’t have to worry about actually interacting with Redis. It was, kind of a pain to write actually (lol?), because I was worried about race conditions basically the entire time, since this code needs to run async (i.e., something else might do something to a thing while we’re also trying to do something with that thing). I HOPE that the state management code is bug free for now, but we’ll see.
(please…)
Client
The client has now also been updated to listen for new game states. I also finally figured out how to set up Rich Presence, so it will show that you’re playing LARPARDY on your profile!
In addition, I made it so in-game avatars will highlight green when someone is speaking (like Discord), and I added waiting UI for when a player has joined but hasn’t fully connected yet, AND for when you are still connectin#.
so NOWW can we start to make the actual game?
yyyyyYES! I think so. I hope, anyway (lol). I believe my next step will be making a basic lobby/waiting UI that lets you start the game, and then finally start to implement the actual game. I AM EXCITEEEEDD
(there’s not a ton to look at since this was mostly backend work. sorry! i’ll have more next time :3)
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.