Skip to content

Commit

Permalink
Merge branch 'azalea-rs:main' into better-1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
AS1100K authored Jul 12, 2024
2 parents 2dd37c0 + cf4e3f6 commit 2e5935d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions azalea-protocol/src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,23 @@ impl Connection<ServerboundLoginPacket, ClientboundLoginPacket> {
) -> Result<GameProfile, ServerSessionServerError> {
azalea_auth::sessionserver::serverside_auth(username, public_key, private_key, ip).await
}

/// Change our state back to configuration.
#[must_use]
pub fn configuration(
self,
) -> Connection<ServerboundConfigurationPacket, ClientboundConfigurationPacket> {
Connection::from(self)
}
}

impl Connection<ServerboundConfigurationPacket, ClientboundConfigurationPacket> {
/// Change our state from configuration to game. This is the state that's
/// used when the client is actually in the world.
#[must_use]
pub fn game(self) -> Connection<ServerboundGamePacket, ClientboundGamePacket> {
Connection::from(self)
}
}

impl Connection<ClientboundConfigurationPacket, ServerboundConfigurationPacket> {
Expand Down

0 comments on commit 2e5935d

Please sign in to comment.