Commit Graph

7 Commits

Author SHA1 Message Date
projectmoon 764426382a Convert project to workspace with Tonic for gRPC. (#84)
Convert project to workspace with Tonic for gRPC.

This commit adds an RPC service to the dicebot, allowing external
applications to control it. The project was converted to a cargo
workspace to house the protobuf definitions in a common crate
(tenebrous-rpc), so that clients and servers can make use of these
protobuf definitions.
Co-Authored-By: projectmoon <projectmoon@noreply.git.agnos.is>
Co-Committed-By: projectmoon <projectmoon@noreply.git.agnos.is>
2021-06-02 21:09:58 +00:00
projectmoon 5d002e5063 Add ability to store user active room, with skeleton accounts.
- Adds a user_state table, currently only with active_room.
 - A user must have an account to take advantage of state.
 - Now, all users will get an 'account' even if they don't explicitly register.
 - Bonus: converts user queries to compile-time checked macros.

To support these automatically created "accounts," the accounts table
now also has an account_status column, indicating if the user is
registered or not (or pending activation--future use).

The User model has been updated with extra properties from the state,
and the user is now carrried in the Context during command execution.
A user is ensured to be created before executing the command.
2021-05-25 22:29:01 +00:00
projectmoon 921c4cd644 Update sqlx offline json for user query. 2021-05-22 22:53:01 +00:00
projectmoon 6b6be06c89 Update sqlx offline json. 2021-05-19 21:36:16 +00:00
projectmoon 9f97a6cb43 Implement variable count; fix listing all variables returning values for all users. 2021-05-18 14:27:15 +00:00
projectmoon 9798821b7b Implement room and dbstate for sqlite. 2021-05-16 14:29:57 +00:00
projectmoon 6b6e59da2e Initial SQLx implementation (variables). not yet wired up to bot.
- Adds migrations for the necessary tables.
 - Implements the user variables database functions.
 - Adds sqlx metadata for 'offline' use so we can build without a database.
2021-05-15 15:27:40 +00:00