Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added playerlist to instance info #125

Merged
merged 4 commits into from
Mar 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/traits/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use std::collections::HashSet;

use async_trait::async_trait;

use serde::{Deserialize, Serialize};

use ts_rs::TS;

use self::t_player::Player;
use self::t_configurable::Game;
use self::t_server::State;
use self::{
Expand Down Expand Up @@ -32,6 +35,7 @@ pub struct InstanceInfo {
pub state: State,
pub player_count: Option<u32>,
pub max_player_count: Option<u32>,
pub player_list: Option<HashSet<Player>>,
}
use crate::minecraft::MinecraftInstance;
use crate::prelude::GameInstance;
Expand All @@ -55,6 +59,7 @@ pub trait TInstance:
state: self.state().await,
player_count: self.get_player_count().await.ok(),
max_player_count: self.get_max_player_count().await.ok(),
player_list: self.get_player_list().await.ok(),
}
}
}