aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/client
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2023-09-17 01:45:16 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2023-09-17 01:45:16 +0200
commit5cbe9f7317899cd815b38d9f083bc99738fc1dd3 (patch)
tree9afdce5ae5e76f68be85c25a84afcff86f31d3f8 /NorthstarDLL/client
parentb7823492e802456d44e4919940267081bf436f08 (diff)
downloadNorthstarLauncher-5cbe9f7317899cd815b38d9f083bc99738fc1dd3.tar.gz
NorthstarLauncher-5cbe9f7317899cd815b38d9f083bc99738fc1dd3.zip
test ci format checkindentation-test
Diffstat (limited to 'NorthstarDLL/client')
-rw-r--r--NorthstarDLL/client/audio.cpp88
-rw-r--r--NorthstarDLL/client/chatcommand.cpp2
-rw-r--r--NorthstarDLL/client/clientauthhooks.cpp10
-rw-r--r--NorthstarDLL/client/debugoverlay.cpp28
-rw-r--r--NorthstarDLL/client/languagehooks.cpp14
-rw-r--r--NorthstarDLL/client/latencyflex.cpp4
-rw-r--r--NorthstarDLL/client/localchatwriter.cpp40
7 files changed, 93 insertions, 93 deletions
diff --git a/NorthstarDLL/client/audio.cpp b/NorthstarDLL/client/audio.cpp
index 9fcac982..94ce8353 100644
--- a/NorthstarDLL/client/audio.cpp
+++ b/NorthstarDLL/client/audio.cpp
@@ -28,8 +28,8 @@ EventOverrideData::EventOverrideData()
// Empty stereo 48000 WAVE file
unsigned char EMPTY_WAVE[45] = {0x52, 0x49, 0x46, 0x46, 0x25, 0x00, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45, 0x66, 0x6D, 0x74,
- 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x44, 0xAC, 0x00, 0x00, 0x88, 0x58,
- 0x01, 0x00, 0x02, 0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00};
+ 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x44, 0xAC, 0x00, 0x00, 0x88, 0x58,
+ 0x01, 0x00, 0x02, 0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00};
EventOverrideData::EventOverrideData(const std::string& data, const fs::path& path)
{
@@ -45,9 +45,9 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
if (!fs::exists(samplesFolder))
{
spdlog::error(
- "Failed reading audio override file {}: samples folder doesn't exist; should be named the same as the definition file without "
- "JSON extension.",
- path.string());
+ "Failed reading audio override file {}: samples folder doesn't exist; should be named the same as the definition file without "
+ "JSON extension.",
+ path.string());
return;
}
@@ -58,10 +58,10 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
if (dataJson.HasParseError())
{
spdlog::error(
- "Failed reading audio override file {}: encountered parse error \"{}\" at offset {}",
- path.string(),
- GetParseError_En(dataJson.GetParseError()),
- dataJson.GetErrorOffset());
+ "Failed reading audio override file {}: encountered parse error \"{}\" at offset {}",
+ path.string(),
+ GetParseError_En(dataJson.GetParseError()),
+ dataJson.GetErrorOffset());
return;
}
@@ -87,7 +87,7 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
if (!eventId.IsString())
{
spdlog::error(
- "Failed reading audio override file {}: EventId array has a value of invalid type, all must be strings", path.string());
+ "Failed reading audio override file {}: EventId array has a value of invalid type, all must be strings", path.string());
return;
}
@@ -103,8 +103,8 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
else
{
spdlog::error(
- "Failed reading audio override file {}: EventId property is of invalid type (must be a string or an array of strings)",
- path.string());
+ "Failed reading audio override file {}: EventId property is of invalid type (must be a string or an array of strings)",
+ path.string());
return;
}
@@ -118,8 +118,8 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
if (!eventId.IsString())
{
spdlog::error(
- "Failed reading audio override file {}: EventIdRegex array has a value of invalid type, all must be strings",
- path.string());
+ "Failed reading audio override file {}: EventIdRegex array has a value of invalid type, all must be strings",
+ path.string());
return;
}
@@ -154,8 +154,8 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
else
{
spdlog::error(
- "Failed reading audio override file {}: EventIdRegex property is of invalid type (must be a string or an array of strings)",
- path.string());
+ "Failed reading audio override file {}: EventIdRegex property is of invalid type (must be a string or an array of strings)",
+ path.string());
return;
}
}
@@ -181,8 +181,8 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
else
{
spdlog::error(
- "Failed reading audio override file {}: AudioSelectionStrategy string must be either \"sequential\" or \"random\"",
- path.string());
+ "Failed reading audio override file {}: AudioSelectionStrategy string must be either \"sequential\" or \"random\"",
+ path.string());
return;
}
}
@@ -217,25 +217,25 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
// thread off the file read
// should we spawn one thread per read? or should there be a cap to the number of reads at once?
std::thread readThread(
- [pathString, fileSize, data]
- {
- std::shared_lock lock(g_CustomAudioManager.m_loadingMutex);
- std::ifstream wavStream(pathString, std::ios::binary);
-
- // would be weird if this got hit, since it would've worked previously
- if (wavStream.fail())
- {
- spdlog::error("Failed async read of audio sample {}", pathString);
- return;
- }
-
- // read from after the header first to preserve the empty header, then read the header last
- wavStream.seekg(0, std::ios::beg);
- wavStream.read(reinterpret_cast<char*>(data), fileSize);
- wavStream.close();
-
- spdlog::info("Finished async read of audio sample {}", pathString);
- });
+ [pathString, fileSize, data]
+ {
+ std::shared_lock lock(g_CustomAudioManager.m_loadingMutex);
+ std::ifstream wavStream(pathString, std::ios::binary);
+
+ // would be weird if this got hit, since it would've worked previously
+ if (wavStream.fail())
+ {
+ spdlog::error("Failed async read of audio sample {}", pathString);
+ return;
+ }
+
+ // read from after the header first to preserve the empty header, then read the header last
+ wavStream.seekg(0, std::ios::beg);
+ wavStream.read(reinterpret_cast<char*>(data), fileSize);
+ wavStream.close();
+
+ spdlog::info("Finished async read of audio sample {}", pathString);
+ });
readThread.detach();
}
@@ -244,13 +244,13 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
/*
if (dataJson.HasMember("EnableOnLoopedSounds"))
{
- if (!dataJson["EnableOnLoopedSounds"].IsBool())
- {
- spdlog::error("Failed reading audio override file {}: EnableOnLoopedSounds property is of invalid type (must be a bool)",
+ if (!dataJson["EnableOnLoopedSounds"].IsBool())
+ {
+ spdlog::error("Failed reading audio override file {}: EnableOnLoopedSounds property is of invalid type (must be a bool)",
path.string()); return;
- }
+ }
- EnableOnLoopedSounds = dataJson["EnableOnLoopedSounds"].GetBool();
+ EnableOnLoopedSounds = dataJson["EnableOnLoopedSounds"].GetBool();
}
*/
@@ -367,7 +367,7 @@ bool ShouldPlayAudioEvent(const char* eventName, const std::shared_ptr<EventOver
// forward declare
bool __declspec(noinline) __fastcall LoadSampleMetadata_Internal(
- uintptr_t parentEvent, void* sample, void* audioBuffer, unsigned int audioBufferLength, int audioType);
+ uintptr_t parentEvent, void* sample, void* audioBuffer, unsigned int audioBufferLength, int audioType);
// DO NOT TOUCH THIS FUNCTION
// The actual logic of it in a separate function (forcefully not inlined) to preserve the r12 register, which holds the event pointer.
@@ -388,7 +388,7 @@ bool, __fastcall, (void* sample, void* audioBuffer, unsigned int audioBufferLeng
// DO NOT INLINE THIS FUNCTION
// See comment below.
bool __declspec(noinline) __fastcall LoadSampleMetadata_Internal(
- uintptr_t parentEvent, void* sample, void* audioBuffer, unsigned int audioBufferLength, int audioType)
+ uintptr_t parentEvent, void* sample, void* audioBuffer, unsigned int audioBufferLength, int audioType)
{
char* eventName = (char*)parentEvent + 0x110;
diff --git a/NorthstarDLL/client/chatcommand.cpp b/NorthstarDLL/client/chatcommand.cpp
index 9cf34e43..49bd8c47 100644
--- a/NorthstarDLL/client/chatcommand.cpp
+++ b/NorthstarDLL/client/chatcommand.cpp
@@ -29,7 +29,7 @@ void ConCommand_log(const CCommand& args)
ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientChatCommand, ConCommand, (CModule module))
{
ClientSayText =
- module.Offset(0x54780).RCast<void(__fastcall*)(void* a1, const char* message, uint64_t isIngameChat, bool isTeamChat)>();
+ module.Offset(0x54780).RCast<void(__fastcall*)(void* a1, const char* message, uint64_t isIngameChat, bool isTeamChat)>();
RegisterConCommand("say", ConCommand_say, "Enters a message in public chat", FCVAR_CLIENTDLL);
RegisterConCommand("say_team", ConCommand_say_team, "Enters a message in team chat", FCVAR_CLIENTDLL);
RegisterConCommand("log", ConCommand_log, "Log a message to the local chat window", FCVAR_CLIENTDLL);
diff --git a/NorthstarDLL/client/clientauthhooks.cpp b/NorthstarDLL/client/clientauthhooks.cpp
index e66da6c8..e9cee10a 100644
--- a/NorthstarDLL/client/clientauthhooks.cpp
+++ b/NorthstarDLL/client/clientauthhooks.cpp
@@ -22,7 +22,7 @@ void, __fastcall, (void* a1))
{
// if player has agreed to send token and we aren't already authing, try to auth
if (Cvar_ns_has_agreed_to_send_token->GetInt() == AGREED_TO_SEND_TOKEN &&
- !g_pMasterServerManager->m_bOriginAuthWithMasterServerInProgress)
+ !g_pMasterServerManager->m_bOriginAuthWithMasterServerInProgress)
g_pMasterServerManager->AuthenticateOriginWithMasterServer(R2::g_pLocalPlayerUserID, R2::g_pLocalPlayerOriginToken);
// invalidate key so auth will fail
@@ -56,8 +56,8 @@ ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientAuthHooks, ConVar, (CModule modu
// this cvar will save to cfg once initially agreed with
Cvar_ns_has_agreed_to_send_token = new ConVar(
- "ns_has_agreed_to_send_token",
- "0",
- FCVAR_ARCHIVE_PLAYERPROFILE,
- "whether the user has agreed to send their origin token to the northstar masterserver");
+ "ns_has_agreed_to_send_token",
+ "0",
+ FCVAR_ARCHIVE_PLAYERPROFILE,
+ "whether the user has agreed to send their origin token to the northstar masterserver");
}
diff --git a/NorthstarDLL/client/debugoverlay.cpp b/NorthstarDLL/client/debugoverlay.cpp
index cdb14693..7bb4adae 100644
--- a/NorthstarDLL/client/debugoverlay.cpp
+++ b/NorthstarDLL/client/debugoverlay.cpp
@@ -98,24 +98,24 @@ void, __fastcall, (OverlayBase_t * pOverlay))
if (pCurrBox->a > 0)
{
RenderBox(
- pCurrBox->origin,
- pCurrBox->angles,
- pCurrBox->mins,
- pCurrBox->maxs,
- Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, pCurrBox->a),
- false,
- false);
+ pCurrBox->origin,
+ pCurrBox->angles,
+ pCurrBox->mins,
+ pCurrBox->maxs,
+ Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, pCurrBox->a),
+ false,
+ false);
}
if (pCurrBox->a < 255)
{
RenderWireframeBox(
- pCurrBox->origin,
- pCurrBox->angles,
- pCurrBox->mins,
- pCurrBox->maxs,
- Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, 255),
- false,
- false);
+ pCurrBox->origin,
+ pCurrBox->angles,
+ pCurrBox->mins,
+ pCurrBox->maxs,
+ Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, 255),
+ false,
+ false);
}
}
break;
diff --git a/NorthstarDLL/client/languagehooks.cpp b/NorthstarDLL/client/languagehooks.cpp
index 4251dbbd..cbf846e7 100644
--- a/NorthstarDLL/client/languagehooks.cpp
+++ b/NorthstarDLL/client/languagehooks.cpp
@@ -62,9 +62,9 @@ char*, __fastcall, ())
if (!CheckLangAudioExists((char*)forcedLanguage))
{
spdlog::info(
- "User tried to force the language (-language) to \"{}\", but audio for this language doesn't exist and the game is bound "
- "to error, falling back to next option...",
- forcedLanguage);
+ "User tried to force the language (-language) to \"{}\", but audio for this language doesn't exist and the game is bound "
+ "to error, falling back to next option...",
+ forcedLanguage);
}
else
{
@@ -80,9 +80,9 @@ char*, __fastcall, ())
if (!CheckLangAudioExists(lang))
{
if (strcmp(lang, "russian") !=
- 0) // don't log for "russian" since it's the default and that means Origin detection just didn't change it most likely
+ 0) // don't log for "russian" since it's the default and that means Origin detection just didn't change it most likely
spdlog::info(
- "Origin detected language \"{}\", but we do not have audio for it installed, falling back to the next option", lang);
+ "Origin detected language \"{}\", but we do not have audio for it installed, falling back to the next option", lang);
}
else
{
@@ -92,14 +92,14 @@ char*, __fastcall, ())
}
Tier0_DetectDefaultLanguageType(); // force the global in tier0 to be populated with language inferred from user's system rather than
- // defaulting to Russian
+ // defaulting to Russian
canOriginDictateLang = false; // Origin has no say anymore, we will fallback to user's system setup language
auto lang = GetGameLanguage();
spdlog::info("Detected system language: {}", lang);
if (!CheckLangAudioExists(lang))
{
spdlog::warn("Caution, audio for this language does NOT exist. You might want to override your game language with -language "
- "command line option.");
+ "command line option.");
auto lang = GetAnyInstalledAudioLanguage();
spdlog::warn("Falling back to the first installed audio language: {}", lang.c_str());
strncpy(ingameLang1, lang.c_str(), 256);
diff --git a/NorthstarDLL/client/latencyflex.cpp b/NorthstarDLL/client/latencyflex.cpp
index 25e38c7a..0a13717c 100644
--- a/NorthstarDLL/client/latencyflex.cpp
+++ b/NorthstarDLL/client/latencyflex.cpp
@@ -26,10 +26,10 @@ ON_DLL_LOAD_CLIENT_RELIESON("client.dll", LatencyFlex, ConVar, (CModule module))
if (pLfxModule = LoadLibraryA("latencyflex_layer.dll"))
m_winelfx_WaitAndBeginFrame =
- reinterpret_cast<void (*)()>(reinterpret_cast<void*>(GetProcAddress(pLfxModule, "lfx_WaitAndBeginFrame")));
+ reinterpret_cast<void (*)()>(reinterpret_cast<void*>(GetProcAddress(pLfxModule, "lfx_WaitAndBeginFrame")));
else if (pLfxModule = LoadLibraryA("latencyflex_wine.dll"))
m_winelfx_WaitAndBeginFrame =
- reinterpret_cast<void (*)()>(reinterpret_cast<void*>(GetProcAddress(pLfxModule, "winelfx_WaitAndBeginFrame")));
+ reinterpret_cast<void (*)()>(reinterpret_cast<void*>(GetProcAddress(pLfxModule, "winelfx_WaitAndBeginFrame")));
else
{
spdlog::info("Unable to load LatencyFleX library, LatencyFleX disabled.");
diff --git a/NorthstarDLL/client/localchatwriter.cpp b/NorthstarDLL/client/localchatwriter.cpp
index 848d898f..0c1315ea 100644
--- a/NorthstarDLL/client/localchatwriter.cpp
+++ b/NorthstarDLL/client/localchatwriter.cpp
@@ -73,31 +73,31 @@ typedef void(__fastcall* ConvertANSIToUnicodeType)(LPCSTR ansi, int ansiCharLeng
ConvertANSIToUnicodeType ConvertANSIToUnicode;
LocalChatWriter::SwatchColor swatchColors[4] = {
- LocalChatWriter::MainTextColor,
- LocalChatWriter::SameTeamNameColor,
- LocalChatWriter::EnemyTeamNameColor,
- LocalChatWriter::NetworkNameColor,
+ LocalChatWriter::MainTextColor,
+ LocalChatWriter::SameTeamNameColor,
+ LocalChatWriter::EnemyTeamNameColor,
+ LocalChatWriter::NetworkNameColor,
};
Color darkColors[8] = {
- Color {0, 0, 0, 255},
- Color {205, 49, 49, 255},
- Color {13, 188, 121, 255},
- Color {229, 229, 16, 255},
- Color {36, 114, 200, 255},
- Color {188, 63, 188, 255},
- Color {17, 168, 205, 255},
- Color {229, 229, 229, 255}};
+ Color {0, 0, 0, 255},
+ Color {205, 49, 49, 255},
+ Color {13, 188, 121, 255},
+ Color {229, 229, 16, 255},
+ Color {36, 114, 200, 255},
+ Color {188, 63, 188, 255},
+ Color {17, 168, 205, 255},
+ Color {229, 229, 229, 255}};
Color lightColors[8] = {
- Color {102, 102, 102, 255},
- Color {241, 76, 76, 255},
- Color {35, 209, 139, 255},
- Color {245, 245, 67, 255},
- Color {59, 142, 234, 255},
- Color {214, 112, 214, 255},
- Color {41, 184, 219, 255},
- Color {255, 255, 255, 255}};
+ Color {102, 102, 102, 255},
+ Color {241, 76, 76, 255},
+ Color {35, 209, 139, 255},
+ Color {245, 245, 67, 255},
+ Color {59, 142, 234, 255},
+ Color {214, 112, 214, 255},
+ Color {41, 184, 219, 255},
+ Color {255, 255, 255, 255}};
class AnsiEscapeParser
{