Skip to content

Commit

Permalink
Merge Set default sv_replaceExeToSwitchBuilds value to false (mr-668)
Browse files Browse the repository at this point in the history
3850efd - tweak(five): set default sv_replaceExeToSwitchBuilds value to false
  • Loading branch information
prikolium-cfx committed Feb 12, 2025
2 parents 5d3128e + 3850efd commit 83986d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/client/shared/XBRInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bool GetReplaceExecutableInit()
std::wstring fpath = MakeRelativeCitPath(L"CitizenFX.ini");
if (GetFileAttributes(fpath.c_str()) != INVALID_FILE_ATTRIBUTES)
{
replaceExecutable = (GetPrivateProfileInt(L"Game", L"ReplaceExecutable", 1, fpath.c_str()) != 0);
replaceExecutable = (GetPrivateProfileInt(L"Game", L"ReplaceExecutable", 0, fpath.c_str()) != 0);
}

return replaceExecutable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static InitFunction initFunction([]()
auto enforceGameBuildVar = instance->AddVariable<fx::GameBuild>("sv_enforceGameBuild", ConVar_ReadOnly | ConVar_ServerInfo, xbr::GetDefaultGTA5BuildString(), &g_enforcedGameBuild);

g_replaceExecutable = true;
auto replaceExecutableVar = instance->AddVariable<bool>("sv_replaceExeToSwitchBuilds", ConVar_ReadOnly | ConVar_ServerInfo, true, &g_replaceExecutable);
auto replaceExecutableVar = instance->AddVariable<bool>("sv_replaceExeToSwitchBuilds", ConVar_ReadOnly | ConVar_ServerInfo, false, &g_replaceExecutable);

auto poolSizesIncrease = std::make_shared<std::unordered_map<std::string, uint32_t>>();
auto poolSizesIncreaseVar = instance->AddVariable<std::string>("sv_poolSizesIncrease", ConVar_ServerInfo | ConVar_Internal, "");
Expand Down
4 changes: 2 additions & 2 deletions code/components/net/src/NetLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ concurrency::task<void> NetLibrary::ConnectToServer(const std::string& rootUrl)
int buildRef = 0;

// Special build 1 with all DLCs turned off can not be achieved by replacing the executable. There is no executable for that build.
bool replaceExecutable = info["vars"].value("sv_replaceExeToSwitchBuilds", "true") != std::string("false") && val != std::string("1");
bool replaceExecutable = info["vars"].value("sv_replaceExeToSwitchBuilds", "false") != std::string("false") && val != std::string("1");

if (!val.empty())
{
Expand Down Expand Up @@ -1912,7 +1912,7 @@ concurrency::task<void> NetLibrary::ConnectToServer(const std::string& rootUrl)
#if defined(GTA_FIVE)
if (buildRef == 0 && xbr::GetRequestedGameBuild() != xbr::GetDefaultGameBuild())
{
OnRequestBuildSwitch(xbr::GetDefaultGameBuild(), 0, L"", true);
OnRequestBuildSwitch(xbr::GetDefaultGameBuild(), 0, L"", false);
m_connectionState = CS_IDLE;
return;
}
Expand Down
4 changes: 2 additions & 2 deletions ext/cfx-ui/src/assets/languages/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@
"#BuildSwitch_GeneralDescription": "The server you are joining requires settings that are different from your current ones. The game will close and restart shortly to change it and connect to the server.",
"#BuildSwitch_BuildDiff": "Switching from game version {{currentBuild}} to {{build}}.",
"#BuildSwitch_PureModeDiff": "Changing 'pure mode' level from {{currentPureLevel}} to {{pureLevel}}.",
"#BuildSwitch_ReplaceExecutable": "Returning to default way of loading old game builds. Old build exe and corresponding files will be loaded.",
"#BuildSwitch_DontReplaceExecutable": "Switching to the new way of loading old game builds. Run latest exe while updating only the content set.",
"#BuildSwitch_ReplaceExecutable": "Returning to legacy way of loading old game builds. Old build exe and corresponding files will be loaded.",
"#BuildSwitch_DontReplaceExecutable": "Switching to the default way of loading old game builds. Run latest exe while updating only the content set.",
"#BuildSwitch_PoolSizeDiff": "Increasing pool sizes by the following number of items: \"{{sizeIncreasePerPool}}\".",
"#BuildSwitch_PoolSizeDefault": "Setting pool sizes to default values.",
"#BuildSwitch_Cancel": "Cancel",
Expand Down

0 comments on commit 83986d6

Please sign in to comment.