Added .gitattributes & .gitignore

This commit is contained in:
code.lyoko 2026-11-13 10:20:03 -06:00
parent 30aa2bdaf5
commit aaea698c99
3 changed files with 58 additions and 0 deletions

9
.gitattributes vendored Normal file
View file

@ -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

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# Builds
build/

View file

@ -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/$<CONFIG>)
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()