steel_protocol/packets/game/
c_login.rs1use steel_macros::{ClientPacket, WriteTo};
2use steel_registry::packets::play::C_LOGIN;
3use steel_utils::{GlobalPos, Identifier, types::GameType};
4
5#[derive(Clone, Debug, WriteTo)]
6pub struct CommonPlayerSpawnInfo {
7 #[write(as = VarInt)]
8 pub dimension_type: i32,
9 pub dimension: Identifier,
10 pub seed: i64,
11 #[write(as = Byte)]
12 pub game_type: GameType,
13 #[write(as = OptionByte)]
14 pub previous_game_type: Option<GameType>,
15 pub is_debug: bool,
16 pub is_flat: bool,
17 pub last_death_location: Option<GlobalPos>,
18 #[write(as = VarInt)]
19 pub portal_cooldown: i32,
20 #[write(as = VarInt)]
21 pub sea_level: i32,
22}
23
24#[derive(ClientPacket, WriteTo, Clone, Debug)]
25#[packet_id(Play = C_LOGIN)]
26pub struct CLogin {
27 pub player_id: i32,
28 pub hardcore: bool,
29 #[write(as = Prefixed(VarInt))]
30 pub levels: Vec<Identifier>,
31 #[write(as = VarInt)]
32 pub max_players: i32,
33 #[write(as = VarInt)]
34 pub chunk_radius: i32,
35 #[write(as = VarInt)]
36 pub simulation_distance: i32,
37 pub reduced_debug_info: bool,
38 pub show_death_screen: bool,
39 pub do_limited_crafting: bool,
40 pub common_player_spawn_info: CommonPlayerSpawnInfo,
41 pub online_mode: bool,
42 pub enforces_secure_chat: bool,
43}