From aaea698c99ae169d2d97fea31567ede5de052cfa Mon Sep 17 00:00:00 2001 From: "code.lyoko" Date: Fri, 13 Nov 2026 10:20:03 -0600 Subject: [PATCH] Added .gitattributes & .gitignore --- .gitattributes | 9 +++++++++ .gitignore | 2 ++ CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1c2c709 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# .gitattributes +* text=auto eol=lf +*.sh eol=lf +*.ps1 text eol=ctrlf +*.bat text eol=ctrlf + +# Binaries +*.png binary +*.db binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6f070ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Builds +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt index e69de29..4f94bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.16) +project(tibia-kaplar VERSION 0.1.0 LANGUAGES C CXX) + +option(TIBIA772 "Login/Protocol RSA for Tibia 7.72 (Required for the login to work" ON) +option(BUILD_GAME "Compile game server" OFF) +option(BUILD_LOGIN "Compile login server" ON) +option(BUILD_QUERYMANAGER "Compile querymanager" ON) +option(BUILD_IPCHANGER "Compile IP Changer" OFF) + +set(CMAKE_C_STANDARD 99) +set(CMAKE_CXX_STANDARD 17) + +# All binaries fall into /build/bin (dockerfile copies build/ -> /opt/tibia/bin/) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$) +endif() + +# Critical flag: Without TIBIA772=1 the RSA is read from the offset 7.7 +# and the cypher from the login fails silently. + +if(TIBIA772) + add_compile_definitions(TIBIA772=1) +endif() + +message(STATUS "tibia-kaplar") +message(STATUS "TIBIA772 : ${TIBIA772}") +message(STATUS "GAME : ${BUILD_GAME}") +message(STATUS "LOGIN : ${BUILD_LOGIN}") +message(STATUS "QUERYMGR : ${BUILD_QUERYMANAGER}") + +if(BUILD_GAME) + add_subdirectory(src/game) +endif() + +if(BUILD_LOGIN) + add_subdirectory(src/login) +endif() + +if(BUILD_QUERYMANAGER) + add_subdirectory(src/querymanager) +endif() + +if(BUILD_IPCHANGER) + add_subdirectory(src/ipchanger) +endif() +