diff options
Diffstat (limited to 'azalea-client/src')
| -rwxr-xr-x | azalea-client/src/connect.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/azalea-client/src/connect.rs b/azalea-client/src/connect.rs index b402200a..44eff33f 100755 --- a/azalea-client/src/connect.rs +++ b/azalea-client/src/connect.rs @@ -43,14 +43,19 @@ pub async fn join_server(address: &ServerAddress) -> Result<(), String> { LoginPacket::ClientboundHelloPacket(p) => { println!("Got encryption request {:?} {:?}", p.nonce, p.public_key); let e = azalea_auth::encryption::encrypt(&p.public_key, &p.nonce).unwrap(); + + // TODO: authenticate with the server here (authenticateServer) + println!("Sending encryption response {:?}", e); + conn.write( ServerboundKeyPacket { - nonce: e.encrypted_nonce, - shared_secret: e.encrypted_public_key, + nonce: e.encrypted_nonce.into(), + shared_secret: e.encrypted_public_key.into(), } .get(), ) .await; + conn.set_encryption_key(e.secret_key); } LoginPacket::ClientboundLoginCompressionPacket(p) => { println!("Got compression request {:?}", p.compression_threshold); |
