Skip to content

Commit

Permalink
解决被视为错误的警告
Browse files Browse the repository at this point in the history
  • Loading branch information
RERASER committed Sep 19, 2024
1 parent a28db4f commit accd8af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions src/client/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,29 +148,29 @@ namespace game
return get_reg_value("ResourceDir");
}

static std::filesystem::path get_install_path(launcher::game game_type)
std::filesystem::path get_install_path(launcher::game game_type)
{
return get_reg_value(game_type, "InstallDir");
}

static std::filesystem::path get_resource_path(launcher::game game_type)
std::filesystem::path get_resource_path(launcher::game game_type)
{
return get_reg_value(game_type, "ResourceDir");
}


void gamemeta::ensure_created(launcher::game game_type)
void gamemeta::ensure_created(launcher::game gametype)
{
if (inited)
{
return;
}
this->game_type = game_type;
this->game_type = gametype;
try
{
install_path = game::environment::get_install_path(game_type);
resource_path = game::environment::get_resource_path(game_type);
switch (game_type)
install_path = game::environment::get_install_path(gametype);
resource_path = game::environment::get_resource_path(gametype);
switch (gametype)
{
case launcher::game::iidx:
{
Expand Down
10 changes: 5 additions & 5 deletions src/client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ launcher::game detect_game_from_arguments()
void enableEcoQoS() {
auto sharedUserData = (BYTE*)0x7FFE0000;
auto major = *(ULONG*)(sharedUserData + 0x26c);
auto minor = *(ULONG*)(sharedUserData + 0x270);
//auto minor = *(ULONG*)(sharedUserData + 0x270);
auto build = *(ULONG*)(sharedUserData + 0x260);
auto CurrentProcessHandle = GetCurrentProcess();
MEMORY_PRIORITY_INFORMATION _MEMORY_PRIORITY_INFORMATION{};
Expand All @@ -175,16 +175,16 @@ void enableEcoQoS() {
//if (major >= 10 && build >= 22000)//Windows 11 EcoQoS
if (major >= 10 && build >= 16299)//Windows 1709 LowQoS
{
auto test1 = SetProcessInformation(CurrentProcessHandle, ProcessPowerThrottling, &_PROCESS_POWER_THROTTLING_STATE, sizeof(PROCESS_POWER_THROTTLING_STATE));
auto test2 = SetProcessInformation(CurrentProcessHandle, ProcessMemoryPriority, &_MEMORY_PRIORITY_INFORMATION, sizeof(MEMORY_PRIORITY_INFORMATION));
auto test3 = SetPriorityClass(CurrentProcessHandle, IDLE_PRIORITY_CLASS);
SetProcessInformation(CurrentProcessHandle, ProcessPowerThrottling, &_PROCESS_POWER_THROTTLING_STATE, sizeof(PROCESS_POWER_THROTTLING_STATE));
SetProcessInformation(CurrentProcessHandle, ProcessMemoryPriority, &_MEMORY_PRIORITY_INFORMATION, sizeof(MEMORY_PRIORITY_INFORMATION));
SetPriorityClass(CurrentProcessHandle, IDLE_PRIORITY_CLASS);
}
}

void disableEcoQoS() {
auto sharedUserData = (BYTE*)0x7FFE0000;
auto major = *(ULONG*)(sharedUserData + 0x26c);
auto minor = *(ULONG*)(sharedUserData + 0x270);
//auto minor = *(ULONG*)(sharedUserData + 0x270);
auto build = *(ULONG*)(sharedUserData + 0x260);
auto CurrentProcessHandle = GetCurrentProcess();
MEMORY_PRIORITY_INFORMATION _MEMORY_PRIORITY_INFORMATION{};
Expand Down

0 comments on commit accd8af

Please sign in to comment.