Crates.io | bw-web-api-rs |
lib.rs | bw-web-api-rs |
version | |
source | src |
created_at | 2024-06-26 03:53:07.372796 |
updated_at | 2024-12-05 18:19:03.130975 |
description | A Rust client for the StarCraft: Remastered API |
homepage | |
repository | |
max_upload_size | |
id | 1284148 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A Rust client library for interacting with the StarCraft: Remastered API.
[dependencies]
bw-web-api-rs = "0.2"
Or via cargo:
cargo add bw-web-api-rs
This library uses async/await and requires an async runtime such as tokio.
use bw_web_api_rs::{
ApiClient, ApiConfig, types::{Gateway, Leaderboard}
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ApiConfig {
base_url: "http://127.0.0.1:37843".to_string(),
api_key: None
};
let client = ApiClient::new(config)?;
// Get player match info
let match_info = client.get_matchmaker_player_info(
"MM-EBECDFA6-B0F4-11EF-8534-FA167A7650A3".to_string()
).await?;
// Get player profile
let profile = client.get_aurora_profile(
"By.SnOw1".to_string(),
Gateway::Korea,
AuroraProfileFieldMask::ScrProfile
).await?;
// Get leaderboard
let leaderboard = client.get_leaderboard(
Leaderboard::Global,
Gateway::USWest
).await?;
Ok(())
}
get_aurora_profile(toon, gateway, field_mask)
- Get player profile information with specified field maskget_classic_files_global_maps_1v1()
- Get available 1v1 mapsget_gateway_status()
- Get status of all gatewaysget_leaderboard()
- Get leaderboard metadata including available gamemodes, gateways, and leaderboardsget_leaderboard_entity(leaderboard_id, gateway)
- Get leaderboard entries for a specific leaderboard and gatewayget_leaderboard_rank(leaderboard_id, toon, gateway)
- Get specific player's rankingget_map_stats(toon, gateway)
- Get player's map statisticsget_matchmaker_gameinfo(toon, gateway, gamemode, season, offset, limit)
- Get player's match historyget_matchmaker_player_info(match_id)
- Get detailed match informationScrProfile
- Basic profile informationScrMmGameLoading
- Matchmaking game loading informationScrMmToonInfo
- Detailed matchmaking informationScrToonInfo
- Basic character informationTo find the port StarCraft: Remastered is using on Windows (requires administrator privileges):
(Get-NetTCPConnection -OwningProcess (Get-Process -Name StarCraft | Select-Object -ExpandProperty Id) | Where-Object {$_.State -eq "Listen"} | Sort-Object -Property LocalPort | Select-Object -First 1).LocalPort
The library provides a comprehensive error type ApiError
that covers:
This project is licensed under the MIT License - see the LICENSE file for details.