From cf4e3f609d137dd47595560e86a1075a1ce91eff Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Fri, 12 Jul 2024 02:07:24 -0400 Subject: [PATCH] Add missing configuration and game connection wrappers (#161) --- azalea-protocol/src/connect.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index 691d25c06..20a145cc3 100755 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -501,6 +501,23 @@ impl Connection { ) -> Result { 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 { + Connection::from(self) + } +} + +impl Connection { + /// 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 { + Connection::from(self) + } } impl Connection {