feat(network): add NetworkServer for managing player sessions and communication

- Implemented `NetworkServer` and `Session` classes for handling TCP communication with players.
- Added `NetworkServer.cpp` and `NetworkServer.h` to the project.
- Integrated `asio` library into the build configuration in `CMakeLists.txt`.
This commit is contained in:
Kieran Kihn
2025-11-28 20:40:14 +08:00
parent def62a18c6
commit 84c470859b
3 changed files with 171 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ set(CMAKE_CXX_STANDARD 26)
find_package(ftxui CONFIG REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(asio REQUIRED)
add_library(uno-game-lib
src/game/Card.cpp
@@ -14,6 +15,7 @@ add_library(uno-game-lib
src/common/Utils.cpp
src/network/Message.cpp
src/network/MessageSerializer.cpp
src/network/NetworkServer.cpp
)
target_link_libraries(uno-game-lib
PRIVATE ftxui::screen
@@ -23,6 +25,9 @@ target_link_libraries(uno-game-lib
target_link_libraries(uno-game-lib
PRIVATE nlohmann_json::nlohmann_json
)
target_link_libraries(uno-game-lib
PRIVATE asio::asio
)
add_executable(uno-game src/main.cpp)
target_link_libraries(uno-game