diff options
| author | Shayne Hartford <shaybox@shaybox.com> | 2024-07-12 02:07:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-12 01:07:24 -0500 |
| commit | cf4e3f609d137dd47595560e86a1075a1ce91eff (patch) | |
| tree | 71070c280d072ea2bbad43c33b6d651d7719ed9b /azalea-protocol/src | |
| parent | ea64fba7f655b9afa03d57e8590c16e024f396f3 (diff) | |
| download | azalea-drasl-cf4e3f609d137dd47595560e86a1075a1ce91eff.tar.xz | |
Add missing configuration and game connection wrappers (#161)
Diffstat (limited to 'azalea-protocol/src')
| -rwxr-xr-x | azalea-protocol/src/connect.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index 691d25c0..20a145cc 100755 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -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> { |
