diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index ace1b8883..ea72716de 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -56,14 +56,20 @@ jobs: with: path: ${{github.workspace}}/artifacts + - name: Set padded run number + run: | + $paddedRunNumber = "{0:D5}" -f ${{ github.run_number }} + echo "RUN_NUMBER=$paddedRunNumber" >> $env:GITHUB_ENV + shell: powershell + - name: Create Release uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 with: repo: REFramework-nightly owner: praydog token: ${{ secrets.REPO_TOKEN }} - name: ${{format('REF Nightly {0} ({1})', github.run_number, github.sha)}} - tag: ${{format('nightly-{0}-{1}', github.run_number, github.sha)}} + name: ${{format('REF Nightly {0} ({1})', env.RUN_NUMBER, github.sha)}} + tag: ${{format('nightly-{0}-{1}', env.RUN_NUMBER, github.sha)}} artifacts: ${{github.workspace}}/artifacts/**/*.zip makeLatest: true bodyFile: ${{github.workspace}}/nightly-body.md diff --git a/shared/sdk/SF6Utility.hpp b/shared/sdk/SF6Utility.hpp index 02555458b..adde91a87 100644 --- a/shared/sdk/SF6Utility.hpp +++ b/shared/sdk/SF6Utility.hpp @@ -28,8 +28,11 @@ enum class EGameMode : uint8_t { ONLINE_TRAINING = 18, TEAMBATTLE = 19, EXAM_CPU_MATCH = 20, - REPLAY = 21, - SPECTATE = 22, + CABINET_CPU_MATCH = 21, + LEARNING_AI_MATCH = 22, + LEARNING_AI_SPECTATE = 23, + REPLAY = 24, + SPECTATE = 25, }; enum class HUD_GROUP_TYPE : uint8_t { diff --git a/src/mods/LooseFileLoader.cpp b/src/mods/LooseFileLoader.cpp index 5f67f39a8..06c199087 100644 --- a/src/mods/LooseFileLoader.cpp +++ b/src/mods/LooseFileLoader.cpp @@ -224,21 +224,30 @@ bool LooseFileLoader::handle_path(const wchar_t* path, size_t hash) { bool exists_on_disk{false}; if (m_enable_file_cache) { + // Intended to get rid of mutex usage which can be a bottleneck + static thread_local std::unordered_set files_on_disk_local{}; + static thread_local std::unordered_set seen_files_local{}; + { - std::shared_lock _{m_files_on_disk_mutex}; - exists_on_disk = m_files_on_disk.contains(hash); - exists_in_cache = exists_on_disk || m_seen_files.contains(hash); + // No need to lock a mutex as these are thread_local + exists_on_disk = files_on_disk_local.contains(hash); + exists_in_cache = exists_on_disk || seen_files_local.contains(hash); } if (!exists_in_cache) { + // TODO: refine this with mixed shared and unique locks + // This shouldnt be a huge performance issue for now std::unique_lock _{m_files_on_disk_mutex}; - if (std::filesystem::exists(path)) { - m_files_on_disk.insert(hash); + // Purpose of this is to only hit the disk once per unique file + if (m_files_on_disk.contains(hash) || std::filesystem::exists(path)) { + m_files_on_disk.insert(hash); // Global + files_on_disk_local.insert(hash); // Thread local exists_on_disk = true; } - m_seen_files.insert(hash); + m_seen_files.insert(hash); // Global + seen_files_local.insert(hash); // Thread local ++m_uncached_hits; } else { ++m_cache_hits; diff --git a/src/mods/ScriptRunner.cpp b/src/mods/ScriptRunner.cpp index 186224d3d..99f4f38d2 100644 --- a/src/mods/ScriptRunner.cpp +++ b/src/mods/ScriptRunner.cpp @@ -783,6 +783,8 @@ void ScriptRunner::on_config_save(utility::Config& cfg) { } void ScriptRunner::hook_battle_rule() { + // Removed for now as it seems to cause some weird issues with matchmaking +#if 0 if (m_attempted_hook_battle_rule) { return; } @@ -828,6 +830,7 @@ void ScriptRunner::hook_battle_rule() { return HookManager::PreHookResult::CALL_ORIGINAL; }, [this](uintptr_t& ret_val, sdk::RETypeDefinition* ret_ty, uintptr_t ret_addr) -> void { + // DONT set this, it probably breaks something now auto bt = this->get_last_battle_type(); if (bt.has_value()) { @@ -835,6 +838,7 @@ void ScriptRunner::hook_battle_rule() { } }); } +#endif } void ScriptRunner::on_frame() {