Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
ramblings
Browse files Browse the repository at this point in the history
  • Loading branch information
axstin committed Sep 4, 2023
1 parent d841a93 commit 07f0d41
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
30 changes: 24 additions & 6 deletions Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,18 +654,36 @@ class RobloxInstance
}

void OnEvent(uint32_t ev_flags)
{
{
// todo: redesign the event/flag writing/blah code (again) (maybe)
// dealing with initiation, one or multiple setting changes, unlocks, and exits on both attached processes and registry instances whilst
// making sure it prompts the user correctly is a fun task
// 1. any user input that triggers a flag write (loading settings from disk, setting change in UI, app init) should notify the user if the version being written to has a process running AND the flag values have changed
// 2. ideally, a flag file is not read or written to more than once per version per event
// 3. flags should only be reverted if "Unlock Client/Studio" is toggled off or the user exits the app
// 4. note UnlockMethod setting, which can change whether a process needs to be attached, detached, or reattached as well as trigger flag changes

// a separate todo:
// there are obvious problems with attaching to Hyperion processes
// right now RFU has an okay success rate but it has a lot to do with attach timing and changes with OS (win 10 vs win 11)
// reattaches via settings changes or relaunches of RFU will lead to crashes as well
// consider removing the ability to attach to Hyperion clients, or hide it from the UI
// or... double down and implement more special code to circumvent Hyperion (fun, but not a good idea)
// or... convince Roblox to add fps cap and vsync settings to the graphics menu :-D

if (ev_flags & RFU::Event::CLOSE_MASK)
{
printf("[%u] Closing instance (IsRegistryInstance=%u, RevertFlagsOnClose=%u)\n", process.id, IsRegistryInstance(), Settings::RevertFlagsOnClose);

// revert flags if process isn't dead
if (ev_flags != RFU::Event::PROCESS_DIED && Settings::RevertFlagsOnClose)
if (ev_flags != RFU::Event::PROCESS_DIED)
{
RobloxFFlags(version_folder).set_target_fps(std::nullopt).set_alt_enter_flag(std::nullopt).apply(ev_flags != RFU::Event::APP_EXIT && !IsRegistryInstance());
// revert flags if process isn't dead
if (Settings::RevertFlagsOnClose)
{
RobloxFFlags(version_folder).set_target_fps(std::nullopt).set_alt_enter_flag(std::nullopt).apply(ev_flags != RFU::Event::APP_EXIT && !IsRegistryInstance());
}
SetFPSCapInMemory(60.0);
}

SetFPSCapInMemory(60.0);
}
else if (ev_flags & RFU::Event::SETTINGS_MASK)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/rfu.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <cstdint>

#define RFU_VERSION "5.0"
#define RFU_VERSION "5.1"
#define RFU_GITHUB_REPO "axstin/rbxfpsunlocker"

namespace RFU
Expand Down

0 comments on commit 07f0d41

Please sign in to comment.