From 4d71bef595af69dbb695e6ff47814fe55b3e64b2 Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Wed, 27 Mar 2024 20:58:53 -0400 Subject: [PATCH] 0.5.5 - Fix Discord RPC --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- README.md | 2 ++ src/discord.rs | 4 ++-- src/provider/vrcdb.rs | 16 ++++++++++++---- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23c29e3..62ff973 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -682,9 +682,9 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1608,7 +1608,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vrc-log" -version = "0.5.4" +version = "0.5.5" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 8962a1b..42c44c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vrc-log" -version = "0.5.4" +version = "0.5.5" authors = ["Shayne Hartford "] edition = "2021" description = "VRChat Local Cache Avatar ID Logger" diff --git a/README.md b/README.md index 5accb70..742427b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ You can place a **shortcut** to this program within the [VRCX] Auto-Launch Folde ### Provider Support - [Avatar Search (Discord)] - Uses VRCDB +- [Avatar Search (Web)] - Uses VRCDB - [Avatar Search (World)] - Uses VRCDB - ~~Ravenwood (Web & VRCX)~~ - Used VRCDB - Shutdown - ~~[Just H Party (Web & VRCX)]~~ - There's no way to submit avatars @@ -28,6 +29,7 @@ You can place a **shortcut** to this program within the [VRCX] Auto-Launch Folde Additional providers are welcome, please open an issue, pull request, or join Discord [Avatar Search (Discord)]: https://discord.gg/q427ecnUvj +[Avatar Search (Web)]: https://avatarsearch.bs002.de [Avatar Search (World)]: https://vrchat.com/home/world/wrld_1146f625-5d42-40f5-bfe7-06a7664e2796 [Just H Party (Web & VRCX)]: https://avtr.just-h.party [Prismic's Avatar Search (World)]: https://vrchat.com/home/world/wrld_57514404-7f4e-4aee-a50a-57f55d3084bf diff --git a/src/discord.rs b/src/discord.rs index e48e2bf..902865a 100644 --- a/src/discord.rs +++ b/src/discord.rs @@ -14,11 +14,11 @@ lazy_static::lazy_static! { let user_event = Arc::new(RwLock::new(None)); let user_clone = user_event.clone(); let mut client = Client::new(CLIENT_ID); - let _ = client.on_ready(move |ctx| { + client.on_ready(move |ctx| { if let EventData::Ready(event) = ctx.event { *user_event.write() = event.user; }; - }); + }).persist(); client.start(); diff --git a/src/provider/vrcdb.rs b/src/provider/vrcdb.rs index 040b7c1..0002262 100644 --- a/src/provider/vrcdb.rs +++ b/src/provider/vrcdb.rs @@ -40,11 +40,19 @@ impl Default for VRCDB { fn default() -> Self { let client = Client::default(); let userid = USER.clone().map_or_else(Self::default, |user| { - if let Some(username) = user.username { - println!("[{}] Authenticated as {username}", Type::VRCDB); - } + let userid = user.id.unwrap_or_else(Self::default); + if userid == "1045800378228281345" { + eprintln!("Vesktop & arRPC do not support fetching user info."); + eprintln!("The User ID will default to the developer: ShayBox"); + + DEVELOPER_ID.to_owned() + } else { + if let Some(username) = user.username { + println!("[{}] Authenticated as {username}", Type::VRCDB); + } - user.id.unwrap_or_else(Self::default) + userid + } }); Self::new(client, userid)