From d4fad5d966435b2e7ea4660749827e6ea54636c9 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Tue, 19 Dec 2023 17:38:59 +0100 Subject: [PATCH 01/34] maint: some more bot names --- src/services/getbots_command.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/services/getbots_command.cpp b/src/services/getbots_command.cpp index deb0362..f50c9c2 100644 --- a/src/services/getbots_command.cpp +++ b/src/services/getbots_command.cpp @@ -16,8 +16,11 @@ void getbots_command::handle_command(const network::address& target, const std:: "Ash", "asmjit", "avail", + "Boston", "Bubbles", "Catalyst", + "Cenote", + "Chicago", "clang", "Cressi", "Cypress", @@ -28,25 +31,32 @@ void getbots_command::handle_command(const network::address& target, const std:: "Eldor", "Evan", "Eve", + "Flex190", "FragsAreUs", "FryTechTip", "Furry", "FutureRave", + "Ginnie Springs", "Girl", "gsc-tool", "H3X1C", "Helium", "Hinder", "homura", + "Horizon - SCR", "INeedBots", "INeedGames", "Infamous", "Inferno", "Jack Back", "Jebus3211", + "JetFins", "JezuzLizard", "Jimbo", + "KonaFuzzButt", "Kordhell", + "King Crimson", + "KiraFoxAF", "Lifeline", "Joel", "JTAG", @@ -54,35 +64,47 @@ void getbots_command::handle_command(const network::address& target, const std:: "llvm-project", "Loba", "Loona", + "Loudward", "Louvenarde", "Mares", "momo5502", + "Montreal", "MUPP", "mxve", + "New York", + "Nightzy", "OneFourOne", "OpenAssetTools", "PeterG", + "Portobello", + "Portofino", "PottyMouth", "quaK", "RaidMax", "rapidjson", - "rEvoRebreather", + "Read Sea", "RektInator", "Resxt", + "rEvoRebreather", "RezTech", "Roxie", "Santi Diving", "sass", + "saysupshelly", "Scarlxrd", + "SCUBAPRO", "Sloth", "Slykuiper", "Snake", "Sparky", "Squirrel", "st0rm", + "StarBerry", + "TwinLeaf", "Valkyrie", "Wattson", "Wanted", + "Wereric", "xensik", "xoxor4d", "ZoneBuilder", From 9f68a0ed4b06561eca56cad874075cbaea211d25 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Fri, 12 Jan 2024 11:55:14 +0100 Subject: [PATCH 02/34] build: cleanup CI workflow --- .github/workflows/build.yml | 62 ++++++++++++++----------------------- premake5.lua | 2 +- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2f5f87..db7707a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,8 @@ jobs: fail-fast: false matrix: configuration: - - Debug - - Release + - debug + - release arch: - x64 include: @@ -30,7 +30,7 @@ jobs: platform: x64 steps: - name: Check out files - uses: actions/checkout@v4 + uses: actions/checkout@main with: submodules: true fetch-depth: 0 @@ -38,7 +38,7 @@ jobs: lfs: false - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.3.1 + uses: microsoft/setup-msbuild@main - name: Install Premake5 uses: abel0b/setup-premake@v2.3 @@ -51,13 +51,13 @@ jobs: - name: Set up problem matching uses: ammaraskar/msvc-problem-matcher@master - - name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries + - name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries run: msbuild /m /v:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/alterware-master.sln - - name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - uses: actions/upload-artifact@v3.1.3 + - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries + uses: actions/upload-artifact@main with: - name: Windows ${{matrix.configuration}} ${{matrix.arch}} binaries + name: windows-${{matrix.arch}}-${{matrix.configuration}} path: | build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master.exe build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master.pdb @@ -69,18 +69,13 @@ jobs: fail-fast: false matrix: configuration: - - Debug - - Release + - debug + - release arch: - x64 - include: - - configuration: Debug - config: debug - - configuration: Release - config: release steps: - name: Check out files - uses: actions/checkout@v4 + uses: actions/checkout@main with: submodules: true fetch-depth: 0 @@ -104,18 +99,18 @@ jobs: - name: Set up problem matching uses: ammaraskar/gcc-problem-matcher@master - - name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries + - name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries run: | pushd build - make config=${{matrix.config}}_${{matrix.arch}} -j$(nproc) + make config=${{matrix.configuration}}_${{matrix.arch}} -j$(nproc) env: CC: clang CXX: clang++ - - name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - uses: actions/upload-artifact@v3.1.3 + - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries + uses: actions/upload-artifact@main with: - name: Linux ${{matrix.configuration}} ${{matrix.arch}} binaries + name: linux-${{matrix.arch}}-${{matrix.configuration}} path: | build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master @@ -126,23 +121,14 @@ jobs: fail-fast: false matrix: configuration: - - Debug - - Release + - debug + - release arch: - x64 - arm64 - include: - - configuration: Debug - config: debug - - configuration: Release - config: release - - arch: x64 - platform: x64 - - arch: arm64 - platform: arm64 steps: - name: Check out files - uses: actions/checkout@v4 + uses: actions/checkout@main with: submodules: true fetch-depth: 0 @@ -160,14 +146,14 @@ jobs: - name: Set up problem matching uses: ammaraskar/gcc-problem-matcher@master - - name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries + - name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries run: | pushd build - make config=${{matrix.config}}_${{matrix.arch}} -j$(sysctl -n hw.logicalcpu) + make config=${{matrix.configuration}}_${{matrix.arch}} -j$(sysctl -n hw.logicalcpu) - - name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - uses: actions/upload-artifact@v3.1.3 + - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries + uses: actions/upload-artifact@main with: - name: macOS ${{matrix.configuration}} ${{matrix.arch}} binaries + name: macos-${{matrix.arch}}-${{matrix.configuration}} path: | build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master diff --git a/premake5.lua b/premake5.lua index e455a14..78bb1ae 100644 --- a/premake5.lua +++ b/premake5.lua @@ -36,7 +36,7 @@ location "./build" objdir "%{wks.location}/obj" targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}" -configurations {"Debug", "Release"} +configurations {"debug", "release"} language "C++" cppdialect "C++20" From b038ebf66146dbbca1905dc1e08ebacc381b6322 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Sat, 13 Jan 2024 10:40:06 +0100 Subject: [PATCH 03/34] build: clean workflow --- .github/workflows/build.yml | 9 ++++++--- src/services/getbots_command.cpp | 13 ++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db7707a..8407d97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,9 @@ concurrency: group: ${{ github.ref }} cancel-in-progress: true +env: + PREMAKE_VERSION: "5.0.0-beta2" + jobs: build-win: name: Build Windows @@ -43,7 +46,7 @@ jobs: - name: Install Premake5 uses: abel0b/setup-premake@v2.3 with: - version: "5.0.0-beta2" + version: ${{ env.PREMAKE_VERSION }} - name: Generate project files run: premake5 vs2022 @@ -91,7 +94,7 @@ jobs: - name: Install Premake5 uses: abel0b/setup-premake@v2.3 with: - version: "5.0.0-beta2" + version: ${{ env.PREMAKE_VERSION }} - name: Generate project files run: premake5 --cc=clang gmake2 @@ -138,7 +141,7 @@ jobs: - name: Install Premake5 uses: abel0b/setup-premake@v2.3 with: - version: "5.0.0-beta2" + version: ${{ env.PREMAKE_VERSION }} - name: Generate project files run: premake5 gmake2 diff --git a/src/services/getbots_command.cpp b/src/services/getbots_command.cpp index f50c9c2..074481c 100644 --- a/src/services/getbots_command.cpp +++ b/src/services/getbots_command.cpp @@ -18,6 +18,7 @@ void getbots_command::handle_command(const network::address& target, const std:: "avail", "Boston", "Bubbles", + "Caliber", "Catalyst", "Cenote", "Chicago", @@ -25,9 +26,12 @@ void getbots_command::handle_command(const network::address& target, const std:: "Cressi", "Cypress", "David Guetta", + "Debian", + "Devil's Spring", "Diamante", "Diavolo", "Dsso", + "Eagle's Nest", "Eldor", "Evan", "Eve", @@ -48,6 +52,7 @@ void getbots_command::handle_command(const network::address& target, const std:: "INeedGames", "Infamous", "Inferno", + "InfinityScript", "Jack Back", "Jebus3211", "JetFins", @@ -69,8 +74,10 @@ void getbots_command::handle_command(const network::address& target, const std:: "Mares", "momo5502", "Montreal", + "MSVC", "MUPP", "mxve", + "Neapolis", "New York", "Nightzy", "OneFourOne", @@ -89,10 +96,12 @@ void getbots_command::handle_command(const network::address& target, const std:: "RezTech", "Roxie", "Santi Diving", - "sass", + "Sass", "saysupshelly", "Scarlxrd", "SCUBAPRO", + "Serious", + "Sestriere", "Sloth", "Slykuiper", "Snake", @@ -100,7 +109,9 @@ void getbots_command::handle_command(const network::address& target, const std:: "Squirrel", "st0rm", "StarBerry", + "Trimix", "TwinLeaf", + "Ubuntu", "Valkyrie", "Wattson", "Wanted", From 1361cd502b4ef35514bd16823b90ddae4d7c583f Mon Sep 17 00:00:00 2001 From: Diavolo Date: Sun, 14 Jan 2024 13:34:54 +0100 Subject: [PATCH 04/34] build: deploy release binary --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8407d97..b34d22b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,3 +160,33 @@ jobs: name: macos-${{matrix.arch}}-${{matrix.configuration}} path: | build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master + + deploy: + name: Deploy artifacts + needs: [build-win, build-linux, build-macos] + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - name: Setup main environment + if: github.ref == 'refs/heads/master' + run: echo "ALTERWARE_MASTER_SERVER_PATH=${{ secrets.ALTERWARE_MASTER_SERVER_SSH_PATH }}" >> $GITHUB_ENV + + - name: Download Release binaries + uses: actions/download-artifact@main + with: + name: linux-x64-release + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2.6.1 + with: + key: ${{ secrets.ALTERWARE_MASTER_SERVER_SSH_PRIVATE_KEY }} + known_hosts: 'just-a-placeholder-so-we-dont-get-errors' + + - name: Add known hosts + run: ssh-keyscan -H ${{ secrets.ALTERWARE_MASTER_SERVER_SSH_ADDRESS }} >> ~/.ssh/known_hosts + + - name: Upload release binary + run: rsync -avz alterware-master ${{ secrets.ALTERWARE_MASTER_SERVER_SSH_USER }}@${{ secrets.ALTERWARE_MASTER_SERVER_SSH_ADDRESS }}:${{ env.ALTERWARE_MASTER_SERVER_PATH }}/ + + - name: Publish changes + run: ssh ${{ secrets.ALTERWARE_MASTER_SERVER_SSH_USER }}@${{ secrets.ALTERWARE_MASTER_SERVER_SSH_ADDRESS }} ${{ secrets.ALTERWARE_SSH_SERVER_PUBLISH_COMMAND }} From 794f3799ca382bd239ce808856496753cbd8fe8e Mon Sep 17 00:00:00 2001 From: Diavolo Date: Mon, 15 Jan 2024 12:16:25 +0100 Subject: [PATCH 05/34] fix(readme): fix a broken link [skip ci] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 53d7ea3..89f918a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is the master server our clients use. It is based on the DP Master Server (ID Tech) protocol ## Build -- Install [Premake5](premake5-link) and add it to your system PATH +- Install [Premake5][premake5-link] and add it to your system PATH - Clone this repository using [Git][git-link] - Update the submodules using ``git submodule update --init --recursive`` - Run Premake with either of these two options ``premake5 vs2022`` (Windows) or ``premake5 gmake2`` (Linux/macOS) @@ -19,6 +19,6 @@ Requirements for Unix systems: - Platform support: Details regarding supported platforms are available in [build.yml][build-link] [premake5-link]: https://premake.github.io -[git-link]: https://git-scm.com +[git-link]: https://git-scm.com [mold-link]: https://github.com/rui314/mold [build-link]: https://github.com/alterware/master-server/blob/master/.github/workflows/build.yml From 16f2e165acb967eda15bec18e2d377f442f8d693 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:24:07 +0100 Subject: [PATCH 06/34] build(deps): bump deps/zlib from `643e17b` to `ade6825` (#56) --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index 643e17b..ade6825 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit 643e17b7498d12ab8d15565662880579692f769d +Subproject commit ade6825c4996f73d776b0ffa038360762bd318ae From d31f17c8c1124296163f6384d44d76c26c151b06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 16:07:15 +0100 Subject: [PATCH 07/34] build(deps): bump deps/GSL from `52212c2` to `f1a494c` (#55) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- deps/GSL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/GSL b/deps/GSL index 52212c2..f1a494c 160000 --- a/deps/GSL +++ b/deps/GSL @@ -1 +1 @@ -Subproject commit 52212c2d7600c816ec9b0438d3fbd2a95c190c2f +Subproject commit f1a494cfd2ce55fe88b5134eab985f5852667b8d From 66a513805619dfe3e399ebf4af1d08aac123858d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:26:45 +0100 Subject: [PATCH 08/34] build(deps): bump deps/zlib from `ade6825` to `2e3d86c` (#58) --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index ade6825..2e3d86c 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit ade6825c4996f73d776b0ffa038360762bd318ae +Subproject commit 2e3d86c4e12c4c23db4229eea7d0c1cd4571273e From c9a77058b477cf41b06c4e524ef790f1f8d9cad5 Mon Sep 17 00:00:00 2001 From: Edo Date: Mon, 22 Jan 2024 17:20:20 +0100 Subject: [PATCH 09/34] maint(bots): add more names (#59) --- src/services/getbots_command.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/services/getbots_command.cpp b/src/services/getbots_command.cpp index 074481c..774598f 100644 --- a/src/services/getbots_command.cpp +++ b/src/services/getbots_command.cpp @@ -10,15 +10,18 @@ const char* getbots_command::get_command() const void getbots_command::handle_command(const network::address& target, const std::string_view&) { - static const std::vector bot_names + static const std::array bot_names { "aerosoul", "Ash", "asmjit", "avail", + "Barack Obama", + "Berlusconi", "Boston", "Bubbles", "Caliber", + "CAPTAINJERKFACE", "Catalyst", "Cenote", "Chicago", @@ -30,12 +33,15 @@ void getbots_command::handle_command(const network::address& target, const std:: "Devil's Spring", "Diamante", "Diavolo", + "DKo5", + "Donald Trump", "Dsso", "Eagle's Nest", "Eldor", "Evan", "Eve", "Flex190", + "FOURZEROTWO", "FragsAreUs", "FryTechTip", "Furry", @@ -63,6 +69,7 @@ void getbots_command::handle_command(const network::address& target, const std:: "King Crimson", "KiraFoxAF", "Lifeline", + "Joe Biden", "Joel", "JTAG", "Laupetin", @@ -72,6 +79,7 @@ void getbots_command::handle_command(const network::address& target, const std:: "Loudward", "Louvenarde", "Mares", + "Mattarella", "momo5502", "Montreal", "MSVC", @@ -83,11 +91,13 @@ void getbots_command::handle_command(const network::address& target, const std:: "OneFourOne", "OpenAssetTools", "PeterG", + "pgriffin69x", "Portobello", "Portofino", "PottyMouth", "quaK", "RaidMax", + "ramzi1337hak0r", "rapidjson", "Read Sea", "RektInator", @@ -113,6 +123,7 @@ void getbots_command::handle_command(const network::address& target, const std:: "TwinLeaf", "Ubuntu", "Valkyrie", + "Vore", "Wattson", "Wanted", "Wereric", From cdc53004fda212c48cb901ada72259aab1a23410 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:23:23 +0000 Subject: [PATCH 10/34] build(deps): bump deps/zlib from `2e3d86c` to `f1f503d` Bumps [deps/zlib](https://github.com/madler/zlib) from `2e3d86c` to `f1f503d`. - [Release notes](https://github.com/madler/zlib/releases) - [Commits](https://github.com/madler/zlib/compare/2e3d86c4e12c4c23db4229eea7d0c1cd4571273e...f1f503da85d52e56aae11557b4d79a42bcaa2b86) --- updated-dependencies: - dependency-name: deps/zlib dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index 2e3d86c..f1f503d 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit 2e3d86c4e12c4c23db4229eea7d0c1cd4571273e +Subproject commit f1f503da85d52e56aae11557b4d79a42bcaa2b86 From 4cf4ecf591cf0e44b4944fbffcff6fac9641a935 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:13:18 +0000 Subject: [PATCH 11/34] build(deps): bump deps/zlib from `f1f503d` to `e342bb3` Bumps [deps/zlib](https://github.com/madler/zlib) from `f1f503d` to `e342bb3`. - [Release notes](https://github.com/madler/zlib/releases) - [Commits](https://github.com/madler/zlib/compare/f1f503da85d52e56aae11557b4d79a42bcaa2b86...e342bb3daef3f6d89dd1d39a3059355db5a64c49) --- updated-dependencies: - dependency-name: deps/zlib dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index f1f503d..e342bb3 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit f1f503da85d52e56aae11557b4d79a42bcaa2b86 +Subproject commit e342bb3daef3f6d89dd1d39a3059355db5a64c49 From e56c2e31fb3415ac2b139451eb457bab871a5c68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 14:32:44 +0000 Subject: [PATCH 12/34] build(deps): bump deps/zlib from `e342bb3` to `504403f` Bumps [deps/zlib](https://github.com/madler/zlib) from `e342bb3` to `504403f`. - [Release notes](https://github.com/madler/zlib/releases) - [Commits](https://github.com/madler/zlib/compare/e342bb3daef3f6d89dd1d39a3059355db5a64c49...504403f3e468bca2dc85c055d96ad392e9c7aae0) --- updated-dependencies: - dependency-name: deps/zlib dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index e342bb3..504403f 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit e342bb3daef3f6d89dd1d39a3059355db5a64c49 +Subproject commit 504403f3e468bca2dc85c055d96ad392e9c7aae0 From 600be596ee0f273391e59ec350eac01cf2e232f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:53:18 +0000 Subject: [PATCH 13/34] build(deps): bump deps/rapidjson from `6089180` to `3f73eda` Bumps [deps/rapidjson](https://github.com/Tencent/rapidjson) from `6089180` to `3f73eda`. - [Release notes](https://github.com/Tencent/rapidjson/releases) - [Commits](https://github.com/Tencent/rapidjson/compare/6089180ecb704cb2b136777798fa1be303618975...3f73edae00aba5b0112a80b4d41e6f1ff7d92a3d) --- updated-dependencies: - dependency-name: deps/rapidjson dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/rapidjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/rapidjson b/deps/rapidjson index 6089180..3f73eda 160000 --- a/deps/rapidjson +++ b/deps/rapidjson @@ -1 +1 @@ -Subproject commit 6089180ecb704cb2b136777798fa1be303618975 +Subproject commit 3f73edae00aba5b0112a80b4d41e6f1ff7d92a3d From f4874ee10401b93741e7b736b37129f92f7cac68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:53:20 +0000 Subject: [PATCH 14/34] build(deps): bump deps/zlib from `504403f` to `985a62d` Bumps [deps/zlib](https://github.com/madler/zlib) from `504403f` to `985a62d`. - [Release notes](https://github.com/madler/zlib/releases) - [Commits](https://github.com/madler/zlib/compare/504403f3e468bca2dc85c055d96ad392e9c7aae0...985a62d11802b44d1d1049ddd692038923da6f0b) --- updated-dependencies: - dependency-name: deps/zlib dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index 504403f..985a62d 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit 504403f3e468bca2dc85c055d96ad392e9c7aae0 +Subproject commit 985a62d11802b44d1d1049ddd692038923da6f0b From 01bcd300d7fbc28879722fa09de36f582e73fe63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:49:29 +0000 Subject: [PATCH 15/34] build(deps): bump deps/zlib from `985a62d` to `5c42a23` Bumps [deps/zlib](https://github.com/madler/zlib) from `985a62d` to `5c42a23`. - [Release notes](https://github.com/madler/zlib/releases) - [Commits](https://github.com/madler/zlib/compare/985a62d11802b44d1d1049ddd692038923da6f0b...5c42a230b7b468dff011f444161c0145b5efae59) --- updated-dependencies: - dependency-name: deps/zlib dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index 985a62d..5c42a23 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit 985a62d11802b44d1d1049ddd692038923da6f0b +Subproject commit 5c42a230b7b468dff011f444161c0145b5efae59 From 1f87fb1e41fa9ef9cad41e744e6714f75916fc2a Mon Sep 17 00:00:00 2001 From: Edo Date: Mon, 12 Feb 2024 15:51:36 +0100 Subject: [PATCH 16/34] build: update version of ssh-key-action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b34d22b..fc6d6af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,7 +177,7 @@ jobs: name: linux-x64-release - name: Install SSH key - uses: shimataro/ssh-key-action@v2.6.1 + uses: shimataro/ssh-key-action@v2.7.0 with: key: ${{ secrets.ALTERWARE_MASTER_SERVER_SSH_PRIVATE_KEY }} known_hosts: 'just-a-placeholder-so-we-dont-get-errors' From 9ac42b065f1044ea3b943d11a2b0b36036add241 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Tue, 13 Feb 2024 10:51:29 +0100 Subject: [PATCH 17/34] maint(bots): new wave of names --- src/services/getbots_command.cpp | 57 ++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/src/services/getbots_command.cpp b/src/services/getbots_command.cpp index 774598f..e4b5225 100644 --- a/src/services/getbots_command.cpp +++ b/src/services/getbots_command.cpp @@ -12,12 +12,20 @@ void getbots_command::handle_command(const network::address& target, const std:: { static const std::array bot_names { + "6arelyhuman", "aerosoul", + "All Night", + "Another World", "Ash", "asmjit", "avail", "Barack Obama", + "barbie slut", + "Barbie Whore", "Berlusconi", + "Bimbo Suicide", + "bimbo", + "Blow Up!", "Boston", "Bubbles", "Caliber", @@ -28,18 +36,29 @@ void getbots_command::handle_command(const network::address& target, const std:: "clang", "Cressi", "Cypress", + "DANCE! Till We Die", "David Guetta", + "Death city", "Debian", "Devil's Spring", "Diamante", "Diavolo", + "Disgusting", "DKo5", + "Do U Luv Me", + "Do U", + "Don't Like Anybody", + "don't touch my hair", "Donald Trump", + "drama queenz", "Dsso", "Eagle's Nest", + "Eat Me", "Eldor", "Evan", "Eve", + "Eyelashes on", + "feeling nothing", "Flex190", "FOURZEROTWO", "FragsAreUs", @@ -48,12 +67,18 @@ void getbots_command::handle_command(const network::address& target, const std:: "FutureRave", "Ginnie Springs", "Girl", + "GMFU", + "Go Crazy", "gsc-tool", "H3X1C", + "Hands up!", "Helium", + "Hey Dj", + "Higher", "Hinder", "homura", "Horizon - SCR", + "Hypocrite", "INeedBots", "INeedGames", "Infamous", @@ -64,15 +89,17 @@ void getbots_command::handle_command(const network::address& target, const std:: "JetFins", "JezuzLizard", "Jimbo", - "KonaFuzzButt", - "Kordhell", - "King Crimson", - "KiraFoxAF", - "Lifeline", "Joe Biden", "Joel", "JTAG", + "King Crimson", + "KiraFoxAF", + "KonaFuzzButt", + "Kordhell", "Laupetin", + "Level Up!", + "Lifeline", + "Like a G6", "llvm-project", "Loba", "Loona", @@ -85,13 +112,17 @@ void getbots_command::handle_command(const network::address& target, const std:: "MSVC", "MUPP", "mxve", + "My Flaws", "Neapolis", "New York", "Nightzy", + "Non-binary Jesus", "OneFourOne", "OpenAssetTools", + "Parking Lot", "PeterG", "pgriffin69x", + "Poker Face", "Portobello", "Portofino", "PottyMouth", @@ -109,26 +140,40 @@ void getbots_command::handle_command(const network::address& target, const std:: "Sass", "saysupshelly", "Scarlxrd", + "scene high", "SCUBAPRO", "Serious", "Sestriere", + "Slay Everyday", "Sloth", + "SLUT SZN", "Slykuiper", "Snake", "Sparky", "Squirrel", "st0rm", + "Stalk Me", "StarBerry", + "Titanium", "Trimix", + "turn it up", "TwinLeaf", "Ubuntu", + "ur my heroin", + "Ur Vampire", "Valkyrie", + "Violence", "Vore", - "Wattson", "Wanted", + "Wattson", "Wereric", + "X Party", "xensik", + "XOXO (Kisses Hugs)", "xoxor4d", + "XXXTENSIONS", + "You & Me", + "Yummy", "ZoneBuilder", "ZoneTool", }; From d3b964c8454a8d0594818438382b811f2463f4b3 Mon Sep 17 00:00:00 2001 From: Edo Date: Mon, 19 Feb 2024 22:47:52 +0100 Subject: [PATCH 18/34] build: fix typo in premake5.lua --- premake5.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/premake5.lua b/premake5.lua index 78bb1ae..7c48028 100644 --- a/premake5.lua +++ b/premake5.lua @@ -100,13 +100,13 @@ end flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"} -filter "configurations:Release" +filter "configurations:release" optimize "Size" defines "NDEBUG" flags "FatalCompileWarnings" filter {} -filter "configurations:Debug" +filter "configurations:debug" optimize "Debug" defines {"DEBUG", "_DEBUG"} filter {} From 80e65028bb48e59dd6f70c8da46ae8ff3ef24f11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:47:41 +0000 Subject: [PATCH 19/34] build(deps): bump deps/libtomcrypt from `7e863d2` to `1777e6d` Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `7e863d2` to `1777e6d`. - [Release notes](https://github.com/libtom/libtomcrypt/releases) - [Commits](https://github.com/libtom/libtomcrypt/compare/7e863d21429f94ed6a720e24499a12a3f852bb31...1777e6d5c30f6201e9a78ee4d5b6167a4be32b43) --- updated-dependencies: - dependency-name: deps/libtomcrypt dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/libtomcrypt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libtomcrypt b/deps/libtomcrypt index 7e863d2..1777e6d 160000 --- a/deps/libtomcrypt +++ b/deps/libtomcrypt @@ -1 +1 @@ -Subproject commit 7e863d21429f94ed6a720e24499a12a3f852bb31 +Subproject commit 1777e6d5c30f6201e9a78ee4d5b6167a4be32b43 From ab576a7e3689e841330c11c5b21007f2a8ef7bae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 14:28:32 +0000 Subject: [PATCH 20/34] build(deps): bump deps/libtomcrypt from `1777e6d` to `f7e6519` Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `1777e6d` to `f7e6519`. - [Release notes](https://github.com/libtom/libtomcrypt/releases) - [Commits](https://github.com/libtom/libtomcrypt/compare/1777e6d5c30f6201e9a78ee4d5b6167a4be32b43...f7e6519fae1e11ff5ff9d36c84101a673002133b) --- updated-dependencies: - dependency-name: deps/libtomcrypt dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/libtomcrypt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libtomcrypt b/deps/libtomcrypt index 1777e6d..f7e6519 160000 --- a/deps/libtomcrypt +++ b/deps/libtomcrypt @@ -1 +1 @@ -Subproject commit 1777e6d5c30f6201e9a78ee4d5b6167a4be32b43 +Subproject commit f7e6519fae1e11ff5ff9d36c84101a673002133b From 6a3a2a366febd558e8c11ab99783e446b76cc647 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Mon, 4 Mar 2024 11:56:52 +0100 Subject: [PATCH 21/34] build: add arm64 for the Windows platform --- .github/workflows/build.yml | 3 +++ premake5.lua | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc6d6af..c22101d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,9 +28,12 @@ jobs: - release arch: - x64 + - arm64 include: - arch: x64 platform: x64 + - arch: arm64 + platform: arm64 steps: - name: Check out files uses: actions/checkout@main diff --git a/premake5.lua b/premake5.lua index 7c48028..8be85c4 100644 --- a/premake5.lua +++ b/premake5.lua @@ -90,10 +90,6 @@ filter { "system:macosx", "platforms:arm64" } linkoptions "-arch arm64" filter {} -if _OPTIONS["dev-build"] then - defines {"DEV_BUILD"} -end - if os.getenv("CI") then defines "CI" end @@ -142,6 +138,5 @@ filter {} dependencies.imports() - group "Dependencies" dependencies.projects() From a46e30f9b346444854238f9863acc813b1356729 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:33:04 +0000 Subject: [PATCH 22/34] build(deps): bump deps/rapidjson from `3f73eda` to `68afb49` Bumps [deps/rapidjson](https://github.com/Tencent/rapidjson) from `3f73eda` to `68afb49`. - [Release notes](https://github.com/Tencent/rapidjson/releases) - [Commits](https://github.com/Tencent/rapidjson/compare/3f73edae00aba5b0112a80b4d41e6f1ff7d92a3d...68afb49287fe1837ff138c3e7f77d25514ae2749) --- updated-dependencies: - dependency-name: deps/rapidjson dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/rapidjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/rapidjson b/deps/rapidjson index 3f73eda..68afb49 160000 --- a/deps/rapidjson +++ b/deps/rapidjson @@ -1 +1 @@ -Subproject commit 3f73edae00aba5b0112a80b4d41e6f1ff7d92a3d +Subproject commit 68afb49287fe1837ff138c3e7f77d25514ae2749 From 4b0bc8156da8045011a4dfe96538b82fde02df25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:32:24 +0000 Subject: [PATCH 23/34] build(deps): bump deps/rapidjson from `68afb49` to `5ec44fb` Bumps [deps/rapidjson](https://github.com/Tencent/rapidjson) from `68afb49` to `5ec44fb`. - [Release notes](https://github.com/Tencent/rapidjson/releases) - [Commits](https://github.com/Tencent/rapidjson/compare/68afb49287fe1837ff138c3e7f77d25514ae2749...5ec44fb9206695e5293f610b0a46d21851d0c966) --- updated-dependencies: - dependency-name: deps/rapidjson dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/rapidjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/rapidjson b/deps/rapidjson index 68afb49..5ec44fb 160000 --- a/deps/rapidjson +++ b/deps/rapidjson @@ -1 +1 @@ -Subproject commit 68afb49287fe1837ff138c3e7f77d25514ae2749 +Subproject commit 5ec44fb9206695e5293f610b0a46d21851d0c966 From c32a1cfca7d0b250ec9e036989af6687e6ca555c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:38:16 +0000 Subject: [PATCH 24/34] build(deps): bump deps/zlib from `5c42a23` to `4a5e3e7` Bumps [deps/zlib](https://github.com/madler/zlib) from `5c42a23` to `4a5e3e7`. - [Release notes](https://github.com/madler/zlib/releases) - [Commits](https://github.com/madler/zlib/compare/5c42a230b7b468dff011f444161c0145b5efae59...4a5e3e7d255f3f8eba9ecdb8bd8080db43bf0aeb) --- updated-dependencies: - dependency-name: deps/zlib dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index 5c42a23..4a5e3e7 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit 5c42a230b7b468dff011f444161c0145b5efae59 +Subproject commit 4a5e3e7d255f3f8eba9ecdb8bd8080db43bf0aeb From b86c443616967e77c0dc9339511c120de0526f0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:38:18 +0000 Subject: [PATCH 25/34] build(deps): bump deps/libtommath from `7f96509` to `7f39a72` Bumps [deps/libtommath](https://github.com/libtom/libtommath) from `7f96509` to `7f39a72`. - [Release notes](https://github.com/libtom/libtommath/releases) - [Commits](https://github.com/libtom/libtommath/compare/7f96509df1a6b44867bbda56bbf2cb92524be8ef...7f39a72cc2d68e39c102567e0cb975cff0646f37) --- updated-dependencies: - dependency-name: deps/libtommath dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/libtommath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libtommath b/deps/libtommath index 7f96509..7f39a72 160000 --- a/deps/libtommath +++ b/deps/libtommath @@ -1 +1 @@ -Subproject commit 7f96509df1a6b44867bbda56bbf2cb92524be8ef +Subproject commit 7f39a72cc2d68e39c102567e0cb975cff0646f37 From 97343093b13a57982c91cd6c079067e078a6bdc8 Mon Sep 17 00:00:00 2001 From: Edo Date: Mon, 11 Mar 2024 18:15:08 +0100 Subject: [PATCH 26/34] build: update workflow deps --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c22101d..bf38ceb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: microsoft/setup-msbuild@main - name: Install Premake5 - uses: abel0b/setup-premake@v2.3 + uses: diamante0018/setup-premake@master with: version: ${{ env.PREMAKE_VERSION }} @@ -95,7 +95,7 @@ jobs: sudo apt-get install libcurl4-gnutls-dev -y - name: Install Premake5 - uses: abel0b/setup-premake@v2.3 + uses: diamante0018/setup-premake@master with: version: ${{ env.PREMAKE_VERSION }} @@ -142,7 +142,7 @@ jobs: lfs: false - name: Install Premake5 - uses: abel0b/setup-premake@v2.3 + uses: diamante0018/setup-premake@master with: version: ${{ env.PREMAKE_VERSION }} From bb8d5bbe9e5688a8da732a5f5c1671dad9e5abb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:03:54 +0000 Subject: [PATCH 27/34] build(deps): bump deps/zlib from `4a5e3e7` to `99b2294` Bumps [deps/zlib](https://github.com/madler/zlib) from `4a5e3e7` to `99b2294`. - [Release notes](https://github.com/madler/zlib/releases) - [Commits](https://github.com/madler/zlib/compare/4a5e3e7d255f3f8eba9ecdb8bd8080db43bf0aeb...99b229487c2997b4b22eaef90fedfbff4d8826cc) --- updated-dependencies: - dependency-name: deps/zlib dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index 4a5e3e7..99b2294 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit 4a5e3e7d255f3f8eba9ecdb8bd8080db43bf0aeb +Subproject commit 99b229487c2997b4b22eaef90fedfbff4d8826cc From d43455a1d9a8a6bf742adbcb8f718afce1361c58 Mon Sep 17 00:00:00 2001 From: Future Date: Fri, 22 Mar 2024 16:13:30 +0100 Subject: [PATCH 28/34] build: add Docker support --- .github/workflows/build.yml | 67 ++++++++++++++++++++++++++++++++++--- Dockerfile | 13 +++++++ README.md | 8 +++++ src/crypto_key.cpp | 2 +- src/services/kill_list.cpp | 10 ++++-- 5 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf38ceb..a87ad0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,10 +3,12 @@ name: Build on: push: branches: - - "*" + - "**" + tags: + - '[0-9]+.[0-9]+.[0-9]+' pull_request: branches: - - "*" + - "**" types: [opened, synchronize, reopened] concurrency: @@ -168,10 +170,9 @@ jobs: name: Deploy artifacts needs: [build-win, build-linux, build-macos] runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/master' + if: github.ref_type == 'tag' steps: - name: Setup main environment - if: github.ref == 'refs/heads/master' run: echo "ALTERWARE_MASTER_SERVER_PATH=${{ secrets.ALTERWARE_MASTER_SERVER_SSH_PATH }}" >> $GITHUB_ENV - name: Download Release binaries @@ -193,3 +194,61 @@ jobs: - name: Publish changes run: ssh ${{ secrets.ALTERWARE_MASTER_SERVER_SSH_USER }}@${{ secrets.ALTERWARE_MASTER_SERVER_SSH_ADDRESS }} ${{ secrets.ALTERWARE_SSH_SERVER_PUBLISH_COMMAND }} + + docker: + name: Create Docker Image + needs: [build-win, build-linux, build-macos] + runs-on: ubuntu-latest + if: github.ref_type == 'tag' + steps: + - name: Check out files + uses: actions/checkout@main + with: + sparse-checkout: | + Dockerfile + README.md + sparse-checkout-cone-mode: false + + - name: Download Release binaries + uses: actions/download-artifact@main + + - name: Compress Binaries + run: | + for dir in */; do + if [[ $dir == *"windows"* ]]; then + cd "$dir" && zip -r "../${dir%/}.zip" . && cd .. + else + tar -czvf "${dir%/}.tar.gz" -C "$dir" . + fi + done + shell: bash + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3.2.0 + + - name: Login to DockerHub + uses: docker/login-action@v3.1.0 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - id: meta + uses: docker/metadata-action@v5.5.1 + with: + images: | + alterware/master-server + tags: | + ${{ github.ref_name }} + latest + + - name: Build and Push Docker Image + id: build-and-push + uses: docker/build-push-action@v5.1.0 + with: + context: . + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..571d90b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:latest + +RUN apt-get update +RUN apt-get install -y libc++-dev libcurl4-gnutls-dev + +COPY --chmod=755 ./linux-x64-release/alterware-master /usr/local/bin/ + +RUN groupadd alterware-master && useradd -r -g alterware-master alterware-master +USER alterware-master + +EXPOSE 20810/udp + +ENTRYPOINT ["/usr/local/bin/alterware-master"] diff --git a/README.md b/README.md index 89f918a..109cfbe 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,13 @@ # AlterWare: Master Server This is the master server our clients use. It is based on the DP Master Server (ID Tech) protocol +## Usage +Run using [Docker][docker-link] + +```bash +docker run -p 20810:20810/udp alterware/master-server:latest +``` + ## Build - Install [Premake5][premake5-link] and add it to your system PATH - Clone this repository using [Git][git-link] @@ -18,6 +25,7 @@ Requirements for Unix systems: - Customization: Modifications to the Premake5.lua script may be required - Platform support: Details regarding supported platforms are available in [build.yml][build-link] +[docker-link]: https://www.docker.com [premake5-link]: https://premake.github.io [git-link]: https://git-scm.com [mold-link]: https://github.com/rui314/mold diff --git a/src/crypto_key.cpp b/src/crypto_key.cpp index d2fe2b1..ed6bff9 100644 --- a/src/crypto_key.cpp +++ b/src/crypto_key.cpp @@ -36,7 +36,7 @@ namespace crypto_key if (!utils::io::write_file("./private.key", key.serialize())) { - throw std::runtime_error("Failed to write server key!"); + console::error("Failed to write server key!"); } console::info("Generated cryptographic key: %llX", key.get_hash()); diff --git a/src/services/kill_list.cpp b/src/services/kill_list.cpp index a349d95..bc6627a 100644 --- a/src/services/kill_list.cpp +++ b/src/services/kill_list.cpp @@ -142,8 +142,14 @@ void kill_list::write_to_disk() stream << entry.ip_address_ << " " << entry.reason_ << "\n"; } - utils::io::write_file(kill_file, stream.str(), false); - console::info("Wrote %s to disk (%zu entries)", kill_file, entries.size()); + if (utils::io::write_file(kill_file, stream.str(), false)) + { + console::info("Wrote %s to disk (%zu entries)", kill_file, entries.size()); + } + else + { + console::error("Failed to write %s!", kill_file); + } }); } From f9e63529403d97728e47fe1e8d7666adacc20541 Mon Sep 17 00:00:00 2001 From: Future Date: Sun, 14 Apr 2024 23:20:57 +0200 Subject: [PATCH 29/34] chore: update deps --- .github/dependabot.yml | 2 +- deps/libtommath | 2 +- deps/rapidjson | 2 +- deps/zlib | 2 +- src/services/getbots_command.cpp | 31 ------------------------------- 5 files changed, 4 insertions(+), 35 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4fcd556..97b2020 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,5 +3,5 @@ updates: - package-ecosystem: gitsubmodule directory: "/" schedule: - interval: daily + interval: monthly open-pull-requests-limit: 10 diff --git a/deps/libtommath b/deps/libtommath index 7f39a72..5809141 160000 --- a/deps/libtommath +++ b/deps/libtommath @@ -1 +1 @@ -Subproject commit 7f39a72cc2d68e39c102567e0cb975cff0646f37 +Subproject commit 5809141a3a6ec1bf3443c927c02b955e19224016 diff --git a/deps/rapidjson b/deps/rapidjson index 5ec44fb..ab1842a 160000 --- a/deps/rapidjson +++ b/deps/rapidjson @@ -1 +1 @@ -Subproject commit 5ec44fb9206695e5293f610b0a46d21851d0c966 +Subproject commit ab1842a2dae061284c0a62dca1cc6d5e7e37e346 diff --git a/deps/zlib b/deps/zlib index 99b2294..0f51fb4 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit 99b229487c2997b4b22eaef90fedfbff4d8826cc +Subproject commit 0f51fb4933fc9ce18199cb2554dacea8033e7fd3 diff --git a/src/services/getbots_command.cpp b/src/services/getbots_command.cpp index e4b5225..0d05c7f 100644 --- a/src/services/getbots_command.cpp +++ b/src/services/getbots_command.cpp @@ -15,14 +15,10 @@ void getbots_command::handle_command(const network::address& target, const std:: "6arelyhuman", "aerosoul", "All Night", - "Another World", "Ash", - "asmjit", "avail", - "Barack Obama", "barbie slut", "Barbie Whore", - "Berlusconi", "Bimbo Suicide", "bimbo", "Blow Up!", @@ -35,7 +31,6 @@ void getbots_command::handle_command(const network::address& target, const std:: "Chicago", "clang", "Cressi", - "Cypress", "DANCE! Till We Die", "David Guetta", "Death city", @@ -49,14 +44,11 @@ void getbots_command::handle_command(const network::address& target, const std:: "Do U", "Don't Like Anybody", "don't touch my hair", - "Donald Trump", "drama queenz", "Dsso", "Eagle's Nest", "Eat Me", - "Eldor", "Evan", - "Eve", "Eyelashes on", "feeling nothing", "Flex190", @@ -67,35 +59,27 @@ void getbots_command::handle_command(const network::address& target, const std:: "FutureRave", "Ginnie Springs", "Girl", - "GMFU", "Go Crazy", "gsc-tool", "H3X1C", "Hands up!", - "Helium", "Hey Dj", "Higher", - "Hinder", "homura", "Horizon - SCR", "Hypocrite", - "INeedBots", "INeedGames", "Infamous", "Inferno", "InfinityScript", "Jack Back", - "Jebus3211", "JetFins", "JezuzLizard", - "Jimbo", "Joe Biden", "Joel", - "JTAG", "King Crimson", "KiraFoxAF", "KonaFuzzButt", - "Kordhell", "Laupetin", "Level Up!", "Lifeline", @@ -106,7 +90,6 @@ void getbots_command::handle_command(const network::address& target, const std:: "Loudward", "Louvenarde", "Mares", - "Mattarella", "momo5502", "Montreal", "MSVC", @@ -119,38 +102,27 @@ void getbots_command::handle_command(const network::address& target, const std:: "Non-binary Jesus", "OneFourOne", "OpenAssetTools", - "Parking Lot", - "PeterG", "pgriffin69x", "Poker Face", - "Portobello", "Portofino", "PottyMouth", - "quaK", "RaidMax", "ramzi1337hak0r", - "rapidjson", - "Read Sea", "RektInator", "Resxt", "rEvoRebreather", "RezTech", "Roxie", "Santi Diving", - "Sass", "saysupshelly", "Scarlxrd", "scene high", "SCUBAPRO", - "Serious", - "Sestriere", "Slay Everyday", "Sloth", "SLUT SZN", - "Slykuiper", "Snake", "Sparky", - "Squirrel", "st0rm", "Stalk Me", "StarBerry", @@ -158,11 +130,9 @@ void getbots_command::handle_command(const network::address& target, const std:: "Trimix", "turn it up", "TwinLeaf", - "Ubuntu", "ur my heroin", "Ur Vampire", "Valkyrie", - "Violence", "Vore", "Wanted", "Wattson", @@ -170,7 +140,6 @@ void getbots_command::handle_command(const network::address& target, const std:: "X Party", "xensik", "XOXO (Kisses Hugs)", - "xoxor4d", "XXXTENSIONS", "You & Me", "Yummy", From f2dd8d5c3802734f5cd7ff1e409ff1adf8d845ab Mon Sep 17 00:00:00 2001 From: Diamante Date: Sat, 4 May 2024 10:15:40 +0200 Subject: [PATCH 30/34] fix(elimination_handler): re-write patch (#86) --- .gitmodules | 2 +- deps/curl | 2 +- src/server.cpp | 12 +++++------- src/server_list.hpp | 2 +- src/services/elimination_handler.cpp | 12 +++++------- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.gitmodules b/.gitmodules index 588e7b6..2ca343b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,4 +19,4 @@ [submodule "deps/curl"] path = deps/curl url = https://github.com/curl/curl.git - branch = curl-8_5_0 + branch = curl-8_7_1 diff --git a/deps/curl b/deps/curl index 7161cb1..de7b3e8 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit 7161cb17c01dcff1dc5bf89a18437d9d729f1ecd +Subproject commit de7b3e89218467159a7af72d58cea8425946e97d diff --git a/src/server.cpp b/src/server.cpp index 77f293a..9ba1d9e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -57,11 +57,11 @@ void server::run_frame() } catch (const service::execution_exception& e) { - console::warn("Execption in service: %s", e.what()); + console::warn("Exception in service: %s", e.what()); } catch (const std::exception& e) { - console::error("Fatal execption in service: %s", e.what()); + console::error("Fatal exception in service: %s", e.what()); } } } @@ -84,8 +84,7 @@ void server::handle_command(const network::address& target, const std::string_vi } #ifdef DEBUG - console::log("Handling command (%s): %.*s - %.*s", target.to_string().data(), command.size(), command.data(), - data.size(), data.data()); + console::log("Handling command (%s): %.*s - %.*s", target.to_string().data(), command.size(), command.data(), data.size(), data.data()); #endif try @@ -94,12 +93,11 @@ void server::handle_command(const network::address& target, const std::string_vi } catch (const service::execution_exception& e) { - console::warn("Execption in command %.*s (%s): %s", command.size(), command.data(), target.to_string().data(), + console::warn("Exception in command %.*s (%s): %s", command.size(), command.data(), target.to_string().data(), e.what()); } catch (const std::exception& e) { - console::error("Fatal execption in command %.*s (%s): %s", command.size(), command.data(), - target.to_string().data(), e.what()); + console::error("Fatal exception in command %.*s (%s): %s", command.size(), command.data(), target.to_string().data(), e.what()); } } diff --git a/src/server_list.hpp b/src/server_list.hpp index 37de262..fdeed1a 100644 --- a/src/server_list.hpp +++ b/src/server_list.hpp @@ -3,7 +3,7 @@ #include "game_server.hpp" #include "network_list.hpp" -class server_list : public network_list +class server_list : public network_list { public: void find_registered_servers(game_type game, int protocol, const access_func& accessor); diff --git a/src/services/elimination_handler.cpp b/src/services/elimination_handler.cpp index fc41ebd..b0f8bb4 100644 --- a/src/services/elimination_handler.cpp +++ b/src/services/elimination_handler.cpp @@ -7,7 +7,7 @@ constexpr size_t MAX_SERVERS_PER_GAME = 10; void elimination_handler::run_frame() { - std::unordered_map> server_count; + std::unordered_map> server_count; auto now = std::chrono::high_resolution_clock::now(); this->get_server().get_server_list().iterate([&](server_list::iteration_context& context) @@ -29,17 +29,15 @@ void elimination_handler::run_frame() if (server.game == game_type::t7 && server.protocol < T7_PROTOCOL) { #ifdef _DEBUG - console::log("Removing T7 server '%s' because they are using an outdated protocol (%i)\n", - context.get_address().to_string().data(), server.protocol); + console::log("Removing T7 server '%s' because they are using an outdated protocol (%i)", context.get_address().to_string().data(), server.protocol); #endif context.remove(); } - ++server_count[server.game][context.get_address()]; - if (server_count[server.game][context.get_address()] >= MAX_SERVERS_PER_GAME) + ++server_count[server.game][context.get_address().to_string(false)]; + if (server_count[server.game][context.get_address().to_string(false)] >= MAX_SERVERS_PER_GAME) { - console::log("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME\n", - context.get_address().to_string().data()); + console::log("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME", context.get_address().to_string().data()); context.remove(); } }); From d48736c12aa260ec9842168a7597604a5c0a1a91 Mon Sep 17 00:00:00 2001 From: Future Date: Sat, 4 May 2024 10:34:02 +0200 Subject: [PATCH 31/34] fix: actually allow MAX_SERVERS_PER_GAME --- src/services/elimination_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/elimination_handler.cpp b/src/services/elimination_handler.cpp index b0f8bb4..22c3109 100644 --- a/src/services/elimination_handler.cpp +++ b/src/services/elimination_handler.cpp @@ -35,7 +35,7 @@ void elimination_handler::run_frame() } ++server_count[server.game][context.get_address().to_string(false)]; - if (server_count[server.game][context.get_address().to_string(false)] >= MAX_SERVERS_PER_GAME) + if (server_count[server.game][context.get_address().to_string(false)] > MAX_SERVERS_PER_GAME) { console::log("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME", context.get_address().to_string().data()); context.remove(); From 479f6fcbf342e10714178fc6cf2925c8019bd8a7 Mon Sep 17 00:00:00 2001 From: Diamante Date: Sat, 4 May 2024 19:05:02 +0200 Subject: [PATCH 32/34] maint: remove links from server names (#87) --- src/services/elimination_handler.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/services/elimination_handler.cpp b/src/services/elimination_handler.cpp index 22c3109..def0d60 100644 --- a/src/services/elimination_handler.cpp +++ b/src/services/elimination_handler.cpp @@ -1,9 +1,20 @@ #include #include "elimination_handler.hpp" -constexpr auto T7_PROTOCOL = 7; +#include -constexpr size_t MAX_SERVERS_PER_GAME = 10; +namespace +{ + constexpr auto T7_PROTOCOL = 7; + + constexpr size_t MAX_SERVERS_PER_GAME = 10; + + std::array bad_names = + { + "http", + "discord.gg", + }; +} void elimination_handler::run_frame() { @@ -40,6 +51,16 @@ void elimination_handler::run_frame() console::log("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME", context.get_address().to_string().data()); context.remove(); } + + const auto name = utils::string::to_lower(server.name); + for (const auto& entry : bad_names) + { + if (const auto pos = name.find(entry); pos != std::string::npos) + { + console::log("Removing server '%s' (%s) because it contains a bad name", server.name.data(), context.get_address().to_string().data()); + context.remove(); + } + } }); now = std::chrono::high_resolution_clock::now(); From 89f29244accb1348777c3f81c914e7935e2359e1 Mon Sep 17 00:00:00 2001 From: Future Date: Sat, 4 May 2024 19:06:26 +0200 Subject: [PATCH 33/34] fix: break out of loop when condition is met --- src/services/elimination_handler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/elimination_handler.cpp b/src/services/elimination_handler.cpp index def0d60..7f60b75 100644 --- a/src/services/elimination_handler.cpp +++ b/src/services/elimination_handler.cpp @@ -59,6 +59,7 @@ void elimination_handler::run_frame() { console::log("Removing server '%s' (%s) because it contains a bad name", server.name.data(), context.get_address().to_string().data()); context.remove(); + break; } } }); From 27c2b2b75b56e54dcfbec690dd086946a45587d7 Mon Sep 17 00:00:00 2001 From: Future Date: Thu, 30 May 2024 19:19:13 +0200 Subject: [PATCH 34/34] maint: improve overall logic in elimination_handler --- src/services/elimination_handler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/elimination_handler.cpp b/src/services/elimination_handler.cpp index 7f60b75..808843c 100644 --- a/src/services/elimination_handler.cpp +++ b/src/services/elimination_handler.cpp @@ -30,6 +30,7 @@ void elimination_handler::run_frame() (server.state == game_server::state::can_ping && diff > 15min)) { context.remove(); + return; } if (server.game == game_type::unknown) @@ -43,6 +44,7 @@ void elimination_handler::run_frame() console::log("Removing T7 server '%s' because they are using an outdated protocol (%i)", context.get_address().to_string().data(), server.protocol); #endif context.remove(); + return; } ++server_count[server.game][context.get_address().to_string(false)]; @@ -50,6 +52,7 @@ void elimination_handler::run_frame() { console::log("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME", context.get_address().to_string().data()); context.remove(); + return; } const auto name = utils::string::to_lower(server.name); @@ -59,7 +62,7 @@ void elimination_handler::run_frame() { console::log("Removing server '%s' (%s) because it contains a bad name", server.name.data(), context.get_address().to_string().data()); context.remove(); - break; + return; } } });