Skip to content

Commit

Permalink
bedrock packet ids
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaileke committed Oct 10, 2024
1 parent 28cc1f1 commit b19de82
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ impl Client {
println!("Sub Chunk Count: {}", level_chunk.sub_chunk_count);
println!("Client Sub Chunk Requests Enabled: {}", level_chunk.client_sub_chunk_requests_enabled);
println!("Used Blob Hashes: {:?}", level_chunk.used_blob_hashes);
println!("Extra Payload: {:?}", level_chunk.extra_payload);
println!("Extra Payload: {:?}", level_chunk.extra_payload.len());
//ChunkResolve::new(level_chunk);
}
BedrockPacketType::Disconnect => {
Expand Down
27 changes: 26 additions & 1 deletion src/protocol/game/bedrock_packet_ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ pub enum BedrockPacketType {
JigsawStructureData,
CurrentStructureFeature,
ServerboundDiagnostics,
CameraAimAssist,
ContainerRegistryCleanup,
Unknown
}

Expand Down Expand Up @@ -406,6 +408,8 @@ impl BedrockPacketType {
0x139 => BedrockPacketType::JigsawStructureData,
0x13a => BedrockPacketType::CurrentStructureFeature,
0x13b => BedrockPacketType::ServerboundDiagnostics,
0x13c => BedrockPacketType::CameraAimAssist,
0x13d => BedrockPacketType::ContainerRegistryCleanup,
_ => BedrockPacketType::Unknown,
}
}
Expand Down Expand Up @@ -611,6 +615,8 @@ impl BedrockPacketType {
BedrockPacketType::JigsawStructureData => 0x139,
BedrockPacketType::CurrentStructureFeature => 0x13a,
BedrockPacketType::ServerboundDiagnostics => 0x13b,
BedrockPacketType::CameraAimAssist => 0x13c,
BedrockPacketType::ContainerRegistryCleanup => 0x13d,
_ => 0
}
}
Expand Down Expand Up @@ -798,7 +804,26 @@ impl BedrockPacketType {
0xc1 => "Request Network Settings",
0xc2 => "Game Test Request",
0xc3 => "Game Test Results",
0xc4 => "Update Client Input Lock",
0xc4 => "Update Client Input Locks",
0xc6 => "Camera Presets",
0xc7 => "Unlocked Recipes",
0x12c => "Camera Instruction",
0x12d => "Compressed Biome Definition List",
0x12e => "Trim Data",
0x12f => "Open Sign",
0x130 => "Agent Animation",
0x131 => "Refresh Entitlements",
0x132 => "Player Toggle Crafter Slot Request",
0x133 => "Set Player Inventory Options",
0x134 => "Set Hud",
0x135 => "Award Achievement",
0x136 => "Clientbound Close Form",
0x138 => "Serverbound Loading Screen",
0x139 => "Jigsaw Structure Data",
0x13a => "Current Structure Feature",
0x13b => "Serverbound Diagnostics",
0x13c => "Camera Aim Assist",
0x13d => "Container Registry Cleanup",
_ => "Unknown Packet"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/game/types/level_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl LevelSettings {
let is_texture_packs_required = stream.get_bool();
let count = stream.get_unsigned_var_int();
let mut game_rules = HashMap::new();
for i in 0..count {
for _ in 0..count {
length = stream.get_unsigned_var_int();
let name = String::from_utf8(stream.get(length).unwrap()).unwrap();
let _is_player_modifiable = stream.get_bool();
Expand Down
3 changes: 1 addition & 2 deletions src/utils/chunk_resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub fn network_decode(sub_chunk_count: isize, extra_payload: Vec<u8>, air: u32)
for i in 0..sub_chunk_count {
let mut index = i as u8;
chunk.sub_chunks.insert(index as usize, decode_sub_chunk(&mut chunk_stream, &mut index, &chunk));

}

let mut last: PalettedStorage = PalettedStorage {}; /////////////////////////////////////////
Expand All @@ -43,7 +42,7 @@ pub fn network_decode(sub_chunk_count: isize, extra_payload: Vec<u8>, air: u32)
}
b = Some(last);
}
chunk.biomes[i] = b.clone().expect("biomes clone error, fn name: network_decode");
chunk.biomes.insert(i, b.clone().expect("biomes clone error, fn name: network_decode"));
}

chunk
Expand Down

0 comments on commit b19de82

Please sign in to comment.