Skip to content

Commit

Permalink
fix ClientboundPlayerInfoUpdatePacket and replace GameProfile with Lo…
Browse files Browse the repository at this point in the history
…ginFinished in an example
  • Loading branch information
mat-1 committed Oct 26, 2024
1 parent a3cf78e commit b762575
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion azalea-protocol/src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub struct WriteConnection<W: ProtocolPacket> {
/// ClientboundLoginPacket::LoginCompression(p) => {
/// conn.set_compression_threshold(p.compression_threshold);
/// }
/// ClientboundLoginPacket::GameProfile(p) => {
/// ClientboundLoginPacket::LoginFinished(p) => {
/// break (conn.configuration(), p.game_profile);
/// }
/// ClientboundLoginPacket::LoginDisconnect(p) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub struct ActionEnumSet {

impl McBufReadable for ActionEnumSet {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
let set = FixedBitSet::<6>::read_from(buf)?;
let set = FixedBitSet::<7>::read_from(buf)?;
Ok(ActionEnumSet {
add_player: set.index(0),
initialize_chat: set.index(1),
Expand All @@ -189,7 +189,7 @@ impl McBufReadable for ActionEnumSet {

impl McBufWritable for ActionEnumSet {
fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
let mut set = FixedBitSet::<6>::new();
let mut set = FixedBitSet::<7>::new();
if self.add_player {
set.set(0);
}
Expand All @@ -208,6 +208,9 @@ impl McBufWritable for ActionEnumSet {
if self.update_display_name {
set.set(5);
}
if self.update_list_order {
set.set(6);
}
set.write_into(buf)?;
Ok(())
}
Expand Down

0 comments on commit b762575

Please sign in to comment.