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

Commit

Permalink
Fix WebClient Errors For Chinese Region
Browse files Browse the repository at this point in the history
  • Loading branch information
hotline1337 committed Dec 13, 2023
1 parent efcd0f8 commit 1d5d371
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions R3nzSkin_Injector/Injector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ void WINAPI Injector::enableDebugPrivilege() noexcept

void Injector::autoUpdate()
{
/* do not even bother if we are from Chinese regions */
auto whitelisted_regions = gcnew array<String^> {
xor_clrstr_w(L"zh-CN"),
xor_clrstr_w(L"zh-TW"),
xor_clrstr_w(L"zh-HK"),
xor_clrstr_w(L"zh-MO"),
xor_clrstr_w(L"zh-SG")
};
auto current_culture = CultureInfo::CurrentCulture;
auto region = current_culture->Name;
for each (auto whitelisted_region in whitelisted_regions)
{
if (region->Equals(whitelisted_region, StringComparison::OrdinalIgnoreCase))
{
return;
}
}

auto client = gcnew WebClient();
ServicePointManager::Expect100Continue = true;
ServicePointManager::SecurityProtocol = SecurityProtocolType::Tls12;
Expand Down

0 comments on commit 1d5d371

Please sign in to comment.