Commit Graph

11 Commits

Author SHA1 Message Date
projectmoon 9176e858d5 A bit of database code cleanup. 2020-10-23 20:30:03 +00:00
projectmoon 9f8ef281de Store room user variable count under a room metadata space 2020-10-23 20:30:03 +00:00
projectmoon 2ee8ae2e34 Document the From trait on the DataError type. 2020-10-20 21:10:54 +00:00
projectmoon 114c879c6f Count user variables on a per-room basis. 2020-10-20 21:10:54 +00:00
projectmoon ebfd230f31 Use variables namespace for user variables. 2020-10-18 21:01:52 +00:00
projectmoon 6b7acbe520 Open trees for rooms and variables, but not yet use them. 2020-10-18 21:01:52 +00:00
projectmoon ce82e6ddad Fetch all variables into a map before rolling dice.
Goes from about 30 seconds to do 1 million variable resolutions down
to 18 seconds.
2020-10-18 20:37:02 +00:00
projectmoon d5aae3ebb1 Fully async dice rolling. Also remove more unnecessary stuff. 2020-10-18 20:37:02 +00:00
projectmoon 4856360c6a Custom schema violation error for DB value retrieval. 2020-10-16 13:18:27 +00:00
projectmoon 4234263ee4 Localize error enums to modules, better DB error reportng. 2020-10-16 13:18:27 +00:00
projectmoon 6cdc465a2e Add database and storage of user variables.
This commit introduces the Sled embedded key-value store for keeping
track of user variables on a per-room basis. Extensive changes were
made to the command module to separate concerns and also pass the
database "connection" down the line.

 - A new "Context" object was created to hold information and state
   needed for command execution (namely the database).
 - Database is very simple for now, storing only user variables.
   Refactoring later for storing more complicated types.
 - State actor moved into Actors struct, in preparation for either
   more actors, or ripping the whole thing out entirely.
 - Other modules are also more properly separated, notably
   the config module is entirely self-contained.
2020-10-16 13:18:27 +00:00