Feature: Optional packet, play packet, configuration packet#10
Feature: Optional packet, play packet, configuration packet#10
Conversation
…r code to use the new config
…age in repo readme)
…to skyvence/chunks
…to skyvence/chunks
…to skyvence/chunks
…to skyvence/chunks
…to skyvence/chunks
… speed, no fov modifier
There was a problem hiding this comment.
Pull Request Overview
This PR introduces significant architectural improvements for handling Minecraft protocol communication, including world data management, region file support, and chunk streaming capabilities. The changes restructure packet handling with a cleaner separation between clientbound and serverbound packets, implement NBT parsing for world data, and add a configuration system with world management features.
Key Changes:
- Implemented world data loading system with NBT parsing and region file support for chunk streaming
- Restructured packet system with separation of clientbound/serverbound packets and new packet router architecture
- Added configuration management system with world settings and server properties
Reviewed Changes
Copilot reviewed 85 out of 117 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/world/query.cpp | New world query system for loading chunks from region files with NBT decompression |
| src/world/manager.cpp | World manager implementation with level.dat loading and gzip/zlib decompression |
| src/server.cpp | Updated server initialization to load world data and integrate new config system |
| src/networking/networkPacketRouter.cpp | New centralized packet routing system replacing old router |
| src/networking/packet/clientbound/*.cpp | New clientbound packet implementations for game state management |
| src/networking/packet/serverbound/*.cpp | New serverbound packet handlers for client communication |
| src/lib/nbtParser.cpp | NBT binary parser for Minecraft's Named Binary Tag format |
| src/lib/config.cpp | New configuration management system |
| include/world/world.hpp | World management API with LevelDat and ChunkData structures |
| include/network/server.hpp | Updated server interface with world and config integration |
| Makefile | Build system updates for new directory structure and zlib dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| getTagValue("DifficultyLocked", dataStruct.DifficultyLocked); | ||
| getTagValue("GameType", dataStruct.GameType); | ||
| getTagValue("generatorName", dataStruct.generatorName); | ||
| getTagValue("generatorVersion", dataStruct.generatorVersiona); |
There was a problem hiding this comment.
Corrected spelling of 'generatorVersiona' to 'generatorVersion'.
| getTagValue("generatorVersion", dataStruct.generatorVersiona); | |
| getTagValue("generatorVersion", dataStruct.generatorVersion); |
| // Level (VarInt) - current experience level | ||
| buf.writeVarInt(0); | ||
| // Level (VarInt) - current experience level | ||
| buf.writeVarInt(5); |
There was a problem hiding this comment.
Magic number 5 is used without explanation. Consider using a named constant like 'DEFAULT_EXPERIENCE_LEVEL' to clarify the intent.
| buffer.writeVarInt(1); | ||
| buffer.writeString("minecraft"); | ||
| buffer.writeString("core"); | ||
| buffer.writeString("1.21.5"); |
There was a problem hiding this comment.
Hardcoded version string '1.21.5' should be retrieved from the server configuration to ensure consistency with the configured game version.
| // server.getNetworkManager().getOutgoingQueue()->push(levelChunkPacket); | ||
|
|
||
| } else if (packet->getId() == 0x2B) { | ||
| // Playere loaded |
There was a problem hiding this comment.
Corrected spelling of 'Playere' to 'Player'.
| // Playere loaded | |
| // Player loaded |
| #include <vector> | ||
|
|
||
| struct RegistryEntry { | ||
| std::string name; |
There was a problem hiding this comment.
The 'protocol_id' field in RegistryEntry struct lacks documentation. Add a comment explaining its purpose and valid range in the Minecraft protocol.
| std::string name; | |
| std::string name; | |
| // Unique integer identifier for this entry in the Minecraft protocol. | |
| // Must be a non-negative integer, unique within its registry, as defined by the protocol specification. |
…uilding and working as expected
New clientbound packets (added)
New serverbound packets (added)
Packets moved/renamed
Existing packet implementations modified
Removed legacy packet files (superseded by new structure)