#magic #cargo-build #game #log-file #mtga #magicthegathering

bin+lib mtgadmin

A Rust Daemon That Listens for MTGA game log changes & uploads to various APIs. Supported APIs: '17lands

6 stable releases

1.0.5 May 31, 2023
1.0.3 May 30, 2023

#7 in #magic

MIT/Apache

1MB
138 lines

Contains (ELF exe/lib, 4.5MB) main

mtgadmin

Latest Release pipeline status coverage report

A Rust Daemon That Listens for File Changes for MTG Arena Tool & Automatically Submits Logs

How This Project Was Built

Install Rust as a non-priv user & reload Cargo ENV.

$ cd /tmp
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh
$ vim rust.sh
$ chmod u+x rust.sh
$ ./rust.sh
$ source $HOME/.cargo/env

Confirm Rust Version & That You-re up-to-date.

$ rustup self update
info: checking for self-update
  rustup unchanged - 1.26.0

Follow Rust Nightly Build.

$ rustup default nightly

Initial Project Setup, build & run mtgadmin

$ cargo new mtgadmin --bin
     Created binary (application) `mtgadmin` package
$ cd mtgadmin/src
$ cargo build
rustc main.rs

Testing

Check crate's semver version

$ cargo install cargo-semver-checks --locked
$ cargo semver-checks check-release

Run cargo-checkmate

cargo install cargo-checkmate
cargo checkmate

Hard Requirements for Using mtgadmin

In order to make FULL use of mtgadmin the following are/will be HARD requirements!

mtgadmin Usage

Upload game data to the 17lands API.

sudo mtgadmin -m '/mnt/disk3/lutris/mtg_arena/drive_c/Program Files/Wizards of the Coast/MTGA/MTGA_Data/Logs/Logs' -a '17lands'
[1/4] 🚚  Getting MTG Arena Tool log directory to monitor from user...
Monitoring MTG Arena Tool log directory /mnt/disk3/lutris/mtg_arena/drive_c/Program Files/Wizards of the Coast/MTGA/MTGA_Data/Logs/Logs
[2/4] 📃  Getting API endpoint from user...!
API endpoint to upload game data to: 17lands
17lands is a supported API endpoint!
[3/4] ✨ Uploading MTGA game data to 17lands...!
Uploading MTGA game data to API endpoint 17lands
"/mnt/disk3/lutris/mtg_arena/drive_c/Program Files/Wizards of the Coast/MTGA/MTGA_Data/Logs/Logs/UTC_Log - 03-01-2023 22.33.07.log" appears to be an MTGA game log file
Debug info: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "", stderr: "20230530 154338,INFO,Saving logs to /home/vader/.seventeenlands/seventeenlands.log\n20230530 154339,INFO,Got minimum client version response: {\"is_supported\": true, \"latest_version\": \"0.1.34\", \"min_version\": \"0.1.37\", \"upgrade_instructions\": \"17Lands update required! The minimum supported version for the client is 0.1.37.  Please update with one of the following commands in the terminal, depending on your installation method:\\nbrew update && brew upgrade seventeenlands\\npip3 install --user --upgrade seventeenlands\"}\n20230530 154339,INFO,Minimum supported version: [0, 1, 37]; this version: [0, 1, 39]\n20230530 154339,INFO,Using token 1f4a...7fa0\n20230530 154339,WARNING,Found no files to parse. Try to find Arena's Player.log file and pass it as an argument with -l\n20230530 154339,INFO,Exiting\n" })
Uploading MTGA game data to 17lands...
"/mnt/disk3/lutris/mtg_arena/drive_c/Program Files/Wizards of the Coast/MTGA/MTGA_Data/Logs/Logs/UTC_Log - 03-10-2023 22.03.06.log" appears to be an MTGA game log file
Debug info: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "", stderr: "20230530 154339,INFO,Saving logs to /home/vader/.seventeenlands/seventeenlands.log\n20230530 154339,INFO,Got minimum client version response: {\"is_supported\": true, \"latest_version\": \"0.1.34\", \"min_version\": \"0.1.37\", \"upgrade_instructions\": \"17Lands update required! The minimum supported version for the client is 0.1.37.  Please update with one of the following commands in the terminal, depending on your installation method:\\nbrew update && brew upgrade seventeenlands\\npip3 install --user --upgrade seventeenlands\"}\n20230530 154339,INFO,Minimum supported version: [0, 1, 37]; this version: [0, 1, 39]\n20230530 154339,INFO,Using token 1f4a...7fa0\n20230530 154339,WARNING,Found no files to parse. Try to find Arena's Player.log file and pass it as an argument with -l\n20230530 154339,INFO,Exiting\n" })
Uploading MTGA game data to 17lands...
[4/4] 🚚  Demonizing mtgadmin...!

Future of mtgadmin

So stay tuned. I've got big plans!

Dependencies

~49–87MB
~1.5M SLoC