Skip to content

Commit

Permalink
all for otservbr
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Aug 14, 2023
1 parent f16582e commit dba7e5a
Show file tree
Hide file tree
Showing 22 changed files with 511 additions and 166 deletions.
27 changes: 25 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,35 @@ indent_size = 2
indent_style = space
indent_size = 2

# Lua, XML
[*.{lua,xml}]
# XML
[*.xml]
indent_style = tab
indent_size = 2
tab_width = 2

# YAML, JSON, SQL
[*.{yml,yaml,yamllint,json,sql}]
indent_style = space
indent_size = 2

[*.lua]
# do this to prevent breaking long lines
max_line_length = 400
break_all_list_when_line_exceed = false
space_around_table_append_operator = true

# [indent]
indent_style = tab
indent_size = 2
tab_width = 2

# [align]
align_call_args = false
align_function_params = false
align_continuous_assign_statement = false
align_continuous_rect_table_field = false
align_if_branch = false
align_array_table = false
align_continuous_similar_call_args = false
align_continuous_inline_comment = false
align_chain_expr = none
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: [
'https://docs.opentibiabr.com/home/donate',
'https://docs.opentibiabr.com/home/donate/',
]
4 changes: 1 addition & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ Do this and that doesn't happens

Do this and that happens

## Fixes

\# (issue)
### Fixes #issuenumber

## Type of change

Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Build - Ubuntu
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
Expand All @@ -14,6 +15,7 @@ env:

jobs:
job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}

Expand All @@ -37,6 +39,7 @@ jobs:
sudo apt-get update && sudo apt-get install ccache linux-headers-$(uname -r)
- name: Switch to gcc-11
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
Expand All @@ -51,10 +54,17 @@ jobs:
ccache-${{ matrix.os }}
- name: Restore artifacts and install vcpkg
id: vcpkg-step
run: |
vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ')
echo "vcpkg commit ID: $vcpkgCommitId"
echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> $GITHUB_ENV
- name: Get vcpkg commit id from vcpkg.json
uses: lukka/run-vcpkg@main
with:
vcpkgGitURL: "https://github.com/opentibiabr/vcpkg.git"
vcpkgGitCommitId: 8974d642d47efd578e0da3223b4101c5d59aebcf
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git"
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}

- name: Get latest CMake and ninja
uses: lukka/get-cmake@main
Expand All @@ -68,6 +78,6 @@ jobs:
- name: Create and Upload Artifact
uses: actions/upload-artifact@main
with:
name: canary-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
name: otxserver-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
path: |
${{ github.workspace }}/build/${{ matrix.buildtype }}/bin/
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
name: Build - Windows

name: Build - Windows - CMake
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main

env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
MAKEFLAGS: '-j 2'

jobs:
job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -22,10 +21,9 @@ jobs:
buildtype: [windows-release]
include:
- os: windows-2022
triplet: x64-windows
triplet: x64-windows-static
packages: >
sccache
steps:
- name: Checkout repository
uses: actions/checkout@main
Expand All @@ -44,10 +42,18 @@ jobs:
run: rm -r -fo C:/mysql*

- name: Restore artifacts and install vcpkg
id: vcpkg-step
run: |
$json=Get-Content vcpkg.json -Raw | ConvertFrom-Json
$vcpkgCommitId=$json.'builtin-baseline'
Write-Host "vcpkg commit ID: $vcpkgCommitId"
echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Get vcpkg commit id from vcpkg.json
uses: lukka/run-vcpkg@main
with:
vcpkgGitURL: "https://github.com/opentibiabr/vcpkg.git"
vcpkgGitCommitId: 8974d642d47efd578e0da3223b4101c5d59aebcf
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git"
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}

- name: Get latest CMake and ninja
uses: lukka/get-cmake@main
Expand All @@ -61,6 +67,6 @@ jobs:
- name: Create and Upload Artifact
uses: actions/upload-artifact@main
with:
name: canary-${{ matrix.buildtype }}-${{ github.sha }}
name: otxserver-${{ matrix.buildtype }}-${{ github.sha }}
path: |
${{ github.workspace }}/build/${{ matrix.buildtype }}/bin/
53 changes: 53 additions & 0 deletions .github/workflows/build-windows-solution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Build - Windows - Solution

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main

