Skip to content

Commit

Permalink
add doc comment about d=
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Jan 7, 2024
1 parent 1347f35 commit 5ea1271
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 6 additions & 3 deletions azalea-auth/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError>
///
/// If you don't have a Microsoft auth token, you can get it from
/// [`get_ms_link_code`] and then [`get_ms_auth_token`].
///
/// If you got the MSA token from your own app (as opposed to the default
/// Nintendo Switch one), you may have to prepend "d=" to the token.
pub async fn get_minecraft_token(
client: &reqwest::Client,
msa: &str,
Expand Down Expand Up @@ -418,9 +421,9 @@ async fn auth_with_xbox_live(
"Properties": {
"AuthMethod": "RPS",
"SiteName": "user.auth.xboxlive.com",
// i thought this was supposed to be d={} but it doesn't work for
// me when i add it ??????
"RpsTicket": format!("{access_token}")
// this value should have "d=" prepended if you're using your own app (as opposed to
// the default nintendo switch one)
"RpsTicket": access_token
},
"RelyingParty": "http://auth.xboxlive.com",
"TokenType": "JWT"
Expand Down
1 change: 0 additions & 1 deletion azalea-block/src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5380,4 +5380,3 @@ make_block_states! {
},
}
}

8 changes: 8 additions & 0 deletions azalea-inventory/src/slot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ impl ItemSlot {
}
}
}

/// Convert this slot into an [`ItemSlotData`], if it's present.
pub fn as_present(&self) -> Option<&ItemSlotData> {
match self {
ItemSlot::Empty => None,
ItemSlot::Present(i) => Some(i),
}
}
}

/// An item in an inventory, with a count and NBT. Usually you want [`ItemSlot`]
Expand Down

0 comments on commit 5ea1271

Please sign in to comment.