add handled packets stats
TODO make auto-updated
This commit is contained in:
parent
07002a7437
commit
04b5d1ac3f
2 changed files with 229 additions and 0 deletions
169
docs-assets/handled-packets.md
Normal file
169
docs-assets/handled-packets.md
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
# Handled Packets
|
||||
|
||||
## Server -> Client
|
||||
|
||||
❌ statistics
|
||||
❌ advancements
|
||||
❌ face_player
|
||||
❌ nbt_query_response
|
||||
❌ chat_suggestions
|
||||
❌ trade_list
|
||||
❌ vehicle_move
|
||||
❌ open_book
|
||||
❌ craft_recipe_response
|
||||
❌ end_combat_event
|
||||
❌ enter_combat_event
|
||||
❌ unlock_recipes
|
||||
❌ camera
|
||||
❌ update_view_position
|
||||
❌ update_view_distance
|
||||
❌ entity_sound_effect
|
||||
❌ stop_sound
|
||||
❌ feature_flags
|
||||
❌ select_advancement_tab
|
||||
❌ declare_recipes
|
||||
❌ tags
|
||||
❌ acknowledge_player_digging
|
||||
❌ initialize_world_border
|
||||
❌ world_border_center
|
||||
❌ world_border_lerp_size
|
||||
❌ world_border_size
|
||||
❌ world_border_warning_delay
|
||||
❌ world_border_warning_reach
|
||||
❌ simulation_distance
|
||||
❌ chunk_biomes
|
||||
❌ damage_event
|
||||
❌ hurt_animation
|
||||
✅ spawn_entity
|
||||
✅ spawn_entity_experience_orb
|
||||
✅ named_entity_spawn
|
||||
✅ animation
|
||||
✅ block_break_animation
|
||||
✅ tile_entity_data
|
||||
✅ block_action
|
||||
✅ block_change
|
||||
✅ boss_bar
|
||||
✅ difficulty
|
||||
✅ tab_complete
|
||||
✅ declare_commands
|
||||
✅ multi_block_change
|
||||
✅ close_window
|
||||
✅ open_window
|
||||
✅ window_items
|
||||
✅ craft_progress_bar
|
||||
✅ set_slot
|
||||
✅ set_cooldown
|
||||
✅ custom_payload
|
||||
✅ hide_message
|
||||
✅ kick_disconnect
|
||||
✅ profileless_chat
|
||||
✅ entity_status
|
||||
✅ explosion
|
||||
✅ unload_chunk
|
||||
✅ game_state_change
|
||||
✅ open_horse_window
|
||||
✅ keep_alive
|
||||
✅ map_chunk
|
||||
✅ world_event
|
||||
✅ world_particles
|
||||
✅ update_light
|
||||
✅ login
|
||||
✅ map
|
||||
✅ rel_entity_move
|
||||
✅ entity_move_look
|
||||
✅ entity_look
|
||||
✅ open_sign_entity
|
||||
✅ abilities
|
||||
✅ player_chat
|
||||
✅ death_combat_event
|
||||
✅ player_remove
|
||||
✅ player_info
|
||||
✅ position
|
||||
✅ entity_destroy
|
||||
✅ remove_entity_effect
|
||||
✅ resource_pack_send
|
||||
✅ respawn
|
||||
✅ entity_head_rotation
|
||||
✅ held_item_slot
|
||||
✅ scoreboard_display_objective
|
||||
✅ entity_metadata
|
||||
✅ attach_entity
|
||||
✅ entity_velocity
|
||||
✅ entity_equipment
|
||||
✅ experience
|
||||
✅ update_health
|
||||
✅ scoreboard_objective
|
||||
✅ set_passengers
|
||||
✅ teams
|
||||
✅ scoreboard_score
|
||||
✅ spawn_position
|
||||
✅ update_time
|
||||
✅ sound_effect
|
||||
✅ system_chat
|
||||
✅ playerlist_header
|
||||
✅ collect
|
||||
✅ entity_teleport
|
||||
✅ entity_update_attributes
|
||||
✅ entity_effect
|
||||
✅ server_data
|
||||
✅ clear_titles
|
||||
✅ action_bar
|
||||
✅ ping
|
||||
✅ set_title_subtitle
|
||||
✅ set_title_text
|
||||
✅ set_title_time
|
||||
✅ packet
|
||||
|
||||
## Client -> Server
|
||||
|
||||
❌ query_block_nbt
|
||||
❌ set_difficulty
|
||||
❌ query_entity_nbt
|
||||
❌ pick_item
|
||||
❌ set_beacon_effect
|
||||
❌ update_command_block_minecart
|
||||
❌ update_structure_block
|
||||
❌ generate_structure
|
||||
❌ lock_difficulty
|
||||
❌ craft_recipe_request
|
||||
❌ displayed_recipe
|
||||
❌ recipe_book
|
||||
❌ update_jigsaw_block
|
||||
❌ spectate
|
||||
❌ advancement_tab
|
||||
✅ teleport_confirm
|
||||
✅ chat_command
|
||||
✅ chat_message
|
||||
✅ message_acknowledgement
|
||||
✅ edit_book
|
||||
✅ name_item
|
||||
✅ select_trade
|
||||
✅ update_command_block
|
||||
✅ tab_complete
|
||||
✅ client_command
|
||||
✅ settings
|
||||
✅ enchant_item
|
||||
✅ window_click
|
||||
✅ close_window
|
||||
✅ custom_payload
|
||||
✅ use_entity
|
||||
✅ keep_alive
|
||||
✅ position
|
||||
✅ position_look
|
||||
✅ look
|
||||
✅ flying
|
||||
✅ vehicle_move
|
||||
✅ steer_boat
|
||||
✅ abilities
|
||||
✅ block_dig
|
||||
✅ entity_action
|
||||
✅ steer_vehicle
|
||||
✅ resource_pack_receive
|
||||
✅ held_item_slot
|
||||
✅ set_creative_slot
|
||||
✅ update_sign
|
||||
✅ arm_animation
|
||||
✅ block_place
|
||||
✅ use_item
|
||||
✅ pong
|
||||
✅ chat_session_update
|
||||
60
scripts/updateHandledPackets.mjs
Normal file
60
scripts/updateHandledPackets.mjs
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import minecraftData from 'minecraft-data'
|
||||
|
||||
const lastVersion = minecraftData.versions.pc[0]
|
||||
// console.log('last proto ver', lastVersion.minecraftVersion)
|
||||
const allPackets = minecraftData(lastVersion.minecraftVersion).protocol
|
||||
const getPackets = ({ types }) => {
|
||||
return Object.keys(types).map(type => type.replace('packet_', ''))
|
||||
}
|
||||
// todo test against all versions
|
||||
const allFromServerPackets = getPackets(allPackets.play.toClient)
|
||||
const allToServerPackets = getPackets(allPackets.play.toServer).filter(x => !['packet'].includes(x))
|
||||
|
||||
const buildFile = './dist/index.js'
|
||||
|
||||
const file = fs.readFileSync(buildFile, 'utf8')
|
||||
|
||||
const packetsReceiveRegex = /client\.on\("(\w+)"/g
|
||||
const packetsReceiveSend = /client\.write\("(\w+)"/g
|
||||
|
||||
let allSupportedReceive = [...new Set([...file.matchAll(packetsReceiveRegex)].map(x => x[1]))]
|
||||
let allSupportedSend = [...new Set([...file.matchAll(packetsReceiveSend)].map(x => x[1]))]
|
||||
|
||||
let md = '# Handled Packets\n'
|
||||
|
||||
md += '\n## Server -> Client\n\n'
|
||||
let notSupportedRows = []
|
||||
let supportedRows = []
|
||||
for (const packet of allFromServerPackets) {
|
||||
const includes = allSupportedReceive.includes(packet);
|
||||
(includes ? supportedRows : notSupportedRows).push(packet)
|
||||
}
|
||||
|
||||
for (const row of notSupportedRows) {
|
||||
md += `❌ ${row}\n`
|
||||
}
|
||||
for (const row of supportedRows) {
|
||||
md += `✅ ${row}\n`
|
||||
}
|
||||
|
||||
md += '\n'
|
||||
|
||||
notSupportedRows = []
|
||||
supportedRows = []
|
||||
|
||||
md += '## Client -> Server\n\n'
|
||||
for (const packet of allToServerPackets) {
|
||||
const includes = allSupportedSend.includes(packet);
|
||||
(includes ? supportedRows : notSupportedRows).push(packet)
|
||||
}
|
||||
|
||||
for (const row of notSupportedRows) {
|
||||
md += `❌ ${row}\n`
|
||||
}
|
||||
for (const row of supportedRows) {
|
||||
md += `✅ ${row}\n`
|
||||
}
|
||||
|
||||
fs.writeFileSync('./docs-assets/handled-packets.md', md)
|
||||
Loading…
Add table
Add a link
Reference in a new issue