Skip to content

Commit

Permalink
Fix some game ids and clarify rules 6 and 7. (#143)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Fix typo on rule 6 and wrap text

* Clarify further rule 7

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Tom <[email protected]>
  • Loading branch information
3 people authored Oct 24, 2023
1 parent 2cc9e56 commit e3dd7cd
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/badges/node.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
29 changes: 17 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<game_id><protocol_id>` (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.

Expand Down
2 changes: 1 addition & 1 deletion examples/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions src/games/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
Expand Down
2 changes: 1 addition & 1 deletion src/games/quake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
6 changes: 3 additions & 3 deletions src/games/valve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down

0 comments on commit e3dd7cd

Please sign in to comment.