aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/account.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-18 16:54:49 -0500
committermat <github@matdoes.dev>2022-06-18 16:54:49 -0500
commitfc3151f89db1cf018bfebebb8f102e20911e64d3 (patch)
treee04047dbcbfd9d9e8c6b7a98658ccdb4802eeabd /azalea-client/src/account.rs
parente32b8fabb78a86e073c7bb3270b1bc89a532350a (diff)
downloadazalea-drasl-fc3151f89db1cf018bfebebb8f102e20911e64d3.tar.xz
account.rs and client.rs
Diffstat (limited to 'azalea-client/src/account.rs')
-rw-r--r--azalea-client/src/account.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/azalea-client/src/account.rs b/azalea-client/src/account.rs
new file mode 100644
index 00000000..00a5d0f6
--- /dev/null
+++ b/azalea-client/src/account.rs
@@ -0,0 +1,27 @@
+use crate::Client;
+use azalea_protocol::{
+ packets::game::{
+ clientbound_player_chat_packet::ClientboundPlayerChatPacket,
+ clientbound_system_chat_packet::ClientboundSystemChatPacket,
+ },
+ ServerAddress,
+};
+use std::fmt::Debug;
+
+///! Connect to Minecraft servers.
+
+/// Something that can join Minecraft servers.
+pub struct Account {
+ pub username: String,
+}
+impl Account {
+ pub fn offline(username: &str) -> Self {
+ Self {
+ username: username.to_string(),
+ }
+ }
+
+ pub async fn join(&self, address: &ServerAddress) -> Result<Client, String> {
+ Client::join(self, address).await
+ }
+}