Commit Graph

39 Commits

Author SHA1 Message Date
jeff b467c32acb Switch to oneof field for game-specific information and values.
Having specific protobuf types for different game systems using the
same rule set (e.g. all the Chronicles of Darkness games) is untenable
because protobuf does not have inheritance or mixins.

Instead, we have one generic character sheet type, with a oneof field
for the game specifics. This will be used in conjunction with the
character's game system (stored in db) to render different stuff on
the character templates.

Without this, we'd wind up having duplicate templates, a lot more code
for handling specifics of each game system, and so on.
2021-01-01 23:34:50 +00:00
jeff 14863353f0 Remove versioning from data type enum members 2021-01-01 22:56:41 +00:00
jeff 2cb547e16a Implement updating skills on the backend. 2021-01-01 00:40:48 +00:00
jeff 322e13108a Update cargo dependencies. 2020-12-31 22:32:32 +00:00
jeff 2b7f9b8897 Add ability to edit changeling characters. 2020-12-31 22:28:00 +00:00
jeff 06c8289eae Add skills to the character editor. 2020-12-31 22:21:05 +00:00
jeff 06b3e0b390 Skip loading owner of character for API. 2020-12-31 20:19:45 +00:00
jeff c99c7af369 Update readme for SQLx. 2020-12-31 14:11:28 +00:00
jeff 574ab543e5 Add ability to pass in custom database path. 2020-12-31 14:11:28 +00:00
jeff f572a9c493 Move migrations to refinery + barrel, enable 'offline' sqlx query checking 2020-12-31 14:11:28 +00:00
jeff 717ab0677b Convert load user queries to compile-checked 2020-12-31 14:11:28 +00:00
jeff ed9b7c1a81 Clear out unused imports in db.rs 2020-12-31 14:11:28 +00:00
jeff b443f28a50 Use sqlx result in db.rs 2020-12-31 14:11:28 +00:00
jeff 769512f357 Convert character db methods to compile-checked queries 2020-12-31 14:11:28 +00:00
jeff 7f4efb8122 Rip out Diesel in favor of SQLx.
The primary benefit of this is to avoid Rocket's database integration,
which has become problematic in this codebase with the update to the
new async style. Because the async database API is actually
synchronous under the hood, this introduces some annoying lifetime
requirements that basically force us to use owned data everywhere.

The original pattern was to have a separate data layer that could
invoke queries from `self` (the db connection). By using a true async
database driver, we can get this back, because the lifetimes are once
again flexible instead of the ones forced by Rocket.
2020-12-31 14:11:28 +00:00
jeff cd4afbafe2 Load character in API as common function. Fix attribute editing. 2020-12-29 14:01:07 +00:00
jeff 4bff55cc6b Implement editing of attributes. 2020-12-27 21:49:08 +00:00
jeff c0a48245b1 Start of adding protobuf-based editable character sheet. 2020-12-27 21:03:10 +00:00
jeff b95bad440b Update cargo.lock 2020-12-14 23:21:09 +00:00
jeff feaa57739e Change global databases to debug (for development) 2020-12-14 19:06:21 +00:00
jeff e938496f00 Migrate to Rocket 0.5.
Rocket 0.5 is a major uprade, rewriting most of Rocket to be async.
Required many changes through the code, especially the database layer.
The new Rocket async database calls require Futures with 'static
lifetimes.

General:
 - Move to stable rust.
 - Most of codebase is now async.
 - Rocket migrations (e.g. Cookies to CookieJar).

Database:
 - Switched to owned data (&str -> String) for inserts because of the
   'static lifetime requirement on Rocket's DB future.
 - All database methods now asynchronous.

Pages:
 - Changed various routes to async.
 - Needed to add clone calls to some places because we need to use
   owned data multiple times (registration).
2020-12-13 21:58:39 +00:00
jeff 1566790a82 Serve protobuf files statically. 2020-12-09 22:21:52 +00:00
jeff 1d5b9eaf4f Super basic readme. 2020-12-09 21:45:56 +00:00
jeff 31a3fa2e46 Finished and mostly clean new character flow.
Lots of changes and reorganization to support the ability to create
new characters.
2020-12-09 21:25:31 +00:00
jeff e59e9a5ebf Clearer function names in new character flow. 2020-12-09 08:58:49 +00:00
jeff 0751a783dc Basic albeit mostly broken flow for creating new character. 2020-12-08 22:28:27 +00:00
jeff 92301fb1d4 Dynamically deserialize character data. 2020-12-08 22:28:27 +00:00
jeff 44dded7f28 Switch character data type to an enum, including schema patch.
Schema patch required because the diesel enum derive crate does not
seem to deal with print-schema for sqlite.
2020-12-08 22:28:27 +00:00
jeff 93ed679946 Add serde serialization suppor to proto types. 2020-12-08 08:47:34 +00:00
jeff d6a80a7996 Serialize characters as protobufs. Skeletal character creation.
Implements the absolute basics of the character creation flow, AKA
most things are missing. Integrates a method of storing character
data, support for that in the database, and a working character
creation page.

The only thing the page does at the moment is create a hardcoded basic
CofD character sheet and save it to the database. There is no ability
to change game system, fill in extra details, etc. There's also no
ability to edit anything.

Also added basic links to the registration and create new character
pages.
2020-12-07 22:37:18 +00:00
jeff ec5be56858 Clean up 'TemplateContext', handle character visibility. 2020-12-05 20:15:14 +00:00
jeff 0530011138 User accounts, DAO trait, registration.
Not very thorough, but it does work.
2020-12-05 19:50:11 +00:00
jeff 881518cc8f Remove example text on the logged-in index page. 2020-12-03 23:40:34 +00:00
jeff f97035ef9a Load a (non existing) character list on the home page 2020-12-03 23:39:55 +00:00
jeff 499b1748ce New character route, and login cleanup. 2020-12-03 19:45:56 +00:00
jeff ea506ab54b Better name for main login route. Remove unused feature from main. 2020-12-03 19:35:45 +00:00
jeff 7cb8a589ad Remove development cookie key from rocket.toml 2020-12-03 19:30:09 +00:00
jeff ce6794e4ec Add license. 2020-12-03 19:21:09 +00:00
jeff 09b6ddc36a First commit; prototype state. 2020-12-03 19:21:09 +00:00