Compare commits

..

1 Commits

Author SHA1 Message Date
DeaTh-G 460bc583a5 Respect update check timeout without the same session too 2026-02-01 19:35:54 +01:00
6 changed files with 12 additions and 58 deletions
+3 -6
View File
@@ -160,9 +160,6 @@ jobs:
build-flatpak: build-flatpak:
name: Build Flatpak name: Build Flatpak
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
strategy:
matrix:
preset: ["Flatpak-Debug", "Flatpak-Release"]
env: env:
FLATPAK_ID: io.github.hedge_dev.unleashedrecomp FLATPAK_ID: io.github.hedge_dev.unleashedrecomp
@@ -188,7 +185,7 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: /tmp/ccache path: /tmp/ccache
key: ccache-${{ runner.os }}-${{ matrix.preset }} key: ccache-${{ runner.os }}
- name: Prepare Project - name: Prepare Project
run: cp ./private/* ./UnleashedRecompLib/private run: cp ./private/* ./UnleashedRecompLib/private
@@ -201,13 +198,13 @@ jobs:
run: | run: |
echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_ENV echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_ENV
export CCACHE_DIR=/tmp/ccache export CCACHE_DIR=/tmp/ccache
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}-${{ matrix.preset }}.json flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}.json
flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: UnleashedRecomp-${{ matrix.preset }} name: UnleashedRecomp-Flatpak
path: ./${{ env.FLATPAK_ID }}.flatpak path: ./${{ env.FLATPAK_ID }}.flatpak
build-macos: build-macos:
name: Build macOS name: Build macOS
+3
View File
@@ -1,5 +1,8 @@
#pragma once #pragma once
// 6 hour long timeout between checks.
static constexpr double g_timeBetweenUpdateChecksInSeconds = 6 * 60 * 60;
struct UpdateChecker struct UpdateChecker
{ {
enum class Result enum class Result
+3 -3
View File
@@ -307,11 +307,11 @@ int main(int argc, char *argv[])
} }
#endif #endif
// Check the time since the last time an update was checked. Store the new time if the difference is more than six hours. // Check the time since the last time an update was checked.
constexpr double TimeBetweenUpdateChecksInSeconds = 6 * 60 * 60; // Store the new time if the difference is more than g_timeBetweenUpdateChecksInSeconds hours.
time_t timeNow = std::time(nullptr); time_t timeNow = std::time(nullptr);
double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked); double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked);
if (timeDifferenceSeconds > TimeBetweenUpdateChecksInSeconds) if (timeDifferenceSeconds > g_timeBetweenUpdateChecksInSeconds)
{ {
UpdateChecker::initialize(); UpdateChecker::initialize();
UpdateChecker::start(); UpdateChecker::start();
@@ -129,7 +129,9 @@ PPC_FUNC(sub_822C55B0)
void PressStartSaveLoadThreadMidAsmHook() void PressStartSaveLoadThreadMidAsmHook()
{ {
if (UpdateChecker::check() == UpdateChecker::Result::UpdateAvailable) time_t timeNow = std::time(nullptr);
double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked);
if (UpdateChecker::check() == UpdateChecker::Result::UpdateAvailable && timeDifferenceSeconds > g_timeBetweenUpdateChecksInSeconds)
{ {
g_updateAvailableMessageOpen = true; g_updateAvailableMessageOpen = true;
g_updateAvailableMessageOpen.wait(true); g_updateAvailableMessageOpen.wait(true);
@@ -1,48 +0,0 @@
{
"id": "io.github.hedge_dev.unleashedrecomp",
"runtime": "org.freedesktop.Platform",
"runtime-version": "24.08",
"sdk": "org.freedesktop.Sdk",
"sdk-extensions" : [ "org.freedesktop.Sdk.Extension.llvm18" ],
"finish-args": [
"--share=network",
"--socket=wayland",
"--socket=fallback-x11",
"--socket=pulseaudio",
"--device=all",
"--filesystem=host",
"--filesystem=/media",
"--filesystem=/run/media",
"--filesystem=/mnt"
],
"modules": [
{
"name": "UnleashedRecomp",
"buildsystem": "simple",
"build-commands": [
"cmake --preset linux-debug -DUNLEASHED_RECOMP_FLATPAK=ON -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache",
"cmake --build out/build/linux-debug --target UnleashedRecomp",
"mkdir -p /app/bin",
"cp out/build/linux-debug/UnleashedRecomp/UnleashedRecomp /app/bin/UnleashedRecomp",
"install -Dm644 UnleashedRecompResources/images/game_icon.png /app/share/icons/hicolor/128x128/apps/${FLATPAK_ID}.png",
"install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml",
"install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.desktop /app/share/applications/${FLATPAK_ID}.desktop"
],
"sources": [
{
"type": "dir",
"path": "../"
}
],
"build-options": {
"no-debuginfo": true,
"strip": false,
"append-path": "/usr/lib/sdk/llvm18/bin",
"prepend-ld-library-path": "/usr/lib/sdk/llvm18/lib",
"build-args": [
"--share=network"
]
}
}
]
}