1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

Add missing configuration and game connection wrappers (#161)

This commit is contained in:
Shayne Hartford 2024-07-12 02:07:24 -04:00 committed by GitHub
parent ea64fba7f6
commit cf4e3f609d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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> {