mirror of https://github.com/zyllian/classics.git synced 2025-05-10 00:46:39 -07:00

implement making players operators in config

This commit is contained in:
Zoey 2024-04-22 18:51:11 -07:00
parent c1eb4e1a8b
commit 990777e5b4
No known key found for this signature in database
GPG key ID: 8611B896D1AAFAF2
3 changed files with 15 additions and 4 deletions

View file

@ -141,6 +141,13 @@ async fn handle_stream_inner(
.pop()
.unwrap_or_else(|| data.players.len() as i8);
let player_type = data
.config
.player_perms
.get(&username)
.copied()
.unwrap_or_default();
let player = Player {
_addr: addr,
id: *own_id, // TODO: actually assign user ids
@ -151,7 +158,7 @@ async fn handle_stream_inner(
z: zero,
yaw: 0,
pitch: 0,
player_type: PlayerType::Normal,
player_type,
packets_to_send: Vec::new(),
};
@ -159,7 +166,7 @@ async fn handle_stream_inner(
protocol_version: 0x07,
server_name: data.config.name.clone(),
server_motd: data.config.motd.clone(),
user_type: PlayerType::Normal,
user_type: player_type,
});
println!("generating level packets");