mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-10-01 01:26:08 -04:00
punishments
This commit is contained in:
parent
8913f827ff
commit
01aa411498
@ -1341,6 +1341,28 @@ impl VeilidAPI {
|
||||
}
|
||||
}
|
||||
|
||||
async fn debug_punish_list(&self, _args: Vec<String>) -> VeilidAPIResult<String> {
|
||||
//
|
||||
let network_manager = self.network_manager()?;
|
||||
let address_filter = network_manager.address_filter();
|
||||
|
||||
let out = format!("Address Filter Punishments:\n{:#?}", address_filter);
|
||||
return Ok(out);
|
||||
}
|
||||
|
||||
async fn debug_punish(&self, args: String) -> VeilidAPIResult<String> {
|
||||
let args: Vec<String> =
|
||||
shell_words::split(&args).map_err(|e| VeilidAPIError::parse_error(e, args))?;
|
||||
|
||||
let command = get_debug_argument_at(&args, 0, "debug_punish", "command", get_string)?;
|
||||
|
||||
if command == "list" {
|
||||
self.debug_punish_list(args).await
|
||||
} else {
|
||||
Ok(">>> Unknown command\n".to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn debug_help(&self, _args: String) -> VeilidAPIResult<String> {
|
||||
Ok(r#"buckets [dead|reliable]
|
||||
dialinfo
|
||||
@ -1358,6 +1380,7 @@ restart network
|
||||
contact <node>[<modifiers>]
|
||||
ping <destination>
|
||||
relay <relay> [public|local]
|
||||
punish list
|
||||
route allocate [ord|*ord] [rel] [<count>] [in|out]
|
||||
release <route>
|
||||
publish <route> [full]
|
||||
@ -1450,6 +1473,8 @@ record list <local|remote>
|
||||
self.debug_route(rest).await
|
||||
} else if arg == "record" {
|
||||
self.debug_record(rest).await
|
||||
} else if arg == "punish" {
|
||||
self.debug_punish(rest).await
|
||||
} else {
|
||||
Err(VeilidAPIError::generic("Unknown server debug command"))
|
||||
}
|
||||
|
@ -6,7 +6,8 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
||||
flutter: '>=3.10.6'
|
||||
|
||||
dependencies:
|
||||
change_case: ^1.0.1
|
||||
charcode: ^1.3.1
|
||||
|
Loading…
Reference in New Issue
Block a user