-
Notifications
You must be signed in to change notification settings - Fork 29
Ability to save the bank #26
Comments
this would also be very useful to me, as I like to close the room and reopen it again later, when the session continues. |
Similarly, if a player drops from a room and rejoins they can lose access to items deposited before reconnecting. Don't know how feasible this is but a more robust event logging and syncing system would be nice. (This scenario can cause issues with other events such as perks too.) |
I would like to second this idea. I'm trying to do long runs with friends, but we cannot safely store anything in the bank between sessions, as the lobby will inevitably need to be restarted before we resume again. |
@soler91 I'd be interested in implementing this, basically all one would have to do is to serialize and deserialize the bank for a given lobby. (I'll also give upgrading the frontend to Vue 3 while I'm at it a shot.) Any place in particular where I should add this, or if this might belong into the backend code? (which isn't on Github yet, I'd gladly help out with that if possible) |
Okay, I've taken a long and close look at this. tl;drIf we want to go for the "put it into a JSON file" option, then I'd opt for lowdb. If we want to put an actual, lightweight database behind it, then I think node-sqlite3 with kysely and writing a bit of code to support node-sqlite3 would be the best option. Why?So, I'd like something
A JSON file seems like a too simplistic option, but maybe it's the easiest one?
And if we want to check out the route of using a lightweight database, then...
And about those wrappers I talked about
|
Apparently there's yet another trade-off that needs to be made: The database options work asynchronously. This means that
|
And then there's the very alternative option of just dropping Electron, switching to Tauri and using a Rust-y database like bonsaidb, sled, sanakirja, rusqlite, ... with maybe an ORM like diesel. |
If the room host disconnects it seems that the bank is deleted. Rather than it being linked solely to the room is it possible to save it to a file, and also to have the room's host change to another user if the current host disconnects so that the room and bank dont just poof.
I am not a programmer, but think this would be great :)
The text was updated successfully, but these errors were encountered: