From e3dd7cd1c767298b99218d2dcb26d18d7a10ab3f Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Tue, 24 Oct 2023 22:39:36 +0300 Subject: [PATCH] Fix some game ids and clarify rules 6 and 7. (#143) * Fix wrongly named game ids of l4d, l4d2 and q3a * Specify how edition/protocol names are appended to games, rule 7 * Clarify rule 6 regarding numbers * Add/Update badge * Fix rule 7 misswording * Fix 7 Days to Die * List id changes in the changelog * Forgot to fix test * Apply Douile suggestion regarding rule 6 Co-authored-by: Tom <25043847+Douile@users.noreply.github.com> * Fix typo on rule 6 and wrap text * Clarify further rule 7 --------- Co-authored-by: GitHub Action Co-authored-by: Tom <25043847+Douile@users.noreply.github.com> --- .github/badges/node.svg | 8 ++++---- CHANGELOG.md | 6 ++++++ CONTRIBUTING.md | 29 +++++++++++++++++------------ examples/generic.rs | 2 +- src/games/definitions.rs | 8 ++++---- src/games/quake.rs | 2 +- src/games/valve.rs | 6 +++--- 7 files changed, 36 insertions(+), 25 deletions(-) diff --git a/.github/badges/node.svg b/.github/badges/node.svg index 18d8a03..c329d50 100644 --- a/.github/badges/node.svg +++ b/.github/badges/node.svg @@ -1,5 +1,5 @@ - - Node game coverage: 12% + + Node game coverage: 11% @@ -13,8 +13,8 @@ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a08885..7c4878e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ Who knows what the future holds... - Added [Valheim](https://store.steampowered.com/app/892970/Valheim/) support. ### Breaking: +Game: +- Changed identifications of the following games as they weren't properly expecting the naming rules: +- - Left 4 Dead: `left4dead` -> `l4d`. +- - 7 Days to Die: `7d2d` in definitions and `sd2d` in game declaration -> `sdtd`. +- - Quake 3 Arena: `quake3arena` -> `q3a`. + Protocols: - Valve: Removed `SteamApp` due to it not being really useful at all, replaced all instances with `Engine`. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cfdd666..9151602 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,18 +52,23 @@ and 2017 would be `swb22017`). (`Day of Defeat` -> `dod`), then the new name should ignore rule #2 (`Day of Dragons` -> `dayofdragons`). 5. Roman numbering will be converted to arabic numbering (`XIV` -> `14`). -6. Unless numbers are at the end of a name, they will be considered words, -but digits will always be used instead of the acronym (counter to #2) (`Left 4 -Dead` -> `l4d`) unless they at the start position (`7 Days to Die` -> `sdtd`), -if they are at the end (such as sequel number or the year), always append them -(`Team Fortress 2` -> `teamfortress2`, `Unreal Tournament 2003` -> -`unrealtournament2003`). -7. If a game supports multiple protocols, multiple entries will be done for -said game where the edition/protocol name (first disposable in this order) will -be appended to the game name (Minecraft is divided by 2 editions, Java and Bedrock -which will be `minecraftjava` and `minecraftbedrock` respectively) and one more -entry can be added by the base name of the game which queries in a group said -supported protocols to make generic queries easier and disposable. +6. Unless numbers (years included) are at the end of a name, they will be considered +words. If a number is not in the first position, its entire numeric digits will be +used instead of the acronym of that number's digits (`Left 4 Dead` -> `l4d`). If the +number is in the first position the longhand (words: 5 -> five) representation of the +number will be used to create an acronym (`7 Days to Die` -> `sdtd`). Other examples: +`Team Fortress 2` -> `teamfortress2`, `Unreal Tournament 2003` -> +`unrealtournament2003`. +7. If a game supports multiple protocols, multiple entries will be done for said game +where the edition/protocol name (first disposable in this order) will be appended to +the base game id's: `` (where the protocol id will follow all +rules except #2) (Minecraft is mainly divided by 2 editions, Java and Bedrock +which will be `minecraftjava` and `minecraftbedrock` respectively, but it also has +legacy versions, which use another protocol, an example would be the one for `1.6`, +so the name would be `Legacy 1.6` which its id will be `legacy16`, resulting in the +entry of `minecraftlegacy16`). One more entry can be added by the base name of the +game, which queries in a group said supported protocols to make generic queries +easier and disposable. 8. If its actually about a mod that adds the ability for queries to be performed, process only the mod name. diff --git a/examples/generic.rs b/examples/generic.rs index 7c7ad27..0365dbf 100644 --- a/examples/generic.rs +++ b/examples/generic.rs @@ -114,7 +114,7 @@ mod test { fn teamfortress2() { test_game("teamfortress2"); } #[test] - fn quake() { test_game("quake3"); } + fn quake2() { test_game("quake2"); } #[test] fn all_games() { diff --git a/src/games/definitions.rs b/src/games/definitions.rs index 578e3e5..869287c 100644 --- a/src/games/definitions.rs +++ b/src/games/definitions.rs @@ -77,18 +77,18 @@ pub static GAMES: Map<&'static str, Game> = phf_map! { "insurgency" => game!("Insurgency", 27015, Protocol::Valve(Engine::new(222_880))), "imic" => game!("Insurgency: Modern Infantry Combat", 27015, Protocol::Valve(Engine::new(17700))), "insurgencysandstorm" => game!("Insurgency: Sandstorm", 27131, Protocol::Valve(Engine::new(581_320))), - "left4dead" => game!("Left 4 Dead", 27015, Protocol::Valve(Engine::new(500))), - "left4dead2" => game!("Left 4 Dead 2", 27015, Protocol::Valve(Engine::new(550))), + "l4d" => game!("Left 4 Dead", 27015, Protocol::Valve(Engine::new(500))), + "l4d2" => game!("Left 4 Dead 2", 27015, Protocol::Valve(Engine::new(550))), "ohd" => game!("Operation: Harsh Doorstop", 27005, Protocol::Valve(Engine::new_with_dedicated(736_590, 950_900))), "onset" => game!("Onset", 7776, Protocol::Valve(Engine::new(1_105_810))), "projectzomboid" => game!("Project Zomboid", 16261, Protocol::Valve(Engine::new(108_600))), "quake1" => game!("Quake 1", 27500, Protocol::Quake(QuakeVersion::One)), "quake2" => game!("Quake 2", 27910, Protocol::Quake(QuakeVersion::Two)), - "quake3" => game!("Quake 3: Arena", 27960, Protocol::Quake(QuakeVersion::Three)), + "q3a" => game!("Quake 3 Arena", 27960, Protocol::Quake(QuakeVersion::Three)), "ror2" => game!("Risk of Rain 2", 27016, Protocol::Valve(Engine::new(632_360))), "rust" => game!("Rust", 27015, Protocol::Valve(Engine::new(252_490))), "sco" => game!("Sven Co-op", 27015, Protocol::Valve(Engine::new_gold_src(false))), - "7d2d" => game!("7 Days To Die", 26900, Protocol::Valve(Engine::new(251_570))), + "sdtd" => game!("7 Days to Die", 26900, Protocol::Valve(Engine::new(251_570))), "sof2" => game!("Soldier of Fortune 2", 20100, Protocol::Quake(QuakeVersion::Three)), "serioussam" => game!("Serious Sam", 25601, Protocol::Gamespy(GameSpyVersion::One)), "theforest" => game!("The Forest", 27016, Protocol::Valve(Engine::new(556_450))), diff --git a/src/games/quake.rs b/src/games/quake.rs index 948e18c..dff9d79 100644 --- a/src/games/quake.rs +++ b/src/games/quake.rs @@ -4,6 +4,6 @@ use crate::protocols::quake::game_query_mod; game_query_mod!(quake1, "Quake 1", one, 27500); game_query_mod!(quake2, "Quake 2", two, 27910); -game_query_mod!(quake3, "Quake 3: Arena", three, 27960); +game_query_mod!(q3a, "Quake 3 Arena", three, 27960); game_query_mod!(sof2, "Soldier of Fortune 2", three, 20100); game_query_mod!(warsow, "Warsow", three, 44400); diff --git a/src/games/valve.rs b/src/games/valve.rs index c7a4a71..5b841bc 100644 --- a/src/games/valve.rs +++ b/src/games/valve.rs @@ -80,8 +80,8 @@ game_query_mod!( Engine::new(581_320), 27131 ); -game_query_mod!(left4dead, "Left 4 Dead", Engine::new(500), 27015); -game_query_mod!(left4dead2, "Left 4 Dead 2", Engine::new(550), 27015); +game_query_mod!(l4d, "Left 4 Dead", Engine::new(500), 27015); +game_query_mod!(l4d2, "Left 4 Dead 2", Engine::new(550), 27015); game_query_mod!( ohd, "Operation: Harsh Doorstop", @@ -98,7 +98,7 @@ game_query_mod!( game_query_mod!(ror2, "Risk of Rain 2", Engine::new(632_360), 27016); game_query_mod!(rust, "Rust", Engine::new(252_490), 27015); game_query_mod!(sco, "Sven Co-op", Engine::new_gold_src(false), 27015); -game_query_mod!(sd2d, "7 Days To Die", Engine::new(251_570), 26900); +game_query_mod!(sdtd, "7 Days to Die", Engine::new(251_570), 26900); game_query_mod!(teamfortress2, "Team Fortress 2", Engine::new(440), 27015); game_query_mod!( tfc,