-
Notifications
You must be signed in to change notification settings - Fork 0
tesst #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SkyVence
wants to merge
6
commits into
main
Choose a base branch
from
windows/port-networking
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
tesst #11
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ffe2e90
refactor: packet system
delmath f004dc9
refactor: finish packet router
delmath 94285bb
finish
delmath 07c20d9
fix: include for cmake
delmath 77e396a
cmakelist
SkyVence 563eb1a
Merge remote-tracking branch 'origin/refactor-network' into windows/p…
SkyVence File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| cmake_minimum_required(VERSION "3.16") | ||
|
|
||
| set(PRODUCTION_BUILD OFF CACHE BOOL "Make this a production build" FORCE) | ||
|
|
||
| set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
| set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Release>:Release>") | ||
|
|
||
| if(PRODUCTION_BUILD) | ||
| set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
| else() | ||
| set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
| endif() | ||
|
|
||
| project("mc-server") | ||
| set(CMAKE_CXX_STANDARD 20) | ||
|
|
||
| # Add external library here -> | ||
| add_subdirectory("thirdParty/asio") | ||
|
|
||
| file (GLOB_RECURSE MY_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") | ||
|
|
||
| add_executable(${CMAKE_PROJECT_NAME} "${MY_SOURCES}") | ||
|
|
||
| if(MSVC) | ||
| target_compile_definitions("${CMAKE_PROJECT_NAME}" PUBLIC _CRT_SECURE_NO_WARNINGS) | ||
| endif() | ||
|
|
||
| target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/") | ||
| target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE asio) |
Submodule data-generator
updated
3 files
| +0 −5 | include/dataGenerator.hpp | |
| +0 −729 | include/registriesTags.hpp | |
| +0 −50 | src/main.cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #ifndef PACKET_ROUTER_HPP | ||
| # define PACKET_ROUTER_HPP | ||
|
|
||
| # include "packet.hpp" | ||
| # include "server.hpp" | ||
|
|
||
| // clientbound | ||
| void changeDifficultyPacket(Packet& packet, Server& server); | ||
| void clientboundKnownPacksPacket(Packet& packet, Server& server); | ||
| void gameEventPacket(Packet& packet, Server& server); | ||
| void handleCookieRequestPacket(Packet& packet, Server& server); | ||
| void handleFinishConfigurationPacket(Packet& packet, Server& server); | ||
| void handleLoginStartPacket(Packet& packet, Server& server); | ||
| void handlePingPacket(Packet& packet, Server& server); | ||
| void handleStatusPacket(Packet& packet, Server& server); | ||
| void levelChunkWithLightPacket(Packet& packet, Server& server); | ||
| void playerAbilitiesPacket(Packet& packet, Server& server); | ||
| void sendPlayPacket(Packet& packet, Server& server); | ||
| void setHeldItemPacket(Packet& packet, Server& server); | ||
| void synchronizePlayerPositionPacket(Packet& packet, Server& server); | ||
| void setCenterPacket(Packet& packet, Server& server); | ||
|
|
||
| // serverbound | ||
| void handleAcknowledgeFinishConfigurationPacket(Packet& packet, Server& server); | ||
| void handleClientInformationPacket(Packet& packet, Server& server); | ||
| void handleConfirmTeleportationPacket(Packet& packet, Server& server); | ||
| void handleHandshakePacket(Packet& packet, Server& server); | ||
| void handleLoginAcknowledgedPacket(Packet& packet, Server& server); | ||
| void serverboundKnownPacksPacket(Packet& packet); | ||
|
|
||
| void packetRouter(Packet* packet, Server& server); | ||
|
|
||
| void handleHandshakeState(Packet* packet, Server& server); | ||
| void handleStatusState(Packet* packet, Server& server); | ||
| void handleLoginState(Packet* packet, Server& server); | ||
| void handleConfigurationState(Packet* packet, Server& server); | ||
| void handlePlayState(Packet* packet, Server& server); | ||
| void sendRegistryData(Packet& packet, Server& server); | ||
| void sendUpdateTags(Packet& packet, Server& server); | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -48,17 +48,17 @@ std::vector<uint8_t> RegistryData::serialize() const { | |||||
| Buffer buffer; | ||||||
|
|
||||||
| // Format MC 1.21.5: id + entries length + entries array | ||||||
| buffer.writeIdentifier(_registry_id); | ||||||
| buffer.writeString(_registry_id); | ||||||
| buffer.writeVarInt(static_cast<int32_t>(_entries.size())); | ||||||
|
|
||||||
| for (const auto& entry : _entries) { | ||||||
| // Chaque entrée: key (string) + value optional (anonymousNbt) | ||||||
| buffer.writeIdentifier(entry.entry_id); | ||||||
| buffer.writeString(entry.entry_id); | ||||||
|
|
||||||
| // Format "value optional": boolean présent + données NBT si présent | ||||||
| if (entry.has_data && entry.data.has_value()) { | ||||||
| buffer.writeBool(true); // Données présentes | ||||||
| buffer.writeNBT("{}"); // Données NBT (vide pour l'instant) | ||||||
| buffer.writeBytes("{}"); // Données NBT (vide pour l'instant) | ||||||
|
||||||
| buffer.writeBytes("{}"); // Données NBT (vide pour l'instant) | |
| buffer.writeBytes("{}"); // NBT data (empty for now) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !