diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 160a7a8..45de8d4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest outputs: COMMIT_SHA: ${{ steps.declare_sha.outputs.COMMIT_SHA }} - SEMVER: ${{ steps.declare_sha.outputs.SEMVER }} + SEMVER_PATCH: ${{ steps.declare_sha.outputs.SEMVER }} steps: - name: Checkout uses: actions/checkout@v4.1.1 @@ -41,7 +41,7 @@ jobs: run: | SHA=$(git rev-parse --short HEAD) echo "COMMIT_SHA=$SHA" >> $GITHUB_OUTPUT - echo "SEMVER=${{ steps.semver_parser.outputs.fullversion }}" >> $GITHUB_OUTPUT + echo "SEMVER_PATCH=${{ steps.semver_parser.outputs.patch }}.${{ steps.semver_parser.outputs.prerelease }}" >> $GITHUB_OUTPUT - name: Setup latest ReAPI includes env: @@ -68,14 +68,14 @@ jobs: github.event.action == 'published' && startsWith(github.ref, 'refs/tags/') env: - PLUGIN_VERSION: "${{ steps.declare_sha.outputs.SEMVER }}" - run: sed -i "s|%VERSION%|$PLUGIN_VERSION|g" redm_version.inc + PLUGIN_VERSION: "${{ steps.declare_sha.outputs.SEMVER_PATCH }}" + run: sed -i "s|manual|$PLUGIN_VERSION|g" redm_version.inc - name: Update versions for plugins (only for artifacts builds) working-directory: cstrike/addons/amxmodx/scripting/include/ env: PLUGIN_VERSION: "${{ steps.declare_sha.outputs.COMMIT_SHA }}" - run: sed -i "s|%VERSION%|$PLUGIN_VERSION|g" redm_version.inc + run: sed -i "s|manual|$PLUGIN_VERSION|g" redm_version.inc - name: Setup AMXXPawn Compiler uses: wopox1337/setup-amxxpawn@v1.1.0 @@ -130,7 +130,7 @@ jobs: - name: Packaging binaries id: packaging - run: 7z a -mm=Deflate -mfb=258 -mpass=15 -r ReDeathmatch-${{ needs.build.outputs.SEMVER }}.zip cstrike/ + run: 7z a -mm=Deflate -mfb=258 -mpass=15 -r ReDeathmatch-${{ needs.build.outputs.SEMVER_PATCH }}.zip cstrike/ - name: Publish artifacts uses: softprops/action-gh-release@v2.0.4 diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma b/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma index 7e2f448..f6df36f 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma @@ -62,7 +62,7 @@ public plugin_init() { register_concmd("redm_enable", "ConCmd_redm_enable", ADMIN_MAP, "Enables Re:DM.") register_concmd("redm_disable", "ConCmd_redm_disable", ADMIN_MAP, "Disables Re:DM.") register_concmd("redm_status", "ConCmd_redm_status", ADMIN_MAP, "Get Re:DM status.") - register_concmd("redm", "ConCmd_redm", ADMIN_ALL, "Get info.", .FlagManager = false) + register_concmd("redm", "ConCmd_redm", ADMIN_MAP, "Get info.", .FlagManager = false) ApiInit_Forwards() } @@ -210,7 +210,15 @@ public ConCmd_redm(const player, const level, const commandId) { console_print(player, "[Re:DM] Version `%s`", REDM_VERSION) console_print(player, "[Re:DM] https://github.com/wopox1337/ReDeathmatch") - console_print(player, "[Re:DM] Copyright (c) 2023 Sergey Shorokhov", REDM_VERSION) + console_print(player, "[Re:DM] Copyright (c) 2024 Sergey Shorokhov") + + if (!cmd_access(player, level, commandId, 1, .accesssilent = true)) + return PLUGIN_HANDLED + + console_print(player, "Compilation info:") + console_print(player, " AMXX version: `%s`", AMXX_VERSION_STR) + console_print(player, " ReAPI version: `%i.%i`", REAPI_VERSION_MAJOR, REAPI_VERSION_MINOR) + console_print(player, " Time: `%s %s`", __DATE__, __TIME__) return PLUGIN_HANDLED } diff --git a/cstrike/addons/amxmodx/scripting/include/redm_version.inc b/cstrike/addons/amxmodx/scripting/include/redm_version.inc index f235ed1..13c171f 100644 --- a/cstrike/addons/amxmodx/scripting/include/redm_version.inc +++ b/cstrike/addons/amxmodx/scripting/include/redm_version.inc @@ -4,4 +4,8 @@ #define _redm_version_included // redm version -new const REDM_VERSION[] = "%VERSION%" +#define REDM_VERSION_MAJOR 1 +#define REDM_VERSION_MINOR 0 +#define REDM_VERSION_PATCH "manual" + +#define REDM_VERSION fmt("%i.%i." + REDM_VERSION_PATCH, REDM_VERSION_MAJOR, REDM_VERSION_MINOR)