remove fonction
All checks were successful
Rust Checks / checks (push) Successful in 3m43s
Rust Checks / checks (pull_request) Successful in 2m40s

This commit is contained in:
CoCo_Sol 2024-03-21 22:01:10 +01:00
parent 0d048b3a57
commit 1bcb81be0b
2 changed files with 1 additions and 9 deletions

View file

@ -43,7 +43,7 @@ pub fn accept_connection(
// Check if the player is an admin
if all_players
.get_by_connection(&connection)
.map(|player| player.is_admin())
.map(|player| player.rank == GameRank::Admin)
!= Some(true)
{
return;

View file

@ -37,14 +37,6 @@ impl AllPlayers {
/// Get the player by a connection.
pub fn get_by_connection(&self, connection: &Connection) -> Option<&Player> {
let uuid = connection.identifier()?;
self.0.get(&uuid)
}
}
impl Player {
/// Create a new player.
pub fn is_admin(&self) -> bool {
self.rank == GameRank::Admin
}
}