fix(clang-format): enforce braces

This commit is contained in:
maybegreat48 2024-09-23 12:55:44 -04:00
parent a71ca03d6a
commit bb3ee3bd0c
2 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,7 @@ IncludeBlocks: Regroup
IndentCaseLabels: 'false' IndentCaseLabels: 'false'
IndentPPDirectives: BeforeHash IndentPPDirectives: BeforeHash
IndentWidth: '4' IndentWidth: '4'
InsertBraces: true
TabWidth: 4 TabWidth: 4
IndentWrappedFunctionNames: 'true' IndentWrappedFunctionNames: 'true'
KeepEmptyLinesAtTheStartOfBlocks: 'false' KeepEmptyLinesAtTheStartOfBlocks: 'false'

View File

@ -103,9 +103,11 @@ namespace big
{ {
LOGF(WARNING, "BattlEye wants us to kick {} for {}", plyr->get_name(), reason); LOGF(WARNING, "BattlEye wants us to kick {} for {}", plyr->get_name(), reason);
if (!plyr->tampered_with_be) if (!plyr->tampered_with_be)
{
session::add_infraction(plyr, Infraction::TRIGGERED_ANTICHEAT); session::add_infraction(plyr, Infraction::TRIGGERED_ANTICHEAT);
} }
} }
}
void battleye_service::script_func() void battleye_service::script_func()
{ {
@ -141,8 +143,10 @@ namespace big
{ {
std::lock_guard lock(m_mutex); std::lock_guard lock(m_mutex);
if (is_running() && !m_battleye_api.m_run()) if (is_running() && !m_battleye_api.m_run())
{
LOG(WARNING) << "BE::Run failed"; LOG(WARNING) << "BE::Run failed";
} }
}
std::this_thread::yield(); std::this_thread::yield();
} }
@ -162,7 +166,9 @@ namespace big
std::lock_guard lock(m_mutex); std::lock_guard lock(m_mutex);
if (is_running()) if (is_running())
{
return; return;
}
auto handle = LoadLibraryA("BattlEye\\BEServer_x64.dll"); auto handle = LoadLibraryA("BattlEye\\BEServer_x64.dll");
@ -201,7 +207,9 @@ namespace big
std::lock_guard lock(m_mutex); std::lock_guard lock(m_mutex);
if (!is_running()) if (!is_running())
{
return; return;
}
m_battleye_api.m_shutdown(); m_battleye_api.m_shutdown();
memset(&m_battleye_api, 0, sizeof(CApi)); memset(&m_battleye_api, 0, sizeof(CApi));
@ -212,7 +220,9 @@ namespace big
std::lock_guard lock(m_mutex); std::lock_guard lock(m_mutex);
if (!is_running() || !g_player_service->get_self()->is_host()) if (!is_running() || !g_player_service->get_self()->is_host())
{
return; return;
}
char string[32]{}; char string[32]{};
@ -230,7 +240,9 @@ namespace big
std::lock_guard lock(m_mutex); std::lock_guard lock(m_mutex);
if (!is_running()) if (!is_running())
{
return; return;
}
m_battleye_api.m_set_player_state(token, -1); m_battleye_api.m_set_player_state(token, -1);
} }
@ -240,7 +252,9 @@ namespace big
std::lock_guard lock(m_mutex); std::lock_guard lock(m_mutex);
if (!is_running()) if (!is_running())
{
return; return;
}
m_battleye_api.m_receive_message(token, const_cast<const void*>(message), size); m_battleye_api.m_receive_message(token, const_cast<const void*>(message), size);
} }