diff --git a/.appveyor.yml b/.appveyor.yml index 61ebe523dd4..59290a80d73 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -42,17 +42,17 @@ before_build: cmake --build . --config Release build: - project: C:\projects\otservbr-global\build\otbr.sln + project: C:\projects\canary\build\canary.sln verbosity: minimal parallel: true after_build: - cd %APPVEYOR_BUILD_FOLDER%\build\bin - - 7z a -tzip otservbr-global.zip Release\ + - 7z a -tzip canary.zip Release\ cache: - - C:\projects\otservbr-global\build\vcpkg_installed\ + - C:\projects\canary\build\vcpkg_installed\ - C:\Users\appveyor\AppData\Local\vcpkg\archives artifacts: - - path: \build\bin\otservbr-global.zip + - path: \build\bin\canary.zip diff --git a/.github/ISSUE_TEMPLATE/i-want-to-help.md b/.github/ISSUE_TEMPLATE/i-want-to-help.md index 7528c2bd4d5..935e29987ec 100644 --- a/.github/ISSUE_TEMPLATE/i-want-to-help.md +++ b/.github/ISSUE_TEMPLATE/i-want-to-help.md @@ -3,7 +3,7 @@ name: I have a snippet to share about: If you have any lua, xml or cpp code that you want to share to be added to the server --- -If you have a piece of code to contribute and want to share with OTServBR, **please do it with a pull request instead**. Refrain from opening issues for simple code changes, it makes everything slower while you could be contributing to the community and improving the life of every player that uses this server. +If you have a piece of code to contribute and want to share with Canary, **please do it with a pull request instead**. Refrain from opening issues for simple code changes, it makes everything slower while you could be contributing to the community and improving the life of every player that uses this server. If you don't know how to contribute in GitHub, you don't even need to know Git: can try to edit the files that you want to change directly from the web interface. If you need to change more files you need to create a complete pull request, [you can learn how to do that with this tutorial](https://github.com/firstcontributions/first-contributions). diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index c3e5f2b1d63..2cc89250e1d 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -2,22 +2,7 @@ name: Build on Ubuntu -on: - push: - branches: - - master - - develop - - v* - - tags: - - v* - - pull_request: - paths: - - cmake/** - - src/** - - CMakeLists.txt - - .github/** +on: [push, pull_request] jobs: job: @@ -60,7 +45,7 @@ jobs: appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }} vcpkgTriplet: ${{ matrix.triplet }} additionalCachedPaths: ${{ github.workspace }}/build/vcpkg_installed - vcpkgGitCommitId: ${{ secrets.VCPKG_ID }} + vcpkgGitCommitId: b9cd2a7958dec657fb869ec487d2a98cf39a8d48 - name: 'Run CMake with Ninja, install dependencies with vcpkg, build with CMake' uses: lukka/run-cmake@v3 @@ -71,25 +56,20 @@ jobs: cmakeBuildType: ${{ matrix.buildtype }} - name: Clean workspace - if: ${{ matrix.buildtype == 'Release' }} + if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }} shell: bash run: | - mv ${{ github.workspace }}/build/bin/otbr ${{ github.workspace }}/otbr - find . -maxdepth 1 ! -name otbr ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \; + mv ${{ github.workspace }}/build/bin/canary ${{ github.workspace }}/canary + find . -maxdepth 1 ! -name canary ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \; - name: Prepare datapack contents - if: ${{ matrix.buildtype == 'Release' }} + if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }} shell: bash run: | mv config.lua.dist config.lua - unzip -o data/world/world.zip -d data/world/ - rm data/world/world.zip - cd .. - zip -r otservbr.zip otservbr-global - name: Upload binary - if: ${{ matrix.buildtype == 'Release' }} + if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }} uses: actions/upload-artifact@v2 with: - name: ${{ matrix.os }}-otbr-amd64-${{ matrix.buildtype }}-${{ github.sha }} - path: ${{ runner.workspace }}/otservbr.zip + name: ${{ matrix.os }}-canary-amd64-${{ matrix.buildtype }}-${{ github.sha }} diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index af030df907d..9f152c71ea4 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -2,22 +2,7 @@ name: Build on Windows -on: - push: - branches: - - master - - develop - - v* - - tags: - - v* - - pull_request: - paths: - - cmake/** - - src/** - - CMakeLists.txt - - .github/** +on: [push, pull_request] jobs: job: @@ -51,7 +36,7 @@ jobs: appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }} vcpkgTriplet: ${{ matrix.triplet }} additionalCachedPaths: ${{ github.workspace }}/build/vcpkg_installed - vcpkgGitCommitId: ${{ secrets.VCPKG_ID }} + vcpkgGitCommitId: b9cd2a7958dec657fb869ec487d2a98cf39a8d48 - name: Run CMake to install the dependencies specified in the vcpkg.json manifest, generate project file and build the project uses: lukka/run-cmake@v3 @@ -62,16 +47,16 @@ jobs: buildWithCMake: true - name: Copy artifacts - if: ${{ matrix.buildtype == 'Release' }} + if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }} shell: pwsh run: | Copy-Item -Path ${{ github.workspace }}\build\bin\* -Destination ${{ github.workspace }} -Recurse - name: Create and Upload Full Datapack - if: ${{ matrix.buildtype == 'Release' }} + if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }} uses: actions/upload-artifact@v2 with: - name: otbr-full-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }} + name: canary-full-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }} path: | ${{ github.workspace }} !${{ github.workspace }}/build/ @@ -89,9 +74,9 @@ jobs: !${{ github.workspace }}/Jenkinsfile - name: Create and Upload Server Only - if: ${{ matrix.buildtype == 'Release' }} + if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }} uses: actions/upload-artifact@v2 with: - name: otbr-server-only-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }} + name: canary-server-only-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }} path: | ${{ github.workspace }}/build/bin/ diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1b799fdb3a7..66c16fedcce 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,7 +47,7 @@ jobs: appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }} vcpkgTriplet: ${{ matrix.triplet }} additionalCachedPaths: ${{ github.workspace }}/build/vcpkg_installed - vcpkgGitCommitId: ${{ secrets.VCPKG_ID }} + vcpkgGitCommitId: b9cd2a7958dec657fb869ec487d2a98cf39a8d48 - name: 'Run CMake with Ninja, install dependencies with vcpkg, build with CMake' if: ${{ matrix.language == 'cpp' }} diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index e4a7333243c..00b9b3a67b0 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -44,7 +44,7 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cd ${{ runner.workspace }}/otservbr-global + cd ${{ runner.workspace }}/canary cppcheck --version $HOME/bin/reviewdog -reporter=github-pr-check -runners=cppcheck @@ -53,14 +53,14 @@ jobs: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | luacheck --version - cd ${{ runner.workspace }}/otservbr-global + cd ${{ runner.workspace }}/canary $HOME/bin/reviewdog -reporter=github-pr-check -runners=luacheck - name: luac env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cd ${{ runner.workspace }}/otservbr-global + cd ${{ runner.workspace }}/canary luac -v $HOME/bin/reviewdog -reporter=github-pr-check -runners=luac @@ -68,7 +68,7 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cd ${{ runner.workspace }}/otservbr-global + cd ${{ runner.workspace }}/canary xmllint --version $HOME/bin/reviewdog -reporter=github-pr-check -runners=xmllint diff --git a/.gitignore b/.gitignore index c0cdf2c5884..0e58341106d 100644 --- a/.gitignore +++ b/.gitignore @@ -377,8 +377,8 @@ config.lua sftp-config.json # Binaries -otbr -otbr.old +canary +canary.old # VCPKG vcpkg_installed diff --git a/.travis.yml b/.travis.yml index 1583457e0b7..75de9356ed3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ install: - ./vcpkg/vcpkg integrate install script: - - cd /home/travis/build/opentibiabr/otservbr-global + - cd /home/travis/build/opentibiabr/canary - export CXXFLAGS="$CXXFLAGS -DBOOST_ASIO_DISABLE_NOEXCEPT=1 " - /home/travis/build/opentibiabr/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install - mkdir build @@ -47,7 +47,7 @@ script: - sonar-scanner -Dsonar.cfamily.cache.enabled=true -Dsonar.cfamily.cache.path=${TRAVIS_HOME}/.cfamily -Dsonar.cfamily.threads=${NUMBER_OF_PROCESSORS} || true # - sonar-scanner -Dsonar.cfamily.cache.enabled=true -Dsonar.cfamily.cache.path=${TRAVIS_HOME}/.cfamily -Dsonar.cfamily.threads=${NUMBER_OF_PROCESSORS} || true - # - curl --upload-file /home/travis/build/opentibiabr/otservbr-global/sonar-cfamily-reproducer.zip https://transfer.sh/sonar-cfamily-reproducer.zip + # - curl --upload-file /home/travis/build/opentibiabr/canary/sonar-cfamily-reproducer.zip https://transfer.sh/sonar-cfamily-reproducer.zip cache: directories: diff --git a/CMakeLists.txt b/CMakeLists.txt index 11819ef1bdb..9b4e4db84d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,9 @@ set(VCPKG_FEATURE_FLAGS "versions") set(VCPKG_BUILD_TYPE "release") # ***************************************************************************** -# Project otbr +# Project canary # ***************************************************************************** -project(otbr) +project(canary) # ***************************************************************************** diff --git a/README.md b/README.md index fcc10a648fd..2c6f209153d 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,43 @@ # OTServ Brasil - Global Server [![Discord Channel](https://img.shields.io/discord/528117503952551936.svg?style=flat-square&logo=discord)](https://discord.gg/3NxYnyV) -[![GitHub issues](https://img.shields.io/github/issues/opentibiabr/otservbr-global)](https://github.com/opentibiabr/otservbr-global/issues) -[![GitHub pull request](https://img.shields.io/github/issues-pr/opentibiabr/otservbr-global)](https://github.com/opentibiabr/otservbr-global/pulls) -[![Contributors](https://img.shields.io/github/contributors/opentibiabr/otservbr-global.svg?style=flat-square)](https://github.com/opentibiabr/otservbr-global/graphs/contributors) -[![GitHub](https://img.shields.io/github/license/opentibiabr/otservbr-global)](https://github.com/opentibiabr/otservbr-global/blob/develop/LICENSE) +[![GitHub issues](https://img.shields.io/github/issues/opentibiabr/canary)](https://github.com/opentibiabr/canary/issues) +[![GitHub pull request](https://img.shields.io/github/issues-pr/opentibiabr/canary)](https://github.com/opentibiabr/canary/pulls) +[![Contributors](https://img.shields.io/github/contributors/opentibiabr/canary.svg?style=flat-square)](https://github.com/opentibiabr/canary/graphs/contributors) +[![GitHub](https://img.shields.io/github/license/opentibiabr/canary)](https://github.com/opentibiabr/canary/blob/develop/LICENSE) -![GitHub repo size](https://img.shields.io/github/repo-size/opentibiabr/otservbr-global) +![GitHub repo size](https://img.shields.io/github/repo-size/opentibiabr/canary) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a71728d523ac4b23a9c0b974ae4ec5df)](https://www.codacy.com/gh/opentibiabr/otservbr-global/dashboard?utm_source=github.com&utm_medium=referral&utm_content=opentibiabr/otservbr-global&utm_campaign=Badge_Grade) -[![CodeQL](https://github.com/opentibiabr/otservbr-global/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/opentibiabr/otservbr-global/actions/workflows/codeql-analysis.yml) -[![Codacy Security Scan](https://github.com/opentibiabr/otservbr-global/actions/workflows/codacy-analysis.yml/badge.svg)](https://github.com/opentibiabr/otservbr-global/actions/workflows/codacy-analysis.yml) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a71728d523ac4b23a9c0b974ae4ec5df)](https://www.codacy.com/gh/opentibiabr/canary/dashboard?utm_source=github.com&utm_medium=referral&utm_content=opentibiabr/canary&utm_campaign=Badge_Grade) +[![CodeQL](https://github.com/opentibiabr/canary/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/opentibiabr/canary/actions/workflows/codeql-analysis.yml) +[![Codacy Security Scan](https://github.com/opentibiabr/canary/actions/workflows/codacy-analysis.yml/badge.svg)](https://github.com/opentibiabr/canary/actions/workflows/codacy-analysis.yml) ## Builds -[![Build status](https://ci.appveyor.com/api/projects/status/github/opentibiabr/otservbr-global?branch=develop&passingText=develop%20-%20OK&svg=true)](https://ci.appveyor.com/project/opentibiabr/otservbr-global/build/artifacts "Download nightly builds for Windows") +[![Build status](https://ci.appveyor.com/api/projects/status/github/opentibiabr/canary?branch=develop&passingText=develop%20-%20OK&svg=true)](https://ci.appveyor.com/project/opentibiabr/canary/build/artifacts "Download nightly builds for Windows") -[![Build on Ubuntu](https://github.com/opentibiabr/otservbr-global/workflows/Build%20on%20Ubuntu/badge.svg)](https://github.com/opentibiabr/otservbr-global/actions?query=workflow%3A%22Build+on+Ubuntu%22) -[![Build on Windows](https://github.com/opentibiabr/otservbr-global/workflows/Build%20on%20Windows/badge.svg)](https://github.com/opentibiabr/otservbr-global/actions?query=workflow%3A%22Build+on+Windows%22) +[![Build on Ubuntu](https://github.com/opentibiabr/canary/workflows/Build%20on%20Ubuntu/badge.svg)](https://github.com/opentibiabr/canary/actions?query=workflow%3A%22Build+on+Ubuntu%22) +[![Build on Windows](https://github.com/opentibiabr/canary/workflows/Build%20on%20Windows/badge.svg)](https://github.com/opentibiabr/canary/actions?query=workflow%3A%22Build+on+Windows%22) ## Project -OTServ Brasil - Global Server is a free and open-source MMORPG server emulator written in C++. It is a fork of the [Forgotten Server](https://github.com/otland/forgottenserver) project. To connect to the server and to take a stable experience, you can use our [own client](https://forums.otserv.com.br/index.php?/forums/topic/167933-otservbr-global-cliente-tibia-12/) and if you want to edit something, check our [customized tools](https://github.com/opentibiabr/tools). +OTServ Brasil - Global Server is a free and open-source MMORPG server emulator written in C++. It is a fork of the [Forgotten Server](https://github.com/otland/forgottenserver) project. To connect to the server and to take a stable experience, you can use our [own client](https://forums.otserv.com.br/index.php?/forums/topic/167933-canary-cliente-tibia-12/) and if you want to edit something, check our [customized tools](https://github.com/opentibiabr/tools). -You are subject to our code of conduct, read at [this link](https://github.com/opentibiabr/otservbr-global/blob/develop/CODE_OF_CONDUCT.md). +You are subject to our code of conduct, read at [this link](https://github.com/opentibiabr/canary/blob/develop/CODE_OF_CONDUCT.md). ### Getting **Started** * **WARNING: YOU NEED TO UNZIP THE MAP BEFORE START THE SERVER.** -* [Compiling on Windows](https://forums.otserv.com.br/index.php?/forums/topic/169235-windowsvc2019-compilando-sources-otservbr-global/), alternatively if you are ****not** going to change anything on the source** you can download the latest compiled version for windows from [nightly builds for Windows](https://ci.appveyor.com/project/opentibiabr/otservbr-global/build/artifacts). -* Wiki: Compiling ([Ubuntu/Debian](https://github.com/opentibiabr/otservbr-global/wiki/Compiling-on-Ubuntu-or-Debian-GNU-Linux), [Windows](https://github.com/opentibiabr/otservbr-global/wiki/Compiling-on-Windows-(vcpkg))) +* [Compiling on Windows](https://forums.otserv.com.br/index.php?/forums/topic/169235-windowsvc2019-compilando-sources-canary/), alternatively if you are ****not** going to change anything on the source** you can download the latest compiled version for windows from [nightly builds for Windows](https://ci.appveyor.com/project/opentibiabr/canary/build/artifacts). +* Wiki: Compiling ([Ubuntu/Debian](https://github.com/opentibiabr/canary/wiki/Compiling-on-Ubuntu-or-Debian-GNU-Linux), [Windows](https://github.com/opentibiabr/canary/wiki/Compiling-on-Windows-(vcpkg))) ### Issues -We use the [issue tracker on GitHub](https://github.com/opentibiabr/OTServBR-Global/issues). Keep in mind that everyone who is watching the repository gets notified by e-mail when there is an activity, so be thoughtful and avoid writing comments that aren't meant for an issue (e.g. "+1"). If you'd like for an issue to be fixed faster, you should either fix it yourself and submit a pull request, or place a bounty on the issue. +We use the [issue tracker on GitHub](https://github.com/opentibiabr/canary/issues). Keep in mind that everyone who is watching the repository gets notified by e-mail when there is an activity, so be thoughtful and avoid writing comments that aren't meant for an issue (e.g. "+1"). If you'd like for an issue to be fixed faster, you should either fix it yourself and submit a pull request, or place a bounty on the issue. ### Pull requests -Before [creating a pull request](https://github.com/opentibiabr/otservbr-global/pulls) please keep in mind: +Before [creating a pull request](https://github.com/opentibiabr/canary/pulls) please keep in mind: * Do not send Pull Request changing the map, as we can't review the changes it's better to use our [Discord](https://discord.gg/3NxYnyV) to talk about or send the map changes to the responsible for updating it. * Focus on fixing only one thing, mixing too much things on the same Pull Request make it harder to review, harder to test and if we need to revert the change it will remove other things together. @@ -49,7 +49,7 @@ Before [creating a pull request](https://github.com/opentibiabr/otservbr-global/ * our partners * our crew (majesty, gpedro, eduardo dantas, foot) - * [our contributors](https://github.com/opentibiabr/OTServBR-Global/graphs/contributors) + * [our contributors](https://github.com/opentibiabr/canary/graphs/contributors) * [fear lucien](https://github.com/FearLucien) * [cjaker](https://github.com/Eternal-Scripts) * [slavidodo](https://github.com/slavidodo) diff --git a/canary.rc b/canary.rc new file mode 100644 index 00000000000..75976835ab1 --- /dev/null +++ b/canary.rc @@ -0,0 +1 @@ +MAINICON ICON "canary.ico" diff --git a/cmake/canary.ico b/cmake/canary.ico new file mode 100644 index 00000000000..1100d8defb9 Binary files /dev/null and b/cmake/canary.ico differ diff --git a/cmake/canary.rc b/cmake/canary.rc new file mode 100644 index 00000000000..75976835ab1 --- /dev/null +++ b/cmake/canary.rc @@ -0,0 +1 @@ +MAINICON ICON "canary.ico" diff --git a/cmake/otservbr-global.ico b/cmake/otservbr-global.ico deleted file mode 100644 index ec405a77387..00000000000 Binary files a/cmake/otservbr-global.ico and /dev/null differ diff --git a/cmake/otservbr-global.rc b/cmake/otservbr-global.rc deleted file mode 100644 index 451ad09fabe..00000000000 --- a/cmake/otservbr-global.rc +++ /dev/null @@ -1 +0,0 @@ -MAINICON ICON "otservbr-global.ico" diff --git a/data/XML/events.xml b/data/XML/events.xml index 6cec9c04060..c59ad0b4609 100644 --- a/data/XML/events.xml +++ b/data/XML/events.xml @@ -1,12 +1,12 @@ - +
- + diff --git a/data/lib/core/position.lua b/data/lib/core/position.lua index 24b5417ea2e..54bd3d13ea4 100644 --- a/data/lib/core/position.lua +++ b/data/lib/core/position.lua @@ -1,4 +1,3 @@ --- Functions from The Forgotten Server Position.directionOffset = { [DIRECTION_NORTH] = {x = 0, y = -1}, [DIRECTION_EAST] = {x = 1, y = 0}, @@ -48,7 +47,6 @@ function Position:moveUpstairs() return self end --- Functions from OTServBR-Global function Position:isInRange(from, to) -- No matter what corner from and to is, we want to make -- life easier by calculating north-west and south-east diff --git a/data/lib/core/tile.lua b/data/lib/core/tile.lua index bdfb65a0220..78ea0ecb898 100644 --- a/data/lib/core/tile.lua +++ b/data/lib/core/tile.lua @@ -59,7 +59,6 @@ function Tile:isWalkable(pz, creature, floorchange, block, proj) return true end --- Functions from OTServbr-Global function Tile.isHouse(self) local house = self:getHouse() return not not house diff --git a/data/scripts/talkactions/god/count_monsters.lua b/data/scripts/talkactions/god/count_monsters.lua index 628ece5ca01..bc4e1e2406e 100644 --- a/data/scripts/talkactions/god/count_monsters.lua +++ b/data/scripts/talkactions/god/count_monsters.lua @@ -1,4 +1,4 @@ -local xml_monster_dir = 'data/world/otservbr-spawn.xml' -- Diretório do arquivo onde contém os monstros. +local xml_monster_dir = 'data/world/canary-monster.xml' local new_file_name = 'monster_count.txt' local count_monsters = TalkAction("/countmonsters") diff --git a/data/startup/others/functions.lua b/data/startup/others/functions.lua index 498c68399dd..3e5ad8ff82d 100644 --- a/data/startup/others/functions.lua +++ b/data/startup/others/functions.lua @@ -136,23 +136,6 @@ function loadLuaMapBookDocument(tablename) end end ---[[ --- NOTE: THIS FUNCTION IS DESATIVATED, NPCS IS NOW BY XML (world/otservbr-npc.xml) -function loadLuaNpcs(tablename) - for index, value in pairs(tablename) do - if value.name and value.position then - local spawn = Game.createNpc(value.name, value.position) - if spawn then - spawn:setMasterPos(value.position) - Game.setStorageValue(Storage.NpcSpawn, 1) - end - end - end - Spdlog.info("Loaded ".. (#NpcTable) .." npcs and spawned ".. Game.getMonsterCount() .." monsters") - Spdlog.info("Loaded ".. #Game.getTowns() .. " towns with ".. #Game.getHouses() .." houses in total") -end -]] - -- Functions that cannot be used in reload command, so they have been moved here -- Prey slots consumption function preyTimeLeft(player, slot) diff --git a/docker/data/login.py b/docker/data/login.py index 4d36df3e98d..43762ca6f69 100755 --- a/docker/data/login.py +++ b/docker/data/login.py @@ -86,7 +86,7 @@ def do_login(data): 'worlds': [ { 'id': 0, - 'name': os.getenv('SERVER_NAME', 'OTServBR-Global'), + 'name': os.getenv('SERVER_NAME', 'Canary'), 'externaladdressprotected': os.getenv('PROXY_IP', '127.0.0.1'), 'externalportprotected': int(os.getenv('SERVER_GAME_PORT', 7172)), 'externaladdressunprotected': os.getenv('PROXY_IP', '127.0.0.1'), diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index ac43bf377e5..af14cfcf8c9 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -32,12 +32,12 @@ RUN cmake -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake .. # Stage 3: load data and execute FROM build -COPY --from=build /srv/build/bin/otbr /bin/otbr -COPY LICENSE *.sql key.pem /otbr/ -COPY data /otbr/data -COPY config.lua.dist /otbr/config.lua +COPY --from=build /srv/build/bin/canary /bin/canary +COPY LICENSE *.sql key.pem /canary/ +COPY data /canary/data +COPY config.lua.dist /canary/config.lua -WORKDIR /otbr +WORKDIR /canary RUN sed -i '/mysqlHost = .*$/c\mysqlHost = "mysql"' config.lua \ && sed -i '/mysqlUser = .*$/c\mysqlUser = "otserver"' config.lua \ @@ -45,7 +45,7 @@ RUN sed -i '/mysqlHost = .*$/c\mysqlHost = "mysql"' config.lua \ && sed -i '/mysqlDatabase = .*$/c\mysqlDatabase = "otserver"' config.lua \ && unzip -o data/world/world.zip -d data/world/ -VOLUME /otbr +VOLUME /canary -ENTRYPOINT ["/bin/otbr"] +ENTRYPOINT ["/bin/canary"] diff --git a/docker/test-server.sh b/docker/test-server.sh index 271517ea0df..a10afcc3ac9 100755 --- a/docker/test-server.sh +++ b/docker/test-server.sh @@ -64,7 +64,7 @@ mkdir -p build cd build cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake .. make -j`nproc` -mv bin/otbr ../ +mv bin/canary ../ cd .. unzip -o data/world/world.zip -d data/world/ diff --git a/recompile.sh b/recompile.sh index 325beb3f8fc..f5b93ed6568 100755 --- a/recompile.sh +++ b/recompile.sh @@ -20,9 +20,9 @@ then else echo "Compilation successful!" cd .. - if [ -f "otbr" ]; then + if [ -f "canary" ]; then echo "Saving old build" - mv ./otbr ./otbr.old + mv ./canary ./canary.old fi - cp ./build/otbr ./otbr + cp ./build/canary ./canary fi diff --git a/schema.sql b/schema.sql index 2959ac9fc73..ac3686aa6cd 100644 --- a/schema.sql +++ b/schema.sql @@ -1,5 +1,5 @@ -- --- OTServBR - Global - Database schema +--Canary - Database schema -- -- -------------------------------------------------------- diff --git a/sonar-project.properties b/sonar-project.properties index 59732074762..fef6c622ec4 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ -sonar.projectKey=opentibiabr_otservbr-global +sonar.projectKey=opentibiabr_canary sonar.organization=opentibiabr -sonar.projectName=otservbr-global +sonar.projectName=canary sonar.projectVersion=1.0 sonar.sources=src sonar.sourceEncoding=UTF-8 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 020cd4808cc..17c7730caad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -project(otbr) +project(canary) # ***************************************************************************** # Cmake Features @@ -31,7 +31,7 @@ option(DEBUG_LOG "Enable Debug Log" OFF) # Client # ***************************************************************************** if (MSVC) - add_executable(${PROJECT_NAME} "" ../cmake/otservbr-global.rc) + add_executable(${PROJECT_NAME} "" ../cmake/canary.rc) else() add_executable(${PROJECT_NAME} "") endif() diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index 3f51da124e2..d37a2e05736 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -116,8 +116,8 @@ bool ConfigManager::load() boolean[OPTIMIZE_DATABASE] = getGlobalBoolean(L, "startupDatabaseOptimization", true); string[IP] = getGlobalString(L, "ip", "127.0.0.1"); - string[MAP_NAME] = getGlobalString(L, "mapName", "otservbr"); - string[MAP_AUTHOR] = getGlobalString(L, "mapAuthor", "OTServBR"); + string[MAP_NAME] = getGlobalString(L, "mapName", "canary"); + string[MAP_AUTHOR] = getGlobalString(L, "mapAuthor", "Eduardo Dantas"); string[MAP_CUSTOM_NAME] = getGlobalString(L, "mapCustomName", ""); string[MAP_CUSTOM_FILE] = getGlobalString(L, "mapCustomFile", ""); @@ -129,7 +129,7 @@ bool ConfigManager::load() string[MYSQL_HOST] = getGlobalString(L, "mysqlHost", "127.0.0.1"); string[MYSQL_USER] = getGlobalString(L, "mysqlUser", "root"); string[MYSQL_PASS] = getGlobalString(L, "mysqlPass", ""); - string[MYSQL_DB] = getGlobalString(L, "mysqlDatabase", "otservbr-global"); + string[MYSQL_DB] = getGlobalString(L, "mysqlDatabase", "canary"); string[MYSQL_SOCK] = getGlobalString(L, "mysqlSock", ""); string[CLIENT_VERSION_STR] = getGlobalString(L, "clientVersionStr", "12.64"); diff --git a/src/icon/otservbr-global.ico b/src/icon/otservbr-global.ico deleted file mode 100644 index ec405a77387..00000000000 Binary files a/src/icon/otservbr-global.ico and /dev/null differ diff --git a/src/lua/callbacks/creaturecallback.cpp b/src/lua/callbacks/creaturecallback.cpp index 7e19dde128b..d8d3bb78b32 100644 --- a/src/lua/callbacks/creaturecallback.cpp +++ b/src/lua/callbacks/creaturecallback.cpp @@ -1,6 +1,6 @@ /** * @file creaturecallback.h - * OTBR + * OpenTibiaBR * Copyright (C) 2021 Lucas Grossi * * This program is free software; you can redistribute it and/or modify diff --git a/src/lua/callbacks/creaturecallback.h b/src/lua/callbacks/creaturecallback.h index a42eda16c95..47a58a30959 100644 --- a/src/lua/callbacks/creaturecallback.h +++ b/src/lua/callbacks/creaturecallback.h @@ -1,6 +1,6 @@ /** * @file creaturecallback.h - * OTBR + * OpenTibiaBR * Copyright (C) 2021 Lucas Grossi * * This program is free software; you can redistribute it and/or modify diff --git a/src/lua/scripts/luascript.cpp b/src/lua/scripts/luascript.cpp index 82fef0c9fa9..a172e4efb81 100644 --- a/src/lua/scripts/luascript.cpp +++ b/src/lua/scripts/luascript.cpp @@ -5068,7 +5068,7 @@ int LuaScriptInterface::luaGameGetBestiaryList(lua_State* L) } } else { if (isNumber(L, 2)) { - std::map tmplist = g_bestiary.findRaceByName("OTBR", false, getNumber(L, 2)); + std::map tmplist = g_bestiary.findRaceByName("CANARY", false, getNumber(L, 2)); for (auto itb : tmplist) { if (name) { pushString(L, itb.second); diff --git a/src/otserv.cpp b/src/otserv.cpp index 0a93e94f3b0..eca8f9da773 100644 --- a/src/otserv.cpp +++ b/src/otserv.cpp @@ -181,7 +181,7 @@ void loadModules() { #ifndef UNIT_TESTING int main(int argc, char* argv[]) { #ifdef DEBUG_LOG - SPDLOG_DEBUG("[OTBR] SPDLOG LOG DEBUG ENABLED"); + SPDLOG_DEBUG("[CANARY] SPDLOG LOG DEBUG ENABLED"); spdlog::set_pattern("[%Y-%d-%m %H:%M:%S.%e] [file %@] [func %!] [thread %t] [%^%l%$] %v "); #else spdlog::set_pattern("[%Y-%d-%m %H:%M:%S.%e] [%^%l%$] %v "); diff --git a/src/otservbr-global.rc b/src/otservbr-global.rc deleted file mode 100644 index 5a8d971f37a..00000000000 --- a/src/otservbr-global.rc +++ /dev/null @@ -1 +0,0 @@ -MAINICON ICON "icon/otservbr-global.ico" diff --git a/src/server/network/webhook/webhook.cpp b/src/server/network/webhook/webhook.cpp index 4ba31d46313..f9463cfc22e 100644 --- a/src/server/network/webhook/webhook.cpp +++ b/src/server/network/webhook/webhook.cpp @@ -135,7 +135,7 @@ static int webhook_send_message_(const char *url, const char *payload, std::stri curl_easy_setopt(curl, CURLOPT_WRITEDATA, reinterpret_cast(&response_body)); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "otservbr-global (https://github.com/Hydractify/otservbr-global)"); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "canary (https://github.com/Hydractify/canary)"); CURLcode res = curl_easy_perform(curl); diff --git a/src/utils/definitions.h b/src/utils/definitions.h index c6ca323d542..0d4e4462cf9 100644 --- a/src/utils/definitions.h +++ b/src/utils/definitions.h @@ -20,9 +20,9 @@ #ifndef FS_DEFINITIONS_H_877452FEC245450C9F96B8FD268D8963 #define FS_DEFINITIONS_H_877452FEC245450C9F96B8FD268D8963 -static constexpr auto STATUS_SERVER_NAME = "OTServBR - Global"; +static constexpr auto STATUS_SERVER_NAME = "Canary"; static constexpr auto STATUS_SERVER_VERSION = "TFS 1.3"; -static constexpr auto STATUS_SERVER_DEVELOPERS = "OTServBR-Global Team, Mark Samman and The Forgotten Server Developers"; +static constexpr auto STATUS_SERVER_DEVELOPERS = "OTServBR Team, Mark Samman and The Forgotten Server Developers"; static constexpr auto AUTHENTICATOR_DIGITS = 6U; static constexpr auto AUTHENTICATOR_PERIOD = 30U; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0f2b8158f6f..687aa2ddb11 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,21 +4,21 @@ include_directories(SYSTEM ${MYSQL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIR} ${CRYPTOPP_INCLUDE_DIR}) -project(otbr_unittest) +project(canary_unittest) set(CMAKE_CXX_FLAGS "-pipe -O0 -g -Wno-everything -std=c++11 -lstdc++ -lpthread -ldl") -add_executable(otbr_unittest +add_executable(canary_unittest main.cpp account_test.cpp) -target_compile_definitions(otbr_unittest PUBLIC -DUNIT_TESTING -DDEBUG_LOG) +target_compile_definitions(canary_unittest PUBLIC -DUNIT_TESTING -DDEBUG_LOG) -target_link_libraries(otbr_unittest Catch2::Catch2 otbr_lib ${MYSQL_CLIENT_LIBS} ${LUA_LIBRARIES} +target_link_libraries(canary_unittest Catch2::Catch2 canary_lib ${MYSQL_CLIENT_LIBS} ${LUA_LIBRARIES} ${Boost_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY} ${PUGIXML_LIBRARIES} ${CRYPTOPP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) include(CTest) include(Catch) -catch_discover_tests(otbr_unittest) +catch_discover_tests(canary_unittest) diff --git a/tests/build_and_run.sh b/tests/build_and_run.sh index e66ee0b1194..3d5531ebf0b 100755 --- a/tests/build_and_run.sh +++ b/tests/build_and_run.sh @@ -6,7 +6,7 @@ cd .. mkdir build cd build cmake -DPACKAGE_TESTS=On .. ; make -j`nproc` -./tests/otbr_unittest --reporter compact --success -d yes +./tests/canary_unittest --reporter compact --success -d yes cd .. cd tests docker-compose down --rmi all -v --remove-orphans diff --git a/vcpkg.json b/vcpkg.json index 9d5d13868f0..39e57de5d9e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,5 +1,5 @@ { - "name": "otbr", + "name": "canary", "version-string": "1.0.0", "dependencies": [ "boost-asio",