Commit Graph

50 Commits (ec8926d69393c5921235ef563fbb34c884098d46)

Author SHA1 Message Date
Joey Hines ec8926d693
Added `out_of_stock_votes` to ItemListing
continuous-integration/woodpecker the build was successful Details
+ Records a list of player ids that reported an item as empty
+ Re-did item hash implementation so multiple items can have the same name
+ Bumped DB version to 4
+ fmt + clippy
2021-12-26 19:16:31 -06:00
Joey Hines 29a4cd3eb6
Fixed selling test
continuous-integration/woodpecker the build was successful Details
2021-12-25 21:04:12 -06:00
Joey Hines caf7212cca
Added string length validation (#4)
continuous-integration/woodpecker the build failed Details
+ Added a length check to string fields on add_item and add_location
+ Only doing length validation for now
+ Clippy + Fmt
2021-12-22 19:00:40 -07:00
Joey Hines 99a78599c7
Small fixes
continuous-integration/woodpecker the build was successful Details
+ Improved location format
+ Added an error message for invalid link codes
+ Clippy + fmt
2021-12-20 20:34:56 -07:00
Joey Hines 6bc80af865
Added info command
continuous-integration/woodpecker the build was successful Details
+ Clippy + Fmt
2021-12-19 15:16:22 -07:00
Joey Hines d9a3a05067
Added 'remove_item' command
continuous-integration/woodpecker the build was successful Details
+ Allows a user to remove an item from a shop
+ Clippy + fmt
2021-12-19 14:55:59 -07:00
Joey Hines 18a4373313
Added 'edit' commands
continuous-integration/woodpecker the build was successful Details
+ Allows a location's name or position to be updated
+ Added a bots commands for it, two for now as subcommands are not working right
+ Logging fix
+ Updated return messages for some bot commands
2021-12-19 14:06:56 -07:00
Joey Hines 48be50dd67
Added link command
continuous-integration/woodpecker the build was successful Details
+ Link provides a link code that a user can use to link other accounts
+ This places the main auth source into MC and the plugin
+ Refactored register to accept a link code
+ Clippy + fmt
2021-12-18 11:13:18 -07:00
Joey Hines 37117ce5a9
Added delete command to bot
continuous-integration/woodpecker the build was successful Details
+ Added more error messages
+ Added lang.rs to store common messages
+ clippy + fmt
2021-12-18 09:43:59 -07:00
Joey Hines 551a0a7618
Fixed broken test after refactor
continuous-integration/woodpecker the build was successful Details
2021-12-18 09:10:51 -07:00
Joey Hines 203142b95b
Updated CI to woodpecker
continuous-integration/woodpecker the build failed Details
2021-12-17 20:10:43 -07:00
Joey Hines 3711e7011c
Refactored parameter handling + added delete command
+ CommandRequest is now a struct that contains a generic parameter for the type
+ This streamlines adding new command parameters and reduces duplicate code
+ Added delete commands
2021-12-17 20:03:15 -07:00
Joey Hines 4c1d1cd6d0
Added a remove method to GeoffreyDB
+ clippy + fmt
2021-12-17 17:24:51 -07:00
Joey Hines 3aaaf39913
Improved bot command handling
+ Created CommandRunner struct to house all the bot commands
+ Streamlines registering app commands and dispatching commands
+ Bit of hecky rust that may need to be cleaned up
+ Clippy + Fmt
2021-12-12 19:30:38 -07:00
Joey Hines 2ff4d14e3f
Added `set_portal` command to bot
+ Added display_portal formatter
2021-12-12 12:41:09 -07:00
Joey Hines c45bb592db
Added logging to bot
+ Cleaned up error handling to make it easier to handle multiple error levels
2021-12-12 11:55:09 -07:00
Joey Hines 199516f3cc
Added set_portal to the API
+ Bumped DB version to 3
+ Renamed "tunnel" to "portal" on the location models
+ Added a new migration
+ Cargo + Clippy
2021-12-07 20:33:25 -07:00
Joey Hines 3b8c7fc60f
Various Fixes
+ Fixed output of find command
+ Fixed order of add_location params
+ Minor typo fixes
2021-12-05 18:08:35 -07:00
Joey Hines 05b2cd613b
Removed bot_config.toml from git
+ Added to git ignore
+ Updated Discord token
2021-12-05 16:56:54 -07:00
Joey Hines 12218d0b62
Updated models + migration infra
+ Model migration is handled in the DB modules
+ It involves writing an up and a down case
  + Both load and interact with the JSON directly
  + Done so it can be decoupled from models
2021-12-05 16:51:13 -07:00
Joey Hines a655146c81
Bot code cleanup
+ Added functions for parsing Application Command options into different types
+ Added formatters for common message formats
+ Clippy + Fmt
2021-12-03 20:42:57 -07:00
Joey Hines 8d858bdfd3
Refactored GeoffreyBot module layout 2021-12-03 19:33:29 -07:00
Joey Hines d3b8b4ae1d
Updated README.md 2021-11-30 21:16:18 -07:00
Joey Hines 7fb4054cdb
Rough first pass of a bot
+ Uses application commands from discord
+ Tried to follow a similar structure to how the API handles commands
+ Implements add_location, add_item, selling, and find
+ Needs a lot of work lol
+ clippy + fmt
2021-11-30 21:13:56 -07:00
Joey Hines bc4936febd
Fixed typo in the README.md 2021-11-14 17:07:13 -07:00
Joey Hines 04d9c29458
Improved tests and added CI config
+ Fixed long-standing issues with database tests. The DB is now guarded by a mutex to prevent tests running in parallel
+ Added .drone.yml to run tests on a PR and on a push
2021-11-14 17:04:03 -07:00
Joey Hines e1b362aa1c
Implemented sorting an ordering for selling
+ Added parameter validation as well
+ Currently, Restock and Price are the two sorting methods available
2021-11-14 16:28:55 -07:00
Joey Hines ebaf28e39e
Added a stress test for selling queries
+ Queries are pretty much linear with the number of shops/items added
+ Tested with 1000 shows with 10 items each, query took 100ms
2021-11-14 15:38:32 -07:00
Joey Hines 8e8798f509
First pass on shop/item handling
+ The `add_item` command adds items to a location of type `Shop`
+ `selling` allows items to be queried
  + Items are not sorted yet
  + The user will be able to apply optional sorting params
+ Allowed the `insert` function of the DB to be used to update a model already in the DB
+ Clippy + Fmt
2021-11-07 14:23:18 -07:00
Joey Hines 22ffe75422
Added API token handling
+ Tokens can be added by the add_token command or via the CLI
+ Tokens are checked for authorization before a command is run
+ Added an error message field to the GeoffreyApiResponse
+ Made tokens strings instead of u64s
  + Tokens are randomly generated 64 char long alphanumeric strings
+ Clippy + Fmt
2021-10-31 11:00:07 -06:00
Joey Hines b79db6029e
Fmt + Clippy 2021-10-24 13:21:30 -06:00
Joey Hines 8e6b652d5e
Added user_id checking to commands
+ Refactored to make CommandRequest a trait that all the parameter structs implment
+ Created handle_command to handle all the preprocessing needed before running the command
2021-10-24 13:20:15 -06:00
Joey Hines b3c0e2dcb0
Fmt + Clippy 2021-10-23 13:13:28 -06:00
Joey Hines d8de648395
Refactoring to get the find command working
+ Decoupled Database Types from API Return Types
  + Allows response to be more content rich
+ Added helper methods to load all the information related ot a model
 + This also helps us move a bit closer to what we would have to do for something like Diesel
 + Might be good to add more functions like this to decouple db operations from the API layer
2021-10-23 13:11:23 -06:00
Joey Hines f6b797b6c1
Added logging infrastructure
+ Using log and simple_logger libs
+ Added a command line argument to set the log level
2021-10-17 13:09:50 -06:00
Joey Hines 9224edca65
Missed database check in 2021-10-17 12:25:47 -06:00
Joey Hines c57738349b
Cargo + Clippy
* Also discovered you can implement From<T> outside in modules outside whereT was declared
2021-10-17 12:24:45 -06:00
Joey Hines c2bc16f3d8
Added better error handling for API+Database
+ GeoffreyDatabaseError implements Into<GeoffreyApiError>
+ The database Option and Result were combined into just Result to reduce complexity
2021-10-17 12:21:01 -06:00
Joey Hines 692cbfebd8
Missing "`" in README.md 2021-10-03 16:05:16 -06:00
Joey Hines a448eea18d
Updated project layout in README.md 2021-10-03 14:07:37 -06:00
Joey Hines b92308da67
First pass of an API
+ Implemented register, find, and add_location
+ Bunch of changes to the DB and the Models to make this work
+ API models are defined in GeoffreyModels so things that call the API don't need to define their own types
+ Still needs a lot of work, and need to design the api a bit more
+ Clippy + fmt
2021-10-03 14:03:32 -06:00
Joey Hines 9bf31f17f6
Merge remote-tracking branch 'origin/main' into main 2021-05-31 18:55:19 -06:00
Joey Hines 3e44dc6932
Merge remote-tracking branch 'origin/main' into main 2021-05-31 18:55:04 -06:00
Joey Hines 47b2efa71e
Merge remote-tracking branch 'origin/main' into main 2021-05-31 18:54:55 -06:00
Joey Hines b7ad034cc6
Database fixes
+ Fixed issue where IDs of different models were colliding
+ Used built in methods to convert u64 to bytes
+ Added tests for database speed
+ Converted return time of filter to an iterator
+ Added better error handling for non-unique values
2021-05-31 18:53:27 -06:00
Joey Hines 449af042c3
Database fixes
+ Fixed issue where IDs of different models were colliding
+ Used built in methods to convert u64 to bytes
+ Added tests for database speed
+ Converted return time of filter to an iterator
+ Added better error handling for non-unique values
2021-05-31 18:52:56 -06:00
Joey Hines 9d104db0d6
Refactor ahead of API addition
+ This commit started as an experiment in a GraphQL api. It didn't turn out well...
2021-05-08 15:42:47 -05:00
Joey Hines 2bf1b8ab1c
Changed how Locations are handled
+ Each location type is now a struct containing LocationData and location specific data.
+ Each type has its own place its own tree
+ Both were done in order to allow clear deserialization
2021-03-13 14:42:37 -06:00
Joey Hines 0bcb28bc47
Initial database implementation
+ Using sled as a database
+ Added functions for inserting and fetching models from the database
2021-03-10 18:31:50 -06:00
Joey Hines a3f25f214c
Initial commit
+ Basic models
+ Project Layout
+ ARCHITECTURE.md and README.md
2021-03-06 13:19:13 -06:00