A modern C++20 TCP server implementation for Lineage 2 game emulation, featuring separate Login and Game server components.
- Login Server: Handles client authentication, server list, and session management
- Game Server: Manages character selection, world entry, and game logic
- Modern C++20: Built with modern C++ standards and best practices
- Cross-platform: Windows and Linux support
- Encrypted Communication: RSA, Blowfish, and XOR encryption support
- Modular Architecture: Clean separation between Core, Login, and Game components
- CMake 3.21+ - Build system
- C++20 compatible compiler:
- Windows: Visual Studio 2019+ or MinGW-w64
- Linux: GCC 10+ or Clang 12+
- vcpkg - C++ package manager
- Ninja - Build generator (recommended)
If you don't have vcpkg installed:
# Clone vcpkg
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
cd C:\vcpkg
# Bootstrap vcpkg
.\bootstrap-vcpkg.bat
# Set environment variable (add to your system PATH)
setx VCPKG_ROOT "C:\vcpkg"# Clone vcpkg
git clone https://github.com/Microsoft/vcpkg.git ~/vcpkg
cd ~/vcpkg
# Bootstrap vcpkg
./bootstrap-vcpkg.sh
# Add to your shell profile (.bashrc, .zshrc, etc.)
export VCPKG_ROOT=~/vcpkg
export PATH=$VCPKG_ROOT:$PATH# Using chocolatey
choco install ninja
# Or download from https://github.com/ninja-build/ninja/releases# Ubuntu/Debian
sudo apt install ninja-build
# CentOS/RHEL
sudo yum install ninja-build
# Arch Linux
sudo pacman -S ninjagit clone [email protected]:fxckdead/l2_middleware.git
cd l2middlewaresDependencies are automatically managed by vcpkg. The project requires:
- boost-asio - Asynchronous networking
- openssl - Cryptographic functions
- nlohmann-json - JSON parsing (if needed)
vcpkg will automatically install these when you build the project.
The project uses CMake presets for easy building. You can build in Debug or Release mode.
# Configure
cmake --preset debug
# Build everything
cmake --build --preset debug
# Or build specific components
cmake --build --preset login-debug # Login server only
cmake --build --preset game-debug # Game server only
cmake --build --preset core-debug # Core library only# Configure
cmake --preset release
# Build everything
cmake --build --preset release
# Or build specific components
cmake --build --preset login-release # Login server only
cmake --build --preset game-release # Game server only
cmake --build --preset core-release # Core library only# Create build directory
mkdir build && cd build
# Configure (Debug)
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
# Or configure (Release)
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
# Build
cmake --build . --parallelAfter successful build, executables will be available in:
build/debug/out/orbuild/release/out/l2_login_server- Login server executablel2_game_server- Game server executable
./build/debug/out/l2_login_server
# or
./build/release/out/l2_login_server./build/debug/out/l2_game_server
# or
./build/release/out/l2_game_serversrc/
โโโ core/ # Shared components
โ โโโ encryption/ # RSA, Blowfish, XOR encryption
โ โโโ network/ # Base networking classes
โ โโโ packets/ # Base packet interfaces
โ โโโ utils/ # Utilities (session keys, etc.)
โโโ login/ # Login server
โ โโโ server/ # Server management
โ โโโ network/ # Login connection handling
โ โโโ packets/ # Login-specific packets
โ โ โโโ requests/ # Client โ Server packets
โ โ โโโ responses/ # Server โ Client packets
โ โโโ data/ # Data structures
โโโ game/ # Game server
โโโ server/ # Game server management
โโโ network/ # Game connection handling
โโโ packets/ # Game-specific packets
โโโ requests/ # Client โ Server packets
โโโ responses/ # Server โ Client packets
- Create packet classes in
src/login/packets/orsrc/game/packets/ - Update the respective
PacketFactory - Add handler methods in connection classes
- Update
CMakeLists.txtwith new source files
src/login/network/login_client_connection.cpp- Login client interactionssrc/game/network/game_client_connection.cpp- Game client interactionssrc/login/packets/packet_factory.cpp- Login packet creationsrc/game/packets/packet_factory.cpp- Game packet creation
- vcpkg not found: Ensure
VCPKG_ROOTenvironment variable is set - Missing dependencies: Run
vcpkg installin project directory - Compiler version: Ensure C++20 support (GCC 10+, MSVC 2019+, Clang 12+)
- CMake version: Requires CMake 3.21 or newer
- Port conflicts: Ensure ports 2106 (login) and 7777 (game) are available
- Encryption errors: Check RSA key generation and client compatibility
- Connection issues: Verify firewall settings
This is just a Toy project, maybe if I'm able to make it work with basic features I will accept PRs!