M Cargo.lock => Cargo.lock +121 -50
@@ 379,21 379,21 @@ dependencies = [
[[package]]
name = "bevy_console"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9dc4cac94fee1422622e25965f04e5f2b23e4b674783e617990a21a3e04ae84"
+checksum = "273266d95cc95d1ab9bf1b6b831ecedb7ed23269e2bbe833ac3bc73e0e888360"
dependencies = [
"bevy",
"bevy_console_derive",
- "bevy_console_parser",
"bevy_egui",
+ "clap",
]
[[package]]
name = "bevy_console_derive"
-version = "0.4.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbe2a385f3b2bd64a98a2da677579f6354d0129782ca0a615d099ff33fdf496e"
+checksum = "9bfc5e1962775c30fff70367f6aa7526190a4fe8495a6ae4a3d939bd889fee1e"
dependencies = [
"better-bae",
"proc-macro2",
@@ 402,16 402,6 @@ dependencies = [
]
[[package]]
-name = "bevy_console_parser"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aaf47f8d4f6ab7867cf3e8a40e5d45567e4f1d5c436fe11e3070dde95fa66aca"
-dependencies = [
- "nom",
- "nom-supreme",
-]
-
-[[package]]
name = "bevy_core"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1159,15 1149,6 @@ dependencies = [
]
[[package]]
-name = "brownstone"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5839ee4f953e811bfdcf223f509cb2c6a3e1447959b0bff459405575bc17f22"
-dependencies = [
- "arrayvec",
-]
-
-[[package]]
name = "bstr"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1298,6 1279,43 @@ dependencies = [
]
[[package]]
+name = "clap"
+version = "4.0.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39"
+dependencies = [
+ "bitflags",
+ "clap_derive",
+ "clap_lex",
+ "is-terminal",
+ "once_cell",
+ "strsim",
+ "termcolor",
+]
+
+[[package]]
+name = "clap_derive"
+version = "4.0.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014"
+dependencies = [
+ "heck",
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
+dependencies = [
+ "os_str_bytes",
+]
+
+[[package]]
name = "clipboard-win"
version = "4.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1757,6 1775,27 @@ dependencies = [
]
[[package]]
+name = "errno"
+version = "0.2.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
+dependencies = [
+ "errno-dragonfly",
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "errno-dragonfly"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
+dependencies = [
+ "cc",
+ "libc",
+]
+
+[[package]]
name = "error-code"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2183,6 2222,15 @@ dependencies = [
]
[[package]]
+name = "hermit-abi"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
+dependencies = [
+ "libc",
+]
+
+[[package]]
name = "hex"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2332,12 2380,6 @@ dependencies = [
]
[[package]]
-name = "indent_write"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3"
-
-[[package]]
name = "indexmap"
version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2397,12 2439,34 @@ dependencies = [
]
[[package]]
+name = "io-lifetimes"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
+dependencies = [
+ "libc",
+ "windows-sys 0.42.0",
+]
+
+[[package]]
name = "ipnet"
version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e"
[[package]]
+name = "is-terminal"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
+dependencies = [
+ "hermit-abi 0.2.6",
+ "io-lifetimes",
+ "rustix",
+ "windows-sys 0.42.0",
+]
+
+[[package]]
name = "itertools"
version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2461,12 2525,6 @@ dependencies = [
]
[[package]]
-name = "joinery"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5"
-
-[[package]]
name = "jpeg-decoder"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2562,6 2620,12 @@ dependencies = [
]
[[package]]
+name = "linux-raw-sys"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
+
+[[package]]
name = "lock_api"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2900,19 2964,6 @@ dependencies = [
]
[[package]]
-name = "nom-supreme"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bd3ae6c901f1959588759ff51c95d24b491ecb9ff91aa9c2ef4acc5b1dcab27"
-dependencies = [
- "brownstone",
- "indent_write",
- "joinery",
- "memchr",
- "nom",
-]
-
-[[package]]
name = "notify"
version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3009,7 3060,7 @@ version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5"
dependencies = [
- "hermit-abi",
+ "hermit-abi 0.1.19",
"libc",
]
@@ 3163,6 3214,12 @@ dependencies = [
]
[[package]]
+name = "os_str_bytes"
+version = "6.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
+
+[[package]]
name = "overload"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3574,6 3631,20 @@ dependencies = [
]
[[package]]
+name = "rustix"
+version = "0.36.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549"
+dependencies = [
+ "bitflags",
+ "errno",
+ "io-lifetimes",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys 0.42.0",
+]
+
+[[package]]
name = "rustls"
version = "0.20.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
M sdbclient/Cargo.toml => sdbclient/Cargo.toml +2 -2
@@ 14,8 14,8 @@ license = "GPL-3.0-only"
bevy = { version = "0.9.1" }
# 0.18.0 breaks inspector, but not a major issue right now
bevy_egui = "0.17"
-bevy-inspector-egui = "0.14.0"
-bevy_console = "0.5.0"
+bevy-inspector-egui = "0.14"
+bevy_console = "0.6.0"
bevy_mod_scripting = { version = "0.2.1", features = ["lua", "lua54", "lua_script_api"] }
M sdbclient/src/lua/mod.rs => sdbclient/src/lua/mod.rs +1 -1
@@ 59,7 59,7 @@ impl APIProvider for LuaAPIProvider {
let mut events: Mut<Events<PrintConsoleLine>> =
world.get_resource_mut().unwrap();
- events.send(PrintConsoleLine { line: msg });
+ events.send(PrintConsoleLine::new(msg.into()));
Ok(())
})
M sdbclient/src/plugins/connection_check/mod.rs => sdbclient/src/plugins/connection_check/mod.rs +8 -7
@@ 52,18 52,19 @@ fn handle_connection_check(
match res {
Ok(api_info) => {
console.send(PrintConsoleLine::new(
- "API connection check passed".to_string(),
+ "API connection check passed".to_string().into(),
+ ));
+ console.send(PrintConsoleLine::new(
+ format!("API version: {}", api_info.ver).into(),
));
- console.send(PrintConsoleLine::new(format!(
- "API version: {}",
- api_info.ver
- )));
}
Err(err) => {
console.send(PrintConsoleLine::new(
- "API connection check FAILED with following error:".to_string(),
+ "API connection check FAILED with following error:"
+ .to_string()
+ .into(),
));
- console.send(PrintConsoleLine::new(err));
+ console.send(PrintConsoleLine::new(err.into()));
}
}
M => +4 -5
@@ 110,10 110,9 @@ fn handle_login_call(
if let Some(login_call_response) = future::block_on(future::poll_once(&mut task.0)) {
match login_call_response.token {
ResponseToken::Valid(res) => {
console.send(PrintConsoleLine::new(format!(
"Logged in with: {}",
inputs.email
)));
console.send(PrintConsoleLine::new(
format!("Logged in with: {}", inputs.email).into(),
));
match login_call_response.user_infop.unwrap() {
ResponseUserInfoP::Valid(infop) => {
@@ 135,7 134,7 @@ fn handle_login_call(
ResponseUserInfoP::Error { error } => {
console.send(PrintConsoleLine::new(format!(
"Something went wrong with getting the user information after logging in, got error: '{}'", error
)));
).into()));
login_state.set(LoginState::None).unwrap();
menu_state.set(MenuState::AccountLoggedIn).unwrap();
M => +4 -5
@@ 106,10 106,9 @@ fn handle_register_call(
if let Some(register_call_response) = future::block_on(future::poll_once(&mut task.0)) {
match register_call_response.register {
ResponseRegister::Valid(register_res) => {
console.send(PrintConsoleLine::new(format!(
"Registered user: {}",
register_res.username,
)));
console.send(PrintConsoleLine::new(
format!("Registered user: {}", register_res.username,).into(),
));
match register_call_response.token {
ResponseToken::Valid(token_res) => {
@@ 133,7 132,7 @@ fn handle_register_call(
// And if the server does indeed shit itself between those calls, the user can just login normally, so 🤷♀️
console.send(PrintConsoleLine::new(format!(
"Something went wrong with getting the user token after registering, got error: '{}'", error
)));
).into()));
register_state.set(RegisterState::None).unwrap();
menu_state.set(MenuState::AccountLoggedOut).unwrap();
M sdbclient/src/util/sl.rs => sdbclient/src/util/sl.rs +21 -27
@@ 20,10 20,9 @@ pub fn load<T: Default + for<'a> serde::Deserialize<'a>>(
match std::path::Path::new(&file_path).exists() {
true => {
- console.send(PrintConsoleLine::new(format!(
- "sl::load found '{}'",
- file_path
- )));
+ console.send(PrintConsoleLine::new(
+ format!("sl::load found '{}'", file_path).into(),
+ ));
let json: Vec<u8> = std::fs::read(file_path.clone()).unwrap();
serde_json::from_str(std::str::from_utf8(&json).unwrap()).expect(&format!(
"sl::load couldn't deserialize the config at '{}'",
@@ 31,10 30,9 @@ pub fn load<T: Default + for<'a> serde::Deserialize<'a>>(
))
}
false => {
- console.send(PrintConsoleLine::new(format!(
- "sl::load couldn't find '{}', using defaults",
- file_path
- )));
+ console.send(PrintConsoleLine::new(
+ format!("sl::load couldn't find '{}', using defaults", file_path).into(),
+ ));
T::default()
}
}
@@ 55,20 53,18 @@ where
match std::path::Path::new(target_dir).exists() {
true => {}
false => {
- console.send(PrintConsoleLine::new(format!(
- "sl::save creating target dir '{}'",
- target_dir
- )));
+ console.send(PrintConsoleLine::new(
+ format!("sl::save creating target dir '{}'", target_dir).into(),
+ ));
match std::fs::create_dir_all(target_dir) {
Ok(_) => {}
Err(_) => {
- console.send(PrintConsoleLine::new(format!(
- "sl::save couldn't create target dir '{}'",
- target_dir
- )));
- console.send(PrintConsoleLine::new(format!(
- "sl::save nothing will be saved!"
- )));
+ console.send(PrintConsoleLine::new(
+ format!("sl::save couldn't create target dir '{}'", target_dir).into(),
+ ));
+ console.send(PrintConsoleLine::new(
+ format!("sl::save nothing will be saved!").into(),
+ ));
return false;
}
}
@@ 77,17 73,15 @@ where
match std::fs::write(&file_path, json) {
Ok(_) => {
- console.send(PrintConsoleLine::new(format!(
- "sl::save wrote file '{}'",
- file_path
- )));
+ console.send(PrintConsoleLine::new(
+ format!("sl::save wrote file '{}'", file_path).into(),
+ ));
true
}
Err(_) => {
- console.send(PrintConsoleLine::new(format!(
- "sl::save couldn't write file '{}'",
- file_path
- )));
+ console.send(PrintConsoleLine::new(
+ format!("sl::save couldn't write file '{}'", file_path).into(),
+ ));
false
}
}