Rename to StartRNR

We're pivoting, baby!
This commit is contained in:
Kiana Sheibani 2023-10-03 23:37:51 -04:00
parent ad6445bcd2
commit d3459346f7
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
8 changed files with 45 additions and 51 deletions

28
Cargo.lock generated
View file

@ -470,20 +470,6 @@ dependencies = [
"wasi", "wasi",
] ]
[[package]]
name = "ggelo"
version = "0.1.0"
dependencies = [
"clap",
"cynic",
"cynic-codegen",
"dirs",
"reqwest",
"schema",
"serde",
"sqlite",
]
[[package]] [[package]]
name = "gimli" name = "gimli"
version = "0.28.0" version = "0.28.0"
@ -1155,6 +1141,20 @@ dependencies = [
"sqlite3-src", "sqlite3-src",
] ]
[[package]]
name = "startrnr"
version = "0.1.0"
dependencies = [
"clap",
"cynic",
"cynic-codegen",
"dirs",
"reqwest",
"schema",
"serde",
"sqlite",
]
[[package]] [[package]]
name = "static_assertions" name = "static_assertions"
version = "1.1.0" version = "1.1.0"

View file

@ -1,12 +1,12 @@
[workspace] [workspace]
[package] [package]
name = "ggelo" name = "startrnr"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
[[bin]] [[bin]]
name = "ggelo" name = "startrnr"
path = "src/main.rs" path = "src/main.rs"
[dependencies] [dependencies]

View file

@ -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 linked to your account. Instructions for generating one can be found in the
[developer API docs](https://developer.start.gg/docs/authentication). [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: program checks for a token in:
- A command-line flag `--auth`. - 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 - A file `auth.txt` within the config directory (see the [[README]] for a list
of directories in each OS). 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 ## 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). 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/) - [OpenSSL](https://www.openssl.org/)
- [SQLite](https://www.sqlite.org/) - [SQLite](https://www.sqlite.org/)
## Step 3: Compiling ## 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: running the following command:
``` sh ``` sh
cargo install --git https://github.com/kiana-S/StartGGElo cargo install --git https://github.com/kiana-S/StartRNR
``` ```

View file

@ -1,4 +1,4 @@
# StartGGElo # StartRNR
StartGGElo is a tool for using [start.gg](https://www.start.gg/)'s video game tournament data to 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. 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. probability of a player winning a match, generate seedings for future tournaments, and more.
> **Warning**<br> > **Warning**<br>
> 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 ## Installation
*For more information, see the [installation page](INSTALL.md).* *For more information, see the [installation page](INSTALL.md).*
Build and install StartGGElo using `cargo`: Build and install StartRNR using `cargo`:
``` sh ``` sh
cargo install --git https://github.com/kiana-S/StartGGElo cargo install --git https://github.com/kiana-S/StartRNR
``` ```
Alternatively, if you use Nix: Alternatively, if you use Nix:
``` sh ``` sh
nix profile install github:kiana-S/StartGGElo nix profile install github:kiana-S/StartRNR
``` ```
## Configuration ## 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` - Windows: `%APPDATA%\Roaming\startrnr`
- MacOS: `~/Library/Application Support/ggelo` - MacOS: `~/Library/Application Support/startrnr`
- Linux: `~/.config/ggelo` - 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 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).* *For more information on StartRNR'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.

View file

@ -27,7 +27,7 @@
craneLib = crane.lib.${system}.overrideToolchain rustToolchain; craneLib = crane.lib.${system}.overrideToolchain rustToolchain;
commonArgs = { commonArgs = {
pname = "ggelo"; pname = "startrnr";
version = "0.1.0"; version = "0.1.0";
src = craneLib.path ./.; src = craneLib.path ./.;
buildInputs = [ pkgs.openssl pkgs.sqlite ]; buildInputs = [ pkgs.openssl pkgs.sqlite ];
@ -45,14 +45,14 @@
inherit cargoArtifacts; inherit cargoArtifacts;
}); });
ggelo = craneLib.buildPackage (commonArgs // { startrnr = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts; inherit cargoArtifacts;
}); });
in { in {
packages.ggelo = ggelo; packages.startrnr = startrnr;
packages.default = ggelo; packages.default = startrnr;
checks.build = ggelo; checks.build = startrnr;
checks.runClippy = runClippy; checks.runClippy = runClippy;
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {

View file

@ -16,7 +16,7 @@ pub struct DatasetMetadata {
/// Return the path to the datasets file. /// Return the path to the datasets file.
fn datasets_path(config_dir: &Path) -> io::Result<PathBuf> { fn datasets_path(config_dir: &Path) -> io::Result<PathBuf> {
let mut path = config_dir.to_owned(); let mut path = config_dir.to_owned();
path.push("ggelo"); path.push("startrnr");
// Create datasets path if it doesn't exist // Create datasets path if it doesn't exist
fs::create_dir_all(&path)?; fs::create_dir_all(&path)?;

View file

@ -25,10 +25,10 @@ pub fn issue(msg: &str, code: i32) -> ! {
/// ## CLI Structs /// ## CLI Structs
#[derive(Parser)] #[derive(Parser)]
#[command(name = "StartGGElo")] #[command(name = "StartRNR")]
#[command(author = "Kiana Sheibani <kiana.a.sheibani@gmail.com>")] #[command(author = "Kiana Sheibani <kiana.a.sheibani@gmail.com>")]
#[command(version = "0.1.0")] #[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 { struct Cli {
#[command(subcommand)] #[command(subcommand)]
subcommand: Subcommands, subcommand: Subcommands,

View file

@ -28,7 +28,7 @@ pub fn get_auth_token(config_dir: &Path) -> Option<String> {
Err(VarError::NotUnicode(_)) => error("Invalid authorization key", 2), Err(VarError::NotUnicode(_)) => error("Invalid authorization key", 2),
Err(VarError::NotPresent) => { Err(VarError::NotPresent) => {
let mut auth_file = config_dir.to_owned(); let mut auth_file = config_dir.to_owned();
auth_file.push("ggelo"); auth_file.push("startrnr");
auth_file.push("auth.txt"); auth_file.push("auth.txt");
read_to_string(auth_file).ok().and_then(|s| { read_to_string(auth_file).ok().and_then(|s| {
let trimmed = s.trim(); let trimmed = s.trim();