mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
- remove overwritten logging setting in server-cli - add server-cli command to load a random area for testing without a client - make admin add/remove commands modify ingame players instead of needing to reconnect - add spans to par_join jobs - added test command that loads up an area of the world - add tracy-world-server alias - set debug directives to info for logging
35 lines
1.1 KiB
Rust
35 lines
1.1 KiB
Rust
use std::sync::Arc;
|
|
use tokio::runtime::Runtime;
|
|
|
|
pub fn admin_subcommand(
|
|
runtime: Arc<Runtime>,
|
|
sub_m: &clap::ArgMatches,
|
|
server_settings: &server::Settings,
|
|
editable_settings: &mut server::EditableSettings,
|
|
data_dir: &std::path::Path,
|
|
) {
|
|
let login_provider = server::login_provider::LoginProvider::new(
|
|
server_settings.auth_server_address.clone(),
|
|
runtime,
|
|
);
|
|
|
|
match sub_m.subcommand() {
|
|
("add", Some(sub_m)) => {
|
|
if let Some(username) = sub_m.value_of("username") {
|
|
server::add_admin(username, &login_provider, editable_settings, data_dir);
|
|
}
|
|
},
|
|
("remove", Some(sub_m)) => {
|
|
if let Some(username) = sub_m.value_of("username") {
|
|
server::remove_admin(username, &login_provider, editable_settings, data_dir);
|
|
}
|
|
},
|
|
// TODO: can clap enforce this?
|
|
// or make this list current admins or something
|
|
_ => tracing::error!(
|
|
"Invalid input, use one of the subcommands listed using: \nveloren-server-cli help \
|
|
admin"
|
|
),
|
|
}
|
|
}
|