env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
MAKEFLAGS: '-j 2'

jobs:
job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
buildtype: [Release]
include:
- os: windows-2022
triplet: x64-windows
packages: >
sccache
steps:
- name: Setup MSBuild.exe
uses: microsoft/[email protected]

- name: Checkout repository
uses: actions/checkout@main

- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg integrate install
- name: Build project
run: msbuild.exe /p:VcpkgEnableManifest=true /p:Configuration=Release /p:Platform=x64 /p:VcpkgRoot=$env:GITHUB_WORKSPACE/vcpkg vcproj/otxserver.sln

- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: ${{ matrix.os }}-${{ matrix.buildtype }}
path: |
${{ github.workspace }}/*.dll
${{ github.workspace }}/*.exe
27 changes: 8 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bld/
[Oo]bj/
[Ll]og/
build/
vcxproj/
vcproj/

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down Expand Up @@ -362,14 +362,14 @@ settings.json
c_cpp_properties.json
.history
tasks.json
TODO

# CLion (JetBrains)
.idea/

## CUSTOM
# Files
config.lua
config_canary.lua
client_assertions.txt
# Extensions
*.ini
Expand All @@ -378,32 +378,21 @@ client_assertions.txt
*.manifest
*.otbm
*.rar
*.7z
*.zip
*-house.xml
*-monster.xml
*-npc.xml

# SFTP for Sublime
sftp-config.json

# Binaries
canary
canary.old
otxsr
otxsr.old
otxserver
otxserver.old

# VCPKG
vcpkg_installed

# CLION
src/cmake-build-debug
otxsr.exe.manifest
data/world/map-spawn.xml
data/world/map-house.xml
data/world/vanilla-house.xml
data/world/vanilla-spawn.xml
data/world/otservbr-house.xml
data/world/otservbr-spawn.xml
data/world/darkkonia-spawn.xml
data/world/darkkonia-house.xml
data/monster/empty.lua
data/world/otservbr-monster.xml
data/world/otservbr-npc.xml
cmake-build-debug*
Empty file removed .tgitconfig
Empty file.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
# VCPKG
# cmake -DCMAKE_TOOLCHAIN_FILE=/opt/workspace/vcpkg/scripts/buildsystems/vcpkg.cmake ..
# Needed libs is in file vcpkg.json
# Windows required libs: .\vcpkg install --triplet x64-windows asio pugixml spdlog curl jsoncpp protobuf parallel-hashmap magic-enum mio luajit libmariadb mpir
# Windows required libs: .\vcpkg install --triplet x64-windows asio pugixml spdlog curl jsoncpp protobuf parallel-hashmap magic-enum mio luajit libmariadb mpir abseil
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
Expand All @@ -24,7 +24,7 @@ set(VCPKG_BUILD_TYPE "release")
# *****************************************************************************
# Project OTX Server
# *****************************************************************************
project(otxsr)
project(otxserver)


# *****************************************************************************
Expand Down
20 changes: 0 additions & 20 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,7 @@
"description": "Release Mode with ASAN",
"cacheVariables": {
"ASAN_ENABLED": "ON",
"BUILD_STATIC_LIBRARY": "OFF",
"VCPKG_TARGET_TRIPLET": "x64-windows"
},
"architecture": {
"value": "x64",
"strategy": "external"
}
},
{
"name": "windows-debug",
"inherits": "windows-release",
"displayName": "Windows - Debug",
"description": "Build Debug Mode",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"DEBUG_LOG": "ON",
"ASAN_ENABLED": "ON",
"BUILD_STATIC_LIBRARY": "OFF",
"VCPKG_TARGET_TRIPLET": "x64-windows"
},
Expand Down Expand Up @@ -117,10 +101,6 @@
{
"name": "windows-release-asan",
"configurePreset": "windows-release-asan"
},
{
"name": "windows-debug",
"configurePreset": "windows-debug"
}
]
}
Loading

0 comments on commit dba7e5a

Please sign in to comment.