Files
Pumpkin/crates/pumpkin-config/src/commands.rs
2026-08-06 12:56:40 +02:00

35 lines
1.1 KiB
Rust

use pumpkin_util::PermissionLvl;
use serde::{Deserialize, Serialize};
/// Configuration for command handling and execution.
///
/// Controls how commands are accepted, logged, and which permission
/// level non-operator players receive by default.
#[derive(Deserialize, Serialize)]
#[serde(default)]
pub struct CommandsConfig {
/// Whether commands from the console are accepted.
pub use_console: bool,
/// Whether to use rusty line for tty input.
pub use_tty: bool,
/// Whether commands from players are logged in the console.
pub log_console: bool,
/// Whether console and RCON command output is broadcast to online operators.
/// Corresponds to vanilla's `broadcast-console-to-ops` server property.
pub broadcast_console_to_ops: bool,
/// The `op` permission level of everyone that is not in the `ops` file.
pub default_op_level: PermissionLvl,
}
impl Default for CommandsConfig {
fn default() -> Self {
Self {
use_console: true,
log_console: true,
use_tty: true,
broadcast_console_to_ops: true,
default_op_level: PermissionLvl::Zero,
}
}
}