Skip to content

Commit

Permalink
fix: add user_id
Browse files Browse the repository at this point in the history
  • Loading branch information
sargon64 committed Nov 2, 2023
1 parent 0096284 commit 46b19d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::packets::TAState;
pub struct User {
id: Uuid,
name: String,
user_id: String,
play_state: PlayState,
download_state: DownloadState,
team: Option<Team>,
Expand Down Expand Up @@ -147,6 +148,7 @@ impl TAState {
.iter()
.map(|p| User {
id: Uuid::parse_str(&p.guid).unwrap(),
user_id: p.user_id.clone(),
name: p.name.clone(),
play_state: unsafe { std::mem::transmute_copy::<i32, crate::structs::PlayState>(&p.play_state) },
download_state: unsafe { std::mem::transmute_copy::<i32, crate::structs::DownloadState>(&p.download_state) },
Expand All @@ -165,6 +167,7 @@ impl TAState {
.map(|p| User {
id: Uuid::parse_str(&p.guid).unwrap(),
name: p.name.clone(),
user_id: p.user_id.clone(),
play_state: unsafe { std::mem::transmute_copy::<i32, crate::structs::PlayState>(&p.play_state) },
download_state: unsafe { std::mem::transmute_copy::<i32, crate::structs::DownloadState>(&p.download_state) },
team: p.team.as_ref().map(|t| Team {
Expand All @@ -191,6 +194,7 @@ impl TAState {
.map(|p| User {
id: Uuid::parse_str(&p.guid).unwrap(),
name: p.name.clone(),
user_id: p.user_id.clone(),
play_state: unsafe { std::mem::transmute_copy::<i32, crate::structs::PlayState>(&p.play_state) },
download_state: unsafe { std::mem::transmute_copy::<i32, crate::structs::DownloadState>(&p.download_state) },
team: p.team.as_ref().map(|t| Team {
Expand All @@ -213,6 +217,7 @@ impl TAState {
.map(|c| User {
id: Uuid::parse_str(&c.guid).unwrap(),
name: c.name.clone(),
user_id: c.user_id.clone(),
play_state: unsafe { std::mem::transmute_copy::<i32, crate::structs::PlayState>(&c.play_state) },
download_state: unsafe { std::mem::transmute_copy::<i32, crate::structs::DownloadState>(&c.download_state) },
team: c.team.as_ref().map(|t| Team {
Expand Down

0 comments on commit 46b19d3

Please sign in to comment.