From d3459346f74436ed68f76ec11b7dca5eb5347252 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Tue, 3 Oct 2023 23:37:51 -0400 Subject: [PATCH] Rename to StartRNR We're pivoting, baby! --- Cargo.lock | 28 ++++++++++++++-------------- Cargo.toml | 4 ++-- INSTALL.md | 13 ++++++++----- README.md | 33 ++++++++++++--------------------- flake.nix | 10 +++++----- src/datasets.rs | 2 +- src/main.rs | 4 ++-- src/queries.rs | 2 +- 8 files changed, 45 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 509d1c1..fc12f18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -470,20 +470,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "ggelo" -version = "0.1.0" -dependencies = [ - "clap", - "cynic", - "cynic-codegen", - "dirs", - "reqwest", - "schema", - "serde", - "sqlite", -] - [[package]] name = "gimli" version = "0.28.0" @@ -1155,6 +1141,20 @@ dependencies = [ "sqlite3-src", ] +[[package]] +name = "startrnr" +version = "0.1.0" +dependencies = [ + "clap", + "cynic", + "cynic-codegen", + "dirs", + "reqwest", + "schema", + "serde", + "sqlite", +] + [[package]] name = "static_assertions" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index fe26228..211c211 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [workspace] [package] -name = "ggelo" +name = "startrnr" version = "0.1.0" edition = "2021" [[bin]] -name = "ggelo" +name = "startrnr" path = "src/main.rs" [dependencies] diff --git a/INSTALL.md b/INSTALL.md index 904e0a1..524d351 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -6,7 +6,7 @@ In order to access start.gg's API, you must first have an authentication token linked to your account. Instructions for generating one can be found in the [developer API docs](https://developer.start.gg/docs/authentication). -Once you have an auth token, it must be provided to StartGGElo. In order, the +Once you have an auth token, it must be provided to StartRNR. In order, the program checks for a token in: - A command-line flag `--auth`. @@ -14,22 +14,25 @@ program checks for a token in: - A file `auth.txt` within the config directory (see the [[README]] for a list of directories in each OS). +The last method is recommended, as StartRNR can simply read from that file +whenever it needs to. + ## Step 2: Dependencies -StartGGElo is written in Rust, so install the [Rust +StartRNR is written in Rust, so install the [Rust compiler](https://www.rust-lang.org/tools/install). -In addition, StartGGElo needs these run-time dependencies: +In addition, StartRNR needs these run-time dependencies: - [OpenSSL](https://www.openssl.org/) - [SQLite](https://www.sqlite.org/) ## Step 3: Compiling -Once you have all the necessary dependencies, build and install StartGGElo by +Once you have all the necessary dependencies, build and install StartRNR by running the following command: ``` sh -cargo install --git https://github.com/kiana-S/StartGGElo +cargo install --git https://github.com/kiana-S/StartRNR ``` diff --git a/README.md b/README.md index 8c5429e..7dcce7c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# StartGGElo +# StartRNR StartGGElo is a tool for using [start.gg](https://www.start.gg/)'s video game tournament data to generate and maintain [Elo ratings](https://wikipedia.org/wiki/Elo_rating_system) for each competitive player. @@ -7,44 +7,35 @@ Once Elo ratings are generated, StartGGElo can be used to generate ranking lists probability of a player winning a match, generate seedings for future tournaments, and more. > **Warning**
-> StartGGElo is still under development; currently, it only supports generating player ratings. +> StartRNR is still under development; currently, it only supports generating player ratings. ## Installation *For more information, see the [installation page](INSTALL.md).* -Build and install StartGGElo using `cargo`: +Build and install StartRNR using `cargo`: ``` sh -cargo install --git https://github.com/kiana-S/StartGGElo +cargo install --git https://github.com/kiana-S/StartRNR ``` Alternatively, if you use Nix: ``` sh -nix profile install github:kiana-S/StartGGElo +nix profile install github:kiana-S/StartRNR ``` ## Configuration -StartGGElo stores its rating databases in its config directory, which is located at: +StartRNR stores its rating databases in its config directory, which is located at: -- Windows: `%APPDATA%\Roaming\ggelo` -- MacOS: `~/Library/Application Support/ggelo` -- Linux: `~/.config/ggelo` +- Windows: `%APPDATA%\Roaming\startrnr` +- MacOS: `~/Library/Application Support/startrnr` +- Linux: `~/.config/startrnr` -This directory also contains StartGGElo's config file, which defines how it calculates its ratings. There are few reasons to access this directory directly, but you can if you want to transfer your -data between computers. +datasets between computers. -## Elo system basics +## RNR system basics -*For more information on StartGGElo's rating system, see the [details page](DETAILS.md).* - -As the name implies, StartGGElo uses the Elo system for its ratings. In the Elo system, all newcomers to the -game are assigned an **initial rating**, and this rating is adjusted whenever a player loses or wins matches. -The initial rating for StartGGElo is 1500, but this is configurable. - -Whenever a player enters a tournament, StartGGElo will use start.gg's API to determine how many sets -that player won within that tournament. This number is the player's **score** for that tournament. If the score -the player earned is larger than their Elo rating would predict, then their rating is increased. +*For more information on StartRNR's rating system, see the [details page](DETAILS.md).* diff --git a/flake.nix b/flake.nix index 10ad12c..6a8c9ba 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,7 @@ craneLib = crane.lib.${system}.overrideToolchain rustToolchain; commonArgs = { - pname = "ggelo"; + pname = "startrnr"; version = "0.1.0"; src = craneLib.path ./.; buildInputs = [ pkgs.openssl pkgs.sqlite ]; @@ -45,14 +45,14 @@ inherit cargoArtifacts; }); - ggelo = craneLib.buildPackage (commonArgs // { + startrnr = craneLib.buildPackage (commonArgs // { inherit cargoArtifacts; }); in { - packages.ggelo = ggelo; - packages.default = ggelo; + packages.startrnr = startrnr; + packages.default = startrnr; - checks.build = ggelo; + checks.build = startrnr; checks.runClippy = runClippy; devShells.default = pkgs.mkShell { diff --git a/src/datasets.rs b/src/datasets.rs index f414ac4..e008d94 100644 --- a/src/datasets.rs +++ b/src/datasets.rs @@ -16,7 +16,7 @@ pub struct DatasetMetadata { /// Return the path to the datasets file. fn datasets_path(config_dir: &Path) -> io::Result { let mut path = config_dir.to_owned(); - path.push("ggelo"); + path.push("startrnr"); // Create datasets path if it doesn't exist fs::create_dir_all(&path)?; diff --git a/src/main.rs b/src/main.rs index b651665..b27b4de 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,10 +25,10 @@ pub fn issue(msg: &str, code: i32) -> ! { /// ## CLI Structs #[derive(Parser)] -#[command(name = "StartGGElo")] +#[command(name = "StartRNR")] #[command(author = "Kiana Sheibani ")] #[command(version = "0.1.0")] -#[command(about = "StartGGElo - Elo rating calculator for start.gg tournaments", long_about = None)] +#[command(about = "StartRNR - Elo rating calculator for start.gg tournaments", long_about = None)] struct Cli { #[command(subcommand)] subcommand: Subcommands, diff --git a/src/queries.rs b/src/queries.rs index c89c649..cfc9c9a 100644 --- a/src/queries.rs +++ b/src/queries.rs @@ -28,7 +28,7 @@ pub fn get_auth_token(config_dir: &Path) -> Option { Err(VarError::NotUnicode(_)) => error("Invalid authorization key", 2), Err(VarError::NotPresent) => { let mut auth_file = config_dir.to_owned(); - auth_file.push("ggelo"); + auth_file.push("startrnr"); auth_file.push("auth.txt"); read_to_string(auth_file).ok().and_then(|s| { let trimmed = s.trim();