Skip to main content

nurtex_protocol/packets/login/
packets.rs

1use nurtex_codec::Buffer;
2use nurtex_derive::Packet;
3
4use crate::types::{Property, TextComponent};
5
6#[derive(Clone, Debug, PartialEq, Packet)]
7pub struct ClientsideLoginDisconnect {
8  pub reason: TextComponent,
9}
10
11#[derive(Clone, Debug, PartialEq, Packet)]
12pub struct ClientsideEncryptionRequest {
13  pub server_id: String,
14  pub public_key: Vec<u8>,
15  pub verify_token: Vec<u8>,
16  pub should_authenticate: bool,
17}
18
19#[derive(Clone, Debug, PartialEq, Packet)]
20pub struct ClientsideLoginSuccess {
21  pub uuid: uuid::Uuid,
22  pub username: String,
23  pub properties: Vec<Property>,
24}
25
26#[derive(Clone, Debug, PartialEq, Packet)]
27pub struct ClientsideSetCompression {
28  #[varint]
29  pub compression_threshold: i32,
30}
31
32#[derive(Clone, Debug, PartialEq, Packet)]
33pub struct ClientsidePluginRequest {
34  #[varint]
35  pub message_id: i32,
36  pub channel: String,
37  pub data: Vec<u8>,
38}
39
40#[derive(Clone, Debug, PartialEq, Packet)]
41pub struct ClientsideCookieRequest {
42  pub key: String,
43}
44
45#[derive(Clone, Debug, PartialEq, Packet)]
46pub struct ServersideLoginStart {
47  pub username: String,
48  pub uuid: uuid::Uuid,
49}
50
51#[derive(Clone, Debug, PartialEq, Packet)]
52pub struct ServersideEncryptionResponse {
53  pub shared_secret: Vec<u8>,
54  pub verify_token: Vec<u8>,
55}
56
57#[derive(Clone, Debug, PartialEq, Packet)]
58pub struct ServersidePluginResponse {
59  #[varint]
60  pub message_id: i32,
61  pub data: Option<Vec<u8>>,
62}
63
64#[derive(Clone, Debug, PartialEq, Packet)]
65pub struct ServersideLoginAcknowledged;
66
67#[derive(Clone, Debug, PartialEq, Packet)]
68pub struct ServersideCookieResponse {
69  pub key: String,
70  pub payload: Option<Vec<u8>>,
71}