Skip to content

Commit

Permalink
0.5.5 - Fix Discord RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayBox committed Mar 28, 2024
1 parent 0a9addb commit 4d71bef
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vrc-log"
version = "0.5.4"
version = "0.5.5"
authors = ["Shayne Hartford <[email protected]>"]
edition = "2021"
description = "VRChat Local Cache Avatar ID Logger"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/discord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
16 changes: 12 additions & 4 deletions src/provider/vrcdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4d71bef

Please sign in to comment.