steel_protocol/packets/handshake/
mod.rs1use steel_macros::{ReadFrom, ServerPacket};
2
3#[derive(Clone, Copy, PartialEq, Eq, ReadFrom, Debug)]
4#[read(as = VarInt)]
5pub enum ClientIntent {
6 Status = 1,
7 Login = 2,
8 Transfer = 3,
9}
10
11#[derive(ReadFrom, ServerPacket, Clone, Debug)]
12pub struct SClientIntention {
13 #[read(as = VarInt)]
14 pub protocol_version: i32,
15 #[read(as = Prefixed(VarInt), bound = 255)]
16 pub hostname: String,
17 pub port: u16,
18 pub intention: ClientIntent,
19}
20
21impl SClientIntention {
22 #[must_use]
23 pub const fn new(
24 protocol_version: i32,
25 hostname: String,
26 port: u16,
27 intention: ClientIntent,
28 ) -> Self {
29 Self {
30 protocol_version,
31 hostname,
32 port,
33 intention,
34 }
35 }
36}