-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
246 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod home_server_config; | ||
pub mod models; | ||
|
||
use derive_builder::Builder; | ||
use getset::Getters; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#[derive(Debug, Default)] | ||
|
||
pub struct GameServerExecutingState { | ||
pub minecraft_server_mgpf: bool, | ||
pub sdtd_server: bool, | ||
pub terraria_server: bool, | ||
pub ark_server: bool, | ||
pub ark_server_second: bool, | ||
pub ark_server_third: bool, | ||
} | ||
|
||
impl GameServerExecutingState { | ||
pub fn current_executing_count(&self) -> usize { | ||
self.minecraft_server_mgpf as usize | ||
+ self.sdtd_server as usize | ||
+ self.terraria_server as usize | ||
+ self.ark_server as usize | ||
+ self.ark_server_second as usize | ||
+ self.ark_server_third as usize | ||
} | ||
} | ||
|
||
pub enum Game { | ||
MinecraftServerMgpf, | ||
SdtdServer, | ||
TerrariaServer, | ||
ArkServer, | ||
ArkServerSecond, | ||
ArkServerThird, | ||
} | ||
|
||
impl Game { | ||
pub fn to_service_name(&self) -> String { | ||
match self { | ||
Game::MinecraftServerMgpf => "minecraft-server-mgpf.service".to_string(), | ||
Game::SdtdServer => "sdtd-server.service".to_string(), | ||
Game::TerrariaServer => "terraria-server.service".to_string(), | ||
Game::ArkServer => "ark-server.service".to_string(), | ||
Game::ArkServerSecond => "ark-server-second.service".to_string(), | ||
Game::ArkServerThird => "ark-server-third.service".to_string(), | ||
} | ||
} | ||
} |