Commit Graph

22 Commits

Author SHA1 Message Date
projectmoon 34ee2c6e5d Consider command execution secure when proper conditions are met.
- If the room is end-to-end encrypted.
 - If only the sending user and the bot are present in the room.

This lays groundwork for sensitive commands like registering a user
account with the bot.
2021-05-21 22:28:45 +00:00
projectmoon 5643677627 Consolidate dice and variable parsers under parser module. 2021-05-21 14:44:03 +00:00
projectmoon e73ad118b2 Move some declaration-only modules to mod.rs files in folders. 2021-05-21 14:30:46 +00:00
projectmoon 3d5cda39c8 Consolidate dice module into logic module. 2021-05-21 14:26:58 +00:00
projectmoon 4de273db4a Remove sled code; promote sql to top level 2021-05-21 14:05:25 +00:00
projectmoon e539dcac1f Move migrations to sqlite directory. Remove in-memory temp db until refinery supports sqlx. 2021-05-18 14:50:49 +00:00
projectmoon cf9ce63892 Replace application-level database connectivity.
- Some database methods not yet implemented.
 - Unit tests create temp files that are not cleaned up (but they should be).
2021-05-15 23:45:30 +00:00
projectmoon c4e0393d99 Update variables on advancement rolls. 2021-05-13 21:16:41 +00:00
projectmoon d67328ac6b Cthulhu dice only take one amount now 2021-05-13 20:24:17 +00:00
projectmoon 8939d6debd Update dependencies. 2021-05-13 19:48:29 +00:00
projectmoon e5431a587d Support complex expressions on CoC advancement rolls. (#55)
Also remove todo, update some CoC command descriptions.

Fixes #54.
Co-Authored-By: projectmoon <projectmoon@noreply.git.agnos.is>
Co-Committed-By: projectmoon <projectmoon@noreply.git.agnos.is>
2021-03-18 20:54:49 +00:00
projectmoon 9ab65b8943 Update env_logger, rand, phf, itertools to newer semvers. 2021-02-09 21:56:13 +00:00
projectmoon 1b0003ff1b Upgrade to Matrix SDK latest (Store Rewrite) and Tokio 1.0
This upgrade introduces a handful of breaking changes in the Rust
Matrix SDK.
 - Some types have disappeared and changed name.
 - Some functions are no longer async.
 - Room display name now has a Result type instead of just returning
   the value.
 - Client state store has breaking changes (not really a big deal).

This required introduction of a new type to store room information
that we are interested in on the context struct. This new RoomContext
is required mostly due to unit tests, because it is no longer possible
to instantiate the Room type in the Matrix SDK.
2021-01-30 12:54:47 +00:00
projectmoon 569ba4f2e0 Carry full room instance in context instead of just room id. 2020-11-29 21:03:45 +00:00
projectmoon f46b914239 Add matrix client to context. 2020-11-22 20:52:44 +00:00
projectmoon 39e6eb9b46 Implement support for user variables in CoC dice rolling.
Also comes with reorganization of the dice rolling code to centralize
the variable -> dice amount logic, and changes the way the results of
those rolls are displayed.
2020-11-04 20:33:30 +00:00
projectmoon a15d3e0bac Fix cthulhu advancement rolls, add remaining dice tests. 2020-11-01 19:29:09 +00:00
projectmoon c55926a005 Support modifiers for cthulhu rolls, and add tests. 2020-10-31 20:51:17 +00:00
projectmoon 08b0e58193 Implement parsing of Cthulhu dice, only basic for now.
Does not understand anything besides single numbers at the moment.
2020-10-31 20:51:17 +00:00
projectmoon c290393ddf Centralize common parsing code.
Needed for further development of different systems that rely on these
kind of expressions, and lays groundwork for future changes.
2020-10-31 20:51:17 +00:00
projectmoon e3b819ecb0 Wire up regular cthulhu roll commmand (not yet parsed). 2020-10-31 20:51:17 +00:00
projectmoon d5034c11dc Basic implementation of CoC dice rolling.
Not hooked up to parser or commands yet.
2020-10-31 20:51:17 +00:00