From 9f89ec12d50e7dead4d95d0fcacecf2bf4e3155a Mon Sep 17 00:00:00 2001 From: IndigoFox Date: Tue, 13 Feb 2024 23:13:23 -0800 Subject: [PATCH 1/2] moves empty group cleanup run on all machines to perf module --- framework/CfgFunctions.hpp | 4 ++-- framework/client/functions/fn_initClient.sqf | 1 - .../functions/fn_addCBASettings.sqf | 22 +++++++++++++++++++ .../functions/fn_addEmptyGroupCleanupPFH.sqf} | 11 +++++----- 4 files changed, 30 insertions(+), 8 deletions(-) rename framework/{client/functions/fn_bindEmptyGroupGarbageCleanup.sqf => performance/functions/fn_addEmptyGroupCleanupPFH.sqf} (71%) diff --git a/framework/CfgFunctions.hpp b/framework/CfgFunctions.hpp index 48fee2b..978abca 100644 --- a/framework/CfgFunctions.hpp +++ b/framework/CfgFunctions.hpp @@ -26,7 +26,6 @@ class DOUBLES(PREFIX,client) { class initClient {}; class addMicroDAGRWaypoints {}; class addZenModules {}; - class bindEmptyGroupGarbageCleanup {}; class bindEventHandlers {}; class bindVehicleActions {}; }; @@ -106,13 +105,14 @@ class DOUBLES(PREFIX,performance) { class functions { file = "framework\performance\functions"; class addCBASettings {preInit=1;}; - class addDNI_PlayerFPS { postInit = 1; }; + class addDNI_PlayerFPS {postInit = 1;}; // PFHs managed in addCBASettings onChange code class addClientStatsPFH {}; class calculateClientStats {}; class addServerStatsPFH {}; class calculateServerStats {}; + class addEmptyGroupCleanupPFH {}; }; }; diff --git a/framework/client/functions/fn_initClient.sqf b/framework/client/functions/fn_initClient.sqf index f3d8fac..1d5e7bb 100644 --- a/framework/client/functions/fn_initClient.sqf +++ b/framework/client/functions/fn_initClient.sqf @@ -5,7 +5,6 @@ if (!hasInterface) exitWith {}; call FUNC(addMicroDAGRWaypoints); call FUNC(addZenModules); -call FUNC(bindEmptyGroupGarbageCleanup); call FUNC(bindEventHandlers); call FUNC(bindVehicleActions); diff --git a/framework/performance/functions/fn_addCBASettings.sqf b/framework/performance/functions/fn_addCBASettings.sqf index 405e72c..947c1cb 100644 --- a/framework/performance/functions/fn_addCBASettings.sqf +++ b/framework/performance/functions/fn_addCBASettings.sqf @@ -1,5 +1,27 @@ #include "..\script_component.hpp" +[ + QGVAR(emptyGroupCleanup_enable), + "CHECKBOX", + "Empty Group Cleanup Enabled", + [QUOTE(SETTINGS_GROUP_NAME), QUOTE(COMPONENT_BEAUTIFIED)], + true, + true, + { + params ["_value"]; + [ + QGVAR(emptyGroupCleanup_enable), + _value + ] call EFUNC(common,logSettingChanged); + + if (!isNull (missionNamespace getVariable [QGVAR(emptyGroupCleanupPFH), locationNull])) then { + deleteLocation GVAR(emptyGroupCleanupPFH); + }; + + call FUNC(addEmptyGroupCleanupPFH); + } +] call CBA_fnc_addSetting; + //--------------------- // Server CPS //--------------------- diff --git a/framework/client/functions/fn_bindEmptyGroupGarbageCleanup.sqf b/framework/performance/functions/fn_addEmptyGroupCleanupPFH.sqf similarity index 71% rename from framework/client/functions/fn_bindEmptyGroupGarbageCleanup.sqf rename to framework/performance/functions/fn_addEmptyGroupCleanupPFH.sqf index 4833821..6dc4a90 100644 --- a/framework/client/functions/fn_bindEmptyGroupGarbageCleanup.sqf +++ b/framework/performance/functions/fn_addEmptyGroupCleanupPFH.sqf @@ -7,7 +7,7 @@ [] ] call EFUNC(common,log); -_emptyGroupPFH = [ +GVAR(emptyGroupCleanupPFH) = [ { { if (local _x) then { @@ -19,7 +19,7 @@ _emptyGroupPFH = [ }, 300, [], - { + { // on creation [ LEVEL_INFO, QUOTE(COMPONENT), @@ -27,15 +27,16 @@ _emptyGroupPFH = [ [] ] call EFUNC(common,log); }, - { [ + { // on deletion + [ LEVEL_INFO, QUOTE(COMPONENT), "Empty group deletion PFH unloaded", [] ] call EFUNC(common,log); }, - { true }, - { false }, + { (missionNamespace getVariable [QGVAR(emptyGroupCleanup_enable), false]) }, + { not (missionNamespace getVariable [QGVAR(emptyGroupCleanup_enable), false]) }, [] ] call CBA_fnc_createPerFrameHandlerObject; From aaad8675a66449a196737e563d41cc5be01b804c Mon Sep 17 00:00:00 2001 From: hizumi <> Date: Wed, 14 Feb 2024 01:56:04 -0600 Subject: [PATCH 2/2] Create create-testing-snapshot.yaml move testing workflow to develop branch --- .gitea/workflows/create-testing-snapshot.yaml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .gitea/workflows/create-testing-snapshot.yaml diff --git a/.gitea/workflows/create-testing-snapshot.yaml b/.gitea/workflows/create-testing-snapshot.yaml new file mode 100644 index 0000000..97ab172 --- /dev/null +++ b/.gitea/workflows/create-testing-snapshot.yaml @@ -0,0 +1,62 @@ +name: Generate testing snapshot +on: + push: + branches: [develop] + +jobs: + Clean: + name: Create testing release + runs-on: windows + steps: + - name: Diagnostics + run: | + echo "repository: ${{ gitea.repository }}" + echo "ref: ${{ gitea.ref }}" + echo "ref_name: ${{ gitea.ref_name }}" + echo "api_url: ${{ gitea.api_url }}" + echo "workflow: ${{ gitea.workflow }}" + + - name: Checkout framework + uses: actions/checkout@v3 + with: + path: MissionFramework + + - name: Clean framework + run: | + Remove-Item -Recurse MissionFramework\aaFrameworkUtils + Remove-Item -Recurse MissionFramework\framework\x + Remove-Item -Recurse MissionFramework\.git* + + - name: Backup artifacts from runner + uses: actions/upload-artifact@v3 + with: + name: framework-test-snapshot + path: MissionFramework + + - name: Create archive + run: Compress-Archive MissionFramework framework-test-snapshot.zip + + - name: Delete old testing-release release + run: | + $headers = @{ + "accept" = "application/json" + "Authorization" = "token ${{secrets.RELEASE_TOKEN}}" + } + Invoke-WebRequest -Uri "${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases/tags/testing-release" -Method Delete -Headers $headers + + - name: Delete old testing-release tag + run: | + $headers = @{ + "accept" = "application/json" + "Authorization" = "token ${{secrets.RELEASE_TOKEN}}" + } + Invoke-WebRequest -Uri "${{ gitea.api_url }}/repos/${{ gitea.repository }}/tags/testing-release" -Method Delete -Headers $headers + + - name: Create new testing-release + uses: https://gitea.com/actions/gitea-release-action@v1.1.6 + with: + tag_name: 'testing-release' + name: 'testing-release' + prerelease: true + files: |- + framework-test-snapshot.zip