Skip to content

Commit

Permalink
impl(game): starbound support (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
cainthebest authored Dec 5, 2024
2 parents c04f442 + b6696e1 commit d1eb6d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions crates/lib/src/games/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ pub static GAMES: Map<&'static str, Game> = phf_map! {
"soulmask" => game!("Soulmask", 27015, Protocol::Valve(Engine::new(2_646_460))),
"serioussam" => game!("Serious Sam", 25601, Protocol::Gamespy(GameSpyVersion::One)),
"squad" => game!("Squad", 27165, Protocol::Valve(Engine::new(393_380))),
"starbound" => game!("Starbound", 21025, Protocol::Valve(Engine::new(211_820)), GatheringSettings {
players: GatherToggle::Enforce,
rules: GatherToggle::Enforce,
check_app_id: false,
}.into_extra()),
"theforest" => game!("The Forest", 27016, Protocol::Valve(Engine::new_with_dedicated(242_760, 556_450))),
"thefront" => game!("The Front", 27015, Protocol::Valve(Engine::new(2_285_150))),
"teamfortress2" => game!("Team Fortress 2", 27015, Protocol::Valve(Engine::new(440))),
Expand Down
11 changes: 11 additions & 0 deletions crates/lib/src/games/valve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ game_query_mod!(sco, "Sven Co-op", Engine::new_gold_src(false), 27015);
game_query_mod!(sdtd, "7 Days to Die", Engine::new(251_570), 26900);
game_query_mod!(soulmask, "Soulmask", Engine::new(2_646_460), 27015);
game_query_mod!(squad, "Squad", Engine::new(393_380), 27165);
game_query_mod!(
starbound,
"Starbound",
Engine::new(211_820),
21025,
GatheringSettings {
players: GatherToggle::Enforce,
rules: GatherToggle::Enforce,
check_app_id: false,
}
);
game_query_mod!(teamfortress2, "Team Fortress 2", Engine::new(440), 27015);
game_query_mod!(
tfc,
Expand Down
4 changes: 2 additions & 2 deletions crates/lib/src/protocols/valve/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum Server {

impl Server {
pub(crate) fn from_gldsrc(value: u8) -> GDResult<Self> {
Ok(match value {
Ok(match value.to_ascii_lowercase() {
100 => Self::Dedicated, //'d'
108 => Self::NonDedicated, //'l'
112 => Self::TV, //'p'
Expand All @@ -39,7 +39,7 @@ pub enum Environment {

impl Environment {
pub(crate) fn from_gldsrc(value: u8) -> GDResult<Self> {
Ok(match value {
Ok(match value.to_ascii_lowercase() {
108 => Self::Linux, //'l'
119 => Self::Windows, //'w'
109 | 111 => Self::Mac, //'m' or 'o'
Expand Down

0 comments on commit d1eb6d7

Please sign in to comment.