diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..506b507541 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +{ + "name": "BASH Dev Container", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers-community/npm-features/prettier:1": { + "plugins": "prettier-plugin-sh" + }, + "ghcr.io/devcontainers-extra/features/actionlint:1": {}, + "ghcr.io/devcontainers-extra/features/checkov:1": {}, + "ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {}, + "ghcr.io/devcontainers-extra/features/shellcheck:1": {}, + "ghcr.io/devcontainers-extra/features/yamllint:2": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "DavidAnson.vscode-markdownlint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", + "timonwong.shellcheck", + "yzhang.markdown-all-in-one" + ] + } + }, + "postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template" +} diff --git a/.editorconfig b/.editorconfig index f20e02e1c9..da6e5f2caf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,28 +1,17 @@ # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. -# Atom: Please assure your Atom's config setting Tab Type is set to auto, otherwise Atom-EditorConfig may not work as expected. Also disable whitespace package. # http://editorconfig.org/ root = true [*] charset = utf-8 -indent_style = tab -indent_size = 4 -trim_trailing_whitespace = true end_of_line = lf -insert_final_newline = true - -# YAML Files -[*.{yml,yaml}] -indent_size = 2 -indent_style = space - -# JSON Files -[*.{json,json5,webmanifest}] indent_size = 2 indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true # BASH Files [*.{.sh}] -indent_style = tab indent_size = 4 +indent_style = tab diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 441867e9c8..dc3c5b515e 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,12 +1,2 @@ -# These are supported funding model platforms - -github: dgibbs64 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: dgibbs # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL +github: dgibbs64 +patreon: dgibbs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 443cf3becc..84c7ea0ee4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,8 +1,11 @@ -# Set update schedule for GitHub Actions version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: - # Check for updates to GitHub Actions every weekday - interval: "daily" + interval: "weekly" + + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/action-prettier.yml b/.github/workflows/action-prettier.yml new file mode 100644 index 0000000000..a7e0a7172b --- /dev/null +++ b/.github/workflows/action-prettier.yml @@ -0,0 +1,36 @@ +name: Prettier + +on: + workflow_dispatch: + push: + branches: + - "*" + +concurrency: + group: prettier-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + prettier: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + persist-credentials: false + + - name: Install Prettier and plugins + run: | + npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template + + - name: Prettify code + uses: creyD/prettier_action@v4.6 + with: + prettier_plugins: "prettier-plugin-sh prettier-plugin-jinja-template" + prettier_options: --write . + github_token: ${{ secrets.GITHUB_TOKEN }} + commit_message: "chore(prettier): format code" diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml new file mode 100644 index 0000000000..a2b12fca45 --- /dev/null +++ b/.github/workflows/action-super-linter.yml @@ -0,0 +1,51 @@ +name: Super Linter + +on: + workflow_dispatch: + push: + branches: + - "*" + +concurrency: + group: super-linter-${{ github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + build: + name: Lint + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + persist-credentials: false + + - name: Install Prettier plugins (for summary formatting) + run: | + npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template || true + + - name: Super-linter + uses: super-linter/super-linter@v8 + env: + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_GITHUB_ACTIONS_ZIZMOR: false + VALIDATE_JSCPD: false + VALIDATE_JSON_PRETTIER: false + VALIDATE_MARKDOWN_PRETTIER: false + VALIDATE_NATURAL_LANGUAGE: false + VALIDATE_SHELL_SHFMT: false + VALIDATE_TERRAFORM_TERRASCAN: false + VALIDATE_YAML_PRETTIER: false diff --git a/.github/workflows/action-update-copyright-years-in-license-file.yml b/.github/workflows/action-update-copyright-years-in-license-file.yml new file mode 100644 index 0000000000..7ee528ca99 --- /dev/null +++ b/.github/workflows/action-update-copyright-years-in-license-file.yml @@ -0,0 +1,29 @@ +name: Update copyright year(s) in license file + +on: + workflow_dispatch: + schedule: + - cron: "0 3 1 1 *" # 03:00 AM on January 1 + +permissions: + contents: write + +jobs: + update-license-year: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + persist-credentials: false + - name: Action Update License Year + uses: FantasticFiasco/action-update-license-year@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + path: LICENSE.md + - name: Merge pull request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr merge --merge --delete-branch diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 748a779914..f52d12c5af 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -68,6 +68,10 @@ jobs: else curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}" fi + + - name: Pre-load LinuxGSM + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details + - name: Display config run: | if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 932e3ea2af..2f2f7babc2 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -13,12 +13,12 @@ concurrency: jobs: update-check: if: github.repository_owner == 'GameServerManagers' - continue-on-error: true runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints] + shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints, xnt] steps: - name: Download linuxgsm.sh diff --git a/.gitignore b/.gitignore index e5c465ce23..c6dd34d73f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,11 @@ -.vscode/settings.json -/node_modules +# Visual Studio Code +.vscode/* +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets +.history/ +*.vsix + +# Node.js +node_modules diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000000..02d542d509 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "plugins": ["prettier-plugin-sh"] +} diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000000..026ee646c7 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +disable=SC2154 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c7a7dab105..d31b65dd26 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,12 @@ { "recommendations": [ - "ms-python.python", + "DavidAnson.vscode-markdownlint", "editorconfig.editorconfig", - "yzhang.markdown-all-in-one", "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", "timonwong.shellcheck", - "redhat.vscode-yaml" + "yzhang.markdown-all-in-one" ] } diff --git a/lgsm/config-default/config-lgsm/cs2server/_default.cfg b/lgsm/config-default/config-lgsm/cs2server/_default.cfg index dca9194f49..66414592a0 100644 --- a/lgsm/config-default/config-lgsm/cs2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cs2server/_default.cfg @@ -163,8 +163,8 @@ glibc="2.31" ## Game Server Directories systemdir="${serverfiles}/game/csgo" -executabledir="${serverfiles}/game/bin/linuxsteamrt64" -executable="./cs2" +executabledir="${serverfiles}/game" +executable="./cs2.sh" servercfgdir="${systemdir}/cfg" servercfg="${selfname}.cfg" servercfgdefault="server.cfg" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index c429a6c8ea..7ce4dd073c 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -9,6 +9,8 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for HL2DM, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" ip="0.0.0.0" port="27015" clientport="27005" diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index d6ce41d827..f71c1a8d41 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -12,11 +12,12 @@ ip="0.0.0.0" queryport="15777" beaconport="15000" +reliableport="8888" port="7777" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Game Server Docs | https://satisfactory.fandom.com/wiki/Dedicated_servers -startparameters="FactoryGame -Port=${port} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -log" +startparameters="FactoryGame -Port=${port} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -ReliablePort=${reliableport} -log" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 6002490139..74fd359abe 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -9,6 +9,8 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for TF2, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" ip="0.0.0.0" port="27015" clientport="27005" diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index b027d0fca2..76bed1890d 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -174,8 +174,12 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +# Deeper monitoring is possible when the server is public and not using Crossplay: +# querymode="2" +# querytype="protocol-valve" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg index a3bc472c46..740b3923d5 100644 --- a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -12,7 +12,7 @@ startparameters="--dataPath ${servercfgdir}" ## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings -# Branch (stable|unstable) +# Branch (stable|unstable|) branch="stable" #### LinuxGSM Settings #### diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 08d91f8fce..2405a4b3ee 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index a16722c2f3..069e8e437e 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 7b467fa00f..39af5868df 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 4b9fd21331..bcaf1e31da 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index c6ff3a272a..446a55ebb5 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 74d82e158e..9082f1cc82 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 33b7deaf92..65bc395357 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 06fd9e52ca..e67a822b79 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 7d775040e4..2ca56633f8 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -11,7 +11,7 @@ av bb bb2,libcurl4-gnutls-dev:i386 bd -bf1942,libncurses5:i386,libtinfo5:i386 +bf1942,libncurses5:i386 bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo @@ -31,7 +31,7 @@ cs cs2 cscz csgo -css,libtinfo5:i386 +css ct dab dayz @@ -48,7 +48,7 @@ etl ets2 fctr fof -gmod,libtinfo5:i386 +gmod hcu hl2dm hldm @@ -65,14 +65,14 @@ kf kf2 l4d l4d2 -mc,openjdk-22-jre +mc,openjdk-25-jre mcb mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils nd nec -nmrih,libtinfo5:i386 +nmrih ns ns2,speex,libtbb12 ns2c,speex:i386,libtbb12 @@ -81,12 +81,12 @@ onset,libmariadb-dev opfor pc pc2 -pmc,openjdk-22-jre +pmc,openjdk-25-jre squad44 pvkii pvr,libc++1 pw -pz,openjdk-22-jre,rng-tools5 +pz,openjdk-25-jre,rng-tools5 q2 q3 q4 @@ -96,7 +96,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-22-jre +rw,openjdk-25-jre samp sb sbots @@ -104,7 +104,7 @@ scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf -sfc,libtinfo5:i386 +sfc sm,telnet,expect sof2 sol @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet @@ -135,5 +135,5 @@ wf wmc,openjdk21-jre wurm,xvfb xnt -zmr,libtinfo5:i386 -zps,libtinfo5:i386 +zmr +zps diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 02acceacd6..43fb4c5a2e 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 90c9df07e1..26420d76f8 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 0298bd0b0e..9515a12aca 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index a16722c2f3..069e8e437e 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 0298bd0b0e..9515a12aca 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index a16722c2f3..069e8e437e 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 436bdecb8a..da755fc1f8 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 3b24ff37fa..b8d996023b 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index f19436d6ad..18cb1c457a 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index f8a48ccce3..0d09631f03 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index c14964d2d7..1f1bf371c7 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index c14964d2d7..1f1bf371c7 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index bd220a5013..1217ee49bf 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index 1ed3da4410..1440b6a96b 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -46,6 +46,11 @@ json=$( "name": "Server Time", "value": "$(date)", "inline": true + }, + { + "name": "More info", + "value": "${alerturl}", + "inline": true } EOF ) @@ -63,7 +68,7 @@ EOF ) fi -if [ -n "{alerturl}" ]; then +if [ -n "${alerturl}" ]; then json+=$( cat << EOF , diff --git a/lgsm/modules/alert_email.sh b/lgsm/modules/alert_email.sh index aa13494d12..81c01e25b7 100644 --- a/lgsm/modules/alert_email.sh +++ b/lgsm/modules/alert_email.sh @@ -15,7 +15,7 @@ else mail -s "${alerttitle}" "${email}" < "${alertlog}" fi exitcode=$? -if [ "${exitcode}" -ne 0 ]; then +if [ "${exitcode}" -eq 0 ]; then fn_print_ok_nl "Sending Email alert: ${email}" fn_script_log_pass "Sending Email alert: ${email}" else diff --git a/lgsm/modules/check.sh b/lgsm/modules/check.sh index 59ac2a3294..3922aec215 100644 --- a/lgsm/modules/check.sh +++ b/lgsm/modules/check.sh @@ -31,7 +31,7 @@ if [ "${commandname}" != "INSTALL" ] && [ "${commandname}" != "UPDATE-LGSM" ] && check_system_dir.sh fi -allowed_commands_array=(START DEBUG) +allowed_commands_array=(DEBUG RESTART START) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_executable.sh @@ -39,7 +39,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do done if [ "$(whoami)" != "root" ]; then - allowed_commands_array=(DEBUG START INSTALL) + allowed_commands_array=(DEBUG RESTART START INSTALL) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_glibc.sh @@ -54,21 +54,21 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(BACKUP DEBUG DETAILS START UPDATE) +allowed_commands_array=(BACKUP DEBUG DETAILS RESTART START UPDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_deps.sh fi done -allowed_commands_array=(CONSOLE DEBUG MONITOR START STOP) +allowed_commands_array=(CONSOLE DEBUG MONITOR RESTART START STOP) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_config.sh fi done -allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS START STOP POST-DETAILS) +allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS RESTART START STOP POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ -z "${installflag}" ]; then @@ -77,7 +77,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE) +allowed_commands_array=(DEBUG RESTART START UPDATE VALIDATE CHECK-UPDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ "${appid}" ]; then @@ -86,21 +86,21 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR RESTART START STOP UPDATE VALIDATE POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_status.sh fi done -allowed_commands_array=(DEBUG START INSTALL) +allowed_commands_array=(DEBUG RESTART START INSTALL) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_system_requirements.sh fi done -allowed_commands_array=(DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +allowed_commands_array=(DETAILS MONITOR RESTART START STOP UPDATE VALIDATE POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_gamedig.sh diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index f427e8b008..5892a81eb2 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -13,13 +13,13 @@ fn_firstcommand_set # Trap to remove lockfile on quit. fn_backup_trap() { echo -e "" - echo -en "backup ${backupname}.tar.gz..." + echo -en "backup ${backupname}.${compressext}..." fn_print_canceled_eol_nl - fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED" - rm -f "${backupdir:?}/${backupname}.tar.gz" | tee -a "${lgsmlog}" - echo -en "backup ${backupname}.tar.gz..." + fn_script_log_info "Backup ${backupname}.${compressext}: CANCELED" + rm -f "${backupdir:?}/${backupname}.${compressext}" | tee -a "${lgsmlog}" + echo -en "backup ${backupname}.${compressext}..." fn_print_removed_eol_nl - fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" + fn_script_log_info "Backup ${backupname}.${compressext}: REMOVED" # Remove backup lockfile. rm -f "${lockdir:?}/backup.lock" fn_backup_start_server @@ -110,23 +110,47 @@ fn_backup_create_lockfile() { trap fn_backup_trap INT } +fn_select_compression() { + if command -v zstd > /dev/null 2>&1; then + compressprog="zstd" + compressext="tar.zst" + compressflag="--zstd" + elif command -v pigz > /dev/null 2>&1; then + compressprog="pigz" + compressext="tar.gz" + compressflag="--use-compress-program=pigz" + elif command -v gzip > /dev/null 2>&1; then + compressprog="gzip" + compressext="tar.gz" + compressflag="--gzip" + else + compressprog="" + compressext="tar" + compressflag="" + fi +} + # Compressing files. fn_backup_compression() { - # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue. + fn_print_info "A total of ${rootdirduexbackup} will be compressed." - fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz" - fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress ..." - fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" + fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.${compressext}" + fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.${compressext}, in progress ..." + fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.${compressext}, in progress" excludedir=$(fn_backup_relpath) - # Check that excludedir is a valid path. if [ ! -d "${excludedir}" ]; then fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." fn_script_log_fail "Problem identifying the previous backup directory for exclusion" core_exit.sh fi - tar --use-compress-program=pigz -cf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + if [ -n "${compressflag}" ]; then + tar ${compressflag} -hcf "${backupdir}/${backupname}.${compressext}" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + else + tar -hcf "${backupdir}/${backupname}.${compressext}" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + fi + exitcode=$? if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol @@ -136,8 +160,8 @@ fn_backup_compression() { fn_script_log_fail "Starting backup" else fn_print_ok_eol - fn_print_ok_nl "Completed: ${italic}${backupname}.tar.gz${default}, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" - fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fn_print_ok "Completed: ${italic}${backupname}.${compressext}${default}, total size $(du -sh "${backupdir}/${backupname}.${compressext}" | awk '{print $1}')" + fn_script_log_pass "Backup created: ${backupname}.${compressext}, total size $(du -sh "${backupdir}/${backupname}.${compressext}" | awk '{print $1}')" alert="backup" alert.sh fi @@ -152,7 +176,7 @@ fn_backup_prune() { # How many backups exceed maxbackups. backupquotadiff=$((backupcount - maxbackups)) # How many backups exceed maxbackupdays. - backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}" | wc -l) + backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.*" -mtime +"${maxbackupdays}" | wc -l) # If anything can be cleared. if [ "${backupquotadiff}" -gt "0" ] || [ "${backupsoudatedcount}" -gt "0" ]; then fn_print_dots "Pruning" @@ -167,7 +191,7 @@ fn_backup_prune() { fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" # Clear backups over quota. - find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm + find "${backupdir}"/ -type f -name "*.tar.*" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" # If maxbackupdays is used over maxbackups. @@ -190,7 +214,7 @@ fn_backup_prune() { fn_backup_relpath() { # Written by CedarLUG as a "realpath --relative-to" alternative in bash. # Populate an array of tokens initialized from the rootdir components. - declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) + mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\//\n/g") if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" @@ -198,7 +222,7 @@ fn_backup_relpath() { fi # Populate an array of tokens initialized from the backupdir components. - declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\//\n/g") if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" @@ -243,12 +267,12 @@ fn_backup_start_server() { fn_print_dots "" check.sh core_logs.sh - +fn_select_compression fn_backup_check_lockfile +fn_backup_create_lockfile fn_backup_init fn_backup_stop_server fn_backup_dir -fn_backup_create_lockfile fn_backup_compression fn_backup_prune fn_backup_start_server diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh index ee4c8ccb3b..38f8b4ddc6 100644 --- a/lgsm/modules/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -32,6 +32,8 @@ elif [ "${shortname}" == "vints" ]; then update_vints.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh +elif [ "${shortname}" == "xnt" ]; then + update_xnt.sh else update_steamcmd.sh fi diff --git a/lgsm/modules/command_dev_parse_game_details.sh b/lgsm/modules/command_dev_parse_game_details.sh index 7c0767eea5..893785ff3d 100644 --- a/lgsm/modules/command_dev_parse_game_details.sh +++ b/lgsm/modules/command_dev_parse_game_details.sh @@ -96,6 +96,7 @@ declare -A server_details=( ['RCON Port']="${rconport}" ['RCON Web']="${rconweb}" ['Reserved Slots']="${reservedslots}" + ['Reliable Messaging']="${reliableport}" ['RMI Port']="${rmiport}" ['RMI Reg Port']="${rmiregport}" ['Salt']="${salt}" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index a27850df88..b95ef6c334 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -90,6 +90,12 @@ fn_messages_separator echo -e "Beacon:" fi + if [ -n "${reliableport}" ]; then + echo -e "ReliableMessaging: \t${reliableport} \t$(ss -tupl | grep -c "${reliableport}") \t$(ss -tupl | grep "${reliableport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${reliableport}" | grep udp | awk '{ print $2 }')" + else + echo -e "ReliableMessaging:" + fi + if [ -n "${clientport}" ]; then echo -e "Client: \t${clientport} \t$(ss -tupl | grep -c "${clientport}") \t$(ss -tupl | grep "${clientport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${clientport}" | grep udp | awk '{ print $2 }')" else diff --git a/lgsm/modules/command_fastdl.sh b/lgsm/modules/command_fastdl.sh index e3437bc1f1..3b81654440 100644 --- a/lgsm/modules/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -21,13 +21,6 @@ luasvautorundir="${systemdir}/lua/autorun/server" luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" -# Check if bzip2 is installed. -if [ ! "$(command -v bzip2 2> /dev/null)" ]; then - fn_print_fail "bzip2 is not installed" - fn_script_log_fail "bzip2 is not installed" - core_exit.sh -fi - # Header fn_print_header fn_print_nl "More info: ${italic}https://docs.linuxgsm.com/commands/fastdl" @@ -112,13 +105,13 @@ fn_fastdl_dirs() { # Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 fn_human_readable_file_size() { local abbrevs=( - $((1 << 60)):ZB - $((1 << 50)):EB - $((1 << 40)):TB - $((1 << 30)):GB - $((1 << 20)):MB - $((1 << 10)):KB - $((1)):bytes + "1152921504606846976:ZB" + "1125899906842624:EB" + "1099511627776:TB" + "1073741824:GB" + "1048576:MB" + "1024:KB" + "1:bytes" ) local bytes="${1}" @@ -225,11 +218,17 @@ fn_fastdl_preview() { fn_script_log_fail "Generating file list." core_exit.sh fi - fn_print_nl "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + + if [ "${engine}" == "source" ]; then + echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + elif [ "${engine}" == "goldsrc" ]; then + echo -e "about to copy ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + fi + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" if ! fn_prompt_yn "Continue?" Y; then - fn_script_log "User exited" + exitcode=0 core_exit.sh fi } @@ -431,7 +430,9 @@ fn_fastdl_preview fn_clear_old_fastdl fn_fastdl_dirs fn_fastdl_build -fn_fastdl_bzip2 +if [ "${engine}" == "source" ]; then + fn_fastdl_bzip2 +fi # Finished message. fn_print_nl "Fastdl files are located in:" fn_print_nl "${fastdldir}" diff --git a/lgsm/modules/command_mods_install.sh b/lgsm/modules/command_mods_install.sh index 4401e2c566..e76f3f1fa2 100644 --- a/lgsm/modules/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -88,6 +88,7 @@ if [ -f "${modsinstalledlistfullpath}" ]; then fn_script_log_warn "${modprettyname} is already installed" echo -e " * Any configs may be overwritten." if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 core_exit.sh fi fn_script_log_info "User selected to continue" diff --git a/lgsm/modules/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh index 6dc52d95f6..589046b111 100644 --- a/lgsm/modules/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -47,6 +47,7 @@ done fn_print_warning_nl "You are about to remove ${cyan}${usermodselect}${default}." echo -e " * Any custom files/configuration will be removed." if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 core_exit.sh fi diff --git a/lgsm/modules/command_send.sh b/lgsm/modules/command_send.sh index de021599d3..20ef188e3f 100644 --- a/lgsm/modules/command_send.sh +++ b/lgsm/modules/command_send.sh @@ -30,12 +30,8 @@ if [ "${status}" != "0" ]; then tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER fn_script_log_pass "Command \"${commandtosend}\" sent to console" else - fn_print_error_nl "Server not running" - fn_script_log_error "Failed to access: Server not running" - if fn_prompt_yn "Do you want to start the server?" Y; then - exitbypass=1 - command_start.sh - fi + fn_print_error_nl "Unable to send command to console. Server not running" + fn_script_log_error "Unable to send command to console. Server not running" fi core_exit.sh diff --git a/lgsm/modules/compress_unreal2_maps.sh b/lgsm/modules/compress_unreal2_maps.sh deleted file mode 100644 index 58824cbc73..0000000000 --- a/lgsm/modules/compress_unreal2_maps.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LinuxGSM compress_unreal2_maps.sh module -# Author: Daniel Gibbs -# Contributors: https://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Compresses unreal maps. - -commandname="MAP-COMPRESSOR" -commandaction="Compressing Maps" -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_firstcommand_set - -check.sh -fn_print_header -echo -e "Will compress all maps in:" -echo -e "" -pwd -echo -e "" -echo -e "Compressed maps saved to:" -echo -e "" -echo -e "${compressedmapsdir}" -echo -e "" -if ! fn_prompt_yn "Start compression?" Y; then - exitcode=0 - core_exit.sh -fi -mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${serverfiles:?}/Maps/"*.ut2.uz2 -cd "${systemdir}" || exit -for map in "${serverfiles}/Maps/"*; do - ./ucc-bin compress "${map}" --nohomedir -done -mv -fv "${serverfiles}/Maps/"*.ut2.uz2 "${compressedmapsdir}" - -core_exit.sh diff --git a/lgsm/modules/compress_unreal_maps.sh b/lgsm/modules/compress_unreal_maps.sh new file mode 100644 index 0000000000..6b97e03d97 --- /dev/null +++ b/lgsm/modules/compress_unreal_maps.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# LinuxGSM compress_unreal_maps.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Compresses unreal and unreal2 resources. + +commandname="MAP-COMPRESSOR" +commandaction="Compressing Maps" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header +echo -e "Will compress all maps in:" +echo -e "" +pwd +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" +totalseconds=3 +for seconds in {3..1}; do + fn_print_warn "map compression starting in: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + fn_sleep_time_1 + if [ "${seconds}" == "0" ]; then + break + fi +done +fn_print_nl +mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 + +# List of extensions to compress +exts=(ut2 kfm rom u ucl upl int utx uax ukx usx unr umx umod uzx) + +# Remove old compressed files using find +for ext in "${exts[@]}"; do + mapfile -t oldfiles < <(find "${serverfiles}" -name "*.${ext}.uz2" -type f) + if [ ${#oldfiles[@]} -gt 0 ]; then + echo -e "found ${#oldfiles[@]} old compressed file(s) to remove for extension: ${ext}" + fi + for file in "${oldfiles[@]}"; do + if rm -f "$file"; then + echo -en "removing file [ ${italic}$(basename "$file")${default} ]\c" + fn_print_ok_eol_nl + else + echo -en "removing file [ ${italic}$(basename "$file")${default} ]\c" + fn_print_fail_eol_nl + fi + done +done + +cd "${systemdir}" || exit + +# Find and compress files, then move .uz2 to compressedmapsdir +for ext in "${exts[@]}"; do + # Collect all files with the current extension into an array + mapfile -t files < <(find "${serverfiles}" -name "*.${ext}" -type f) + for file in "${files[@]}"; do + echo -en "compressing file [ ${italic}$(basename "$file") -> $(basename "$file").uz2${default} ]\c" + if ! ./ucc-bin compress "${file}" --nohomedir > /dev/null 2>&1; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + + if ! mv -f "${file}.uz2" "${compressedmapsdir}" > /dev/null 2>&1; then + echo -en "moving compressed file [ ${italic}$(basename "$file").uz2 -> ${compressedmapsdir}/$(basename "$file").uz2${default} ]\c" + fn_print_fail_eol_nl + core_exit.sh + fi + done +done + +fn_print_ok_nl "Compression complete: All compressed files moved to: ${compressedmapsdir}" + +core_exit.sh diff --git a/lgsm/modules/compress_ut99_maps.sh b/lgsm/modules/compress_ut99_maps.sh deleted file mode 100644 index 885c32d9aa..0000000000 --- a/lgsm/modules/compress_ut99_maps.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LinuxGSM compress_ut99_maps.sh module -# Author: Daniel Gibbs -# Contributors: https://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Compresses unreal maps. - -commandname="MAP-COMPRESSOR" -commandaction="Compressing Maps" -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_firstcommand_set - -check.sh -fn_print_header -echo -e "Will compress all maps in:" -echo -e "" -pwd -echo -e "" -echo -e "Compressed maps saved to:" -echo -e "" -echo -e "${compressedmapsdir}" -echo -e "" -if ! fn_prompt_yn "Start compression?" Y; then - exitcode=0 - core_exit.sh -fi -mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${serverfiles:?}/Maps/"*.unr.uz -cd "${systemdir}" || exit -for map in "${serverfiles}/Maps/"*; do - ./ucc-bin compress "${map}" --nohomedir -done -mv -fv "${serverfiles}/Maps/"*.unr.uz "${compressedmapsdir}" - -core_exit.sh diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index 5f55dfcd1b..1dd6e2f460 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -13,8 +13,8 @@ fn_exit_dev_debug() { echo -e "${moduleselfname} exiting with code: ${exitcode}" if [ -f "${rootdir}/dev-debug.log" ]; then grep -a "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" - elif [ -f "${lgsmlogdir}/dev-debug.log" ]; then - grep -a "modulefile=" "${lgsmlogdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" + elif [ -f "${logdir}/dev-debug.log" ]; then + grep -a "modulefile=" "${logdir}/dev-debug.log" | sed 's/modulefile=//g' > "${logdir}/dev-debug-module-order.log" fi fi } diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index 9a5704663e..295f9900ba 100644 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -42,8 +42,7 @@ cmd_change_password=("pw;change-password" "command_ts3_server_pass.sh" "Change T cmd_install_default_resources=("ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources.") cmd_fullwipe=("fw;full-wipe;wa;wipeall" "serverwipe=1; command_wipe.sh" "Reset the map and remove blueprint data.") cmd_mapwipe=("mw;map-wipe;w;wipe;wi" "mapwipe=1; command_wipe.sh" "Reset the map and keep blueprint data.") -cmd_map_compressor_u99=("mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps.") -cmd_map_compressor_u2=("mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps.") +cmd_map_compressor_unreal=("mc;map-compressor" "compress_unreal_maps.sh" "Compresses all ${gamename} server maps.") cmd_install_cdkey=("cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key.") cmd_install_dst_token=("ct;cluster-token" "install_dst_token.sh" "Configure cluster token.") cmd_install_squad_license=("li;license" "install_squad_license.sh" "Add your Squad server license.") @@ -96,7 +95,7 @@ fi ## Game server exclusive commands. # FastDL command. -if [ "${engine}" == "source" ]; then +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then currentopt+=("${cmd_fastdl[@]}") fi @@ -113,13 +112,13 @@ fi # Unreal exclusive. if [ "${engine}" == "unreal2" ]; then if [ "${shortname}" == "ut2k4" ]; then - currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}") + currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_unreal[@]}") else - currentopt+=("${cmd_map_compressor_u2[@]}") + currentopt+=("${cmd_map_compressor_unreal[@]}") fi fi if [ "${engine}" == "unreal" ]; then - currentopt+=("${cmd_map_compressor_u99[@]}") + currentopt+=("${cmd_map_compressor_unreal[@]}") fi # DST exclusive. diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index e5e6d1e5d6..e5dd2cf31b 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.6" +modulesversion="v25.2.0" # Core @@ -275,11 +275,6 @@ compress_unreal2_maps.sh() { fn_fetch_module } -compress_ut99_maps.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - # Mods mods_list.sh() { diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh index 67a9fd5dfb..a986edf1f3 100644 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -252,11 +252,11 @@ if [ -d "${backupdir}" ]; then backupcount=0 # If there are backups in backup dir. - if [ "$(find "${backupdir}" -name "*.tar.gz" | wc -l)" -ne "0" ]; then + if [ "$(find "${backupdir}" -name "*.tar.*" | wc -l)" -ne "0" ]; then # number of backups. - backupcount="$(find "${backupdir}"/*.tar.gz | wc -l)" # integer + backupcount="$(find "${backupdir}"/*.tar.* | wc -l)" # integer # most recent backup. - lastbackup="$(ls -1t "${backupdir}"/*.tar.gz | head -1)" # string + lastbackup="$(ls -1t "${backupdir}"/*.tar.* | head -1)" # string # date of most recent backup. lastbackupdate="$(date -r "${lastbackup}")" # string # no of days since last backup. diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 2819b65d1c..0b43ba6261 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1993,6 +1993,7 @@ fn_info_game_sf() { port="${port:-"0"}" queryport="${queryport:-"0"}" beaconport="${beaconport:-"0"}" + reliableport="${reliableport:-"0"}" } # Config Type: Parameters (with an ini) diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 4f1f002680..cff7467b10 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1502,6 +1502,7 @@ fn_info_messages_sf() { fn_port "Game" port udp fn_port "Query" queryport udp fn_port "Beacon" beaconport udp + fn_port "ReliableMessaging" reliableport tcp } | column -s $'\t' -t } diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index db6b1e5cfe..b73e7b4b26 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -289,7 +289,6 @@ elif [ "${shortname}" == "bt" ]; then elif [ "${shortname}" == "btl" ]; then fn_check_cfgdir array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -370,7 +369,6 @@ elif [ "${shortname}" == "cs" ]; then fn_list_config_locations elif [ "${shortname}" == "cs2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -483,7 +481,6 @@ elif [ "${shortname}" == "hldms" ]; then fn_list_config_locations elif [ "${shortname}" == "ohd" ]; then array_configs+=(Admins.cfg Engine.ini Game.ini MapCycle.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -585,7 +582,6 @@ elif [ "${shortname}" == "pvkii" ]; then fn_list_config_locations elif [ "${shortname}" == "pw" ]; then array_configs+=(PalWorldSettings.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -614,13 +610,11 @@ elif [ "${shortname}" == "q2" ]; then fn_list_config_locations elif [ "${shortname}" == "q3" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "q4" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -783,8 +777,8 @@ elif [ "${shortname}" == "wmc" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "xnt" ]; then + fix_xnt.sh array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations diff --git a/lgsm/modules/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh index 2829da8d64..963a52f10c 100644 --- a/lgsm/modules/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -27,3 +27,4 @@ else echo -e "./${selfname} server-cd-key" fi echo -e "" +core_exit.sh diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh index f6f8301bd0..bbefc5ea26 100644 --- a/lgsm/modules/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -55,13 +55,13 @@ amxxtslatestfile="amxmodx-${amxxtsversion}-${amxxtsmod}-linux.tar.gz" amxxtsdownloadurl="https://www.amxmodx.org/release/${amxxtslatestfile}" amxxtsurl="${amxxtsdownloadurl}" # Metamod:Source -metamodsourceversion="1.11" +metamodsourceversion="1.12" metamodsourcescrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodsourceversion}/mmsource-latest-linux" metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -) metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}" metamodsourceurl="${metamodsourcedownloadurl}" # Sourcemod -sourcemodversion="1.11" +sourcemodversion="1.13" sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodversion}/sourcemod-latest-linux" sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -) sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodversion}" diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 4021af11a8..a300b87eb9 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -39,8 +39,10 @@ fn_update_remotebuild() { remotebuildresponse=$(curl -s "${apiurl}") if [ "${branch}" == "stable" ]; then remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) - else + elif [ "${branch}" == "unstable" ]; then remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) + else + remotebuildversion="${branch}" fi remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.filename') remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.urls.cdn') diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index f043a4227a..c00233aa7b 100644 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -1,9 +1,9 @@ #!/bin/bash -# LinuxGSM command_ut99.sh module +# LinuxGSM command_xnt.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Handles updating of Unreal Tournament 99 servers. +# Description: Handles updating of Xontic servers. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -17,10 +17,21 @@ fn_update_dl() { fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - + check_status.sh # Send version command to Xonotic server. - tmux -L "${socketname}" send-keys -t "${sessionname}" "version\r" > /dev/null 2>&1 - fn_sleep_time_1 + if [ "${status}" != "0" ]; then + tmux -L "${socketname}" send-keys -t "${sessionname}" "version" C-m > /dev/null 2>&1 + fn_sleep_time_1 + else + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + fn_sleep_time_5 + tmux -L "${socketname}" send-keys -t "${sessionname}" "version" C-m > /dev/null 2>&1 + command_stop.sh + fn_firstcommand_reset + fi # Uses log file to get local build. localbuild=$(grep "SVQC version: xonotic-v" "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*SVQC version: \(xonotic-v[0-9.]*\).*/\1/' | tr -d '\000-\011\013-\037') diff --git a/linuxgsm.sh b/linuxgsm.sh index 6d6f7251f0..997bc30c8a 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.6" +version="v25.2.0" shortname="core" gameservername="core" commandname="CORE" @@ -32,7 +32,8 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") lgsmdir="${rootdir}/lgsm" [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" -lgsmlogdir="${logdir}/lgsm" +lgsmlogdir="${logdir}/script" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" steamcmddir="${HOME}/.steam/steamcmd" [ -n "${LGSM_SERVERFILES}" ] && serverfiles="${LGSM_SERVERFILES}" || serverfiles="${rootdir}/serverfiles" modulesdir="${lgsmdir}/modules"