Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/core/github/gitmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ namespace YLP
script.isDisabled = false;
script.isInstalled = false;
script.currentPath = "";
script.lastChecked = std::chrono::system_clock::time_point{};

script.lastChecked = {};
should_update_cache = true;
}

Expand Down Expand Up @@ -224,6 +223,8 @@ namespace YLP

m_RepoETag = response.eTag;
std::map<std::string, Repository> newRepos;
std::map<std::string, Repository> oldRepos = m_Repos;

for (auto& repo : j)
{
std::string name = repo["name"];
Expand All @@ -245,12 +246,16 @@ namespace YLP
std::filesystem::path enabledPath = m_ScriptsPath / name;
std::filesystem::path disabledPath = m_ScriptsPath / "disabled" / name;
script.isDisabled = IO::Exists(disabledPath) && IO::HasLuaFiles(disabledPath) && !IO::Exists(enabledPath);

if (auto it = oldRepos.find(name); it != oldRepos.end())
script.lastChecked = it->second.lastChecked;

script.isPendingUpdate = script.is_outdated();
script.currentPath = "";

if (script.isInstalled)
{
script.currentPath = script.isDisabled ? disabledPath : enabledPath;
script.lastChecked = m_Repos[name].lastChecked;
}

newRepos[name] = script;
Expand Down Expand Up @@ -279,7 +284,6 @@ namespace YLP
try
{
FetchRepositories();
SaveCache();
m_State = eLoadState::READY;
}
catch (const std::exception& e)
Expand Down Expand Up @@ -456,8 +460,9 @@ namespace YLP
repo.downloadProgress = 0.f;
repo.isDownloading = false;
repo.isInstalled = true;
repo.lastChecked = std::chrono::system_clock::now();
repo.currentPath = m_ScriptsPath / name;
repo.lastChecked = std::chrono::system_clock::now();
repo.isPendingUpdate = repo.is_outdated();
}

SaveCache();
Expand Down
5 changes: 4 additions & 1 deletion src/core/github/repository.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// YLP Project - GPL-3.0
// YLP Project - GPL-3.0
// See LICENSE file or <https://www.gnu.org/licenses/> for details.


Expand Down Expand Up @@ -27,6 +27,9 @@ namespace YLP

bool is_outdated() const
{
if (!isInstalled)
return false;

if (lastChecked.time_since_epoch().count() == 0)
return false;

Expand Down
7 changes: 5 additions & 2 deletions src/core/memory/procmon.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2025 SAMURAI (xesdoog) & Contributors
// Copyright (C) 2025 SAMURAI (xesdoog) & Contributors
// This file is part of YLP.
//
// YLP is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -104,6 +104,9 @@ namespace YLP
if (!IsWindow(hwnd))
return false;

if (!m_Scanner->IsModuleLoaded("socialclub.dll"))
return false;

std::this_thread::sleep_for(2s);
return true;
},
Expand Down Expand Up @@ -298,7 +301,7 @@ namespace YLP

auto& pointers = (m_MonitorMode == MonitorLegacy) ? g_Pointers.Legacy : g_Pointers.Enhanced;
pointers.Reset();
std::this_thread::sleep_for(5s);
std::this_thread::sleep_for(20s);
}
}
}
Expand Down