From b756ce3c3fcdfd7556d8106f7b4041c59895b8db Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Sun, 13 Nov 2022 00:32:55 +0100 Subject: [PATCH] fix formatting in all files --- include/Client.h | 3 +-- include/CustomAssert.h | 6 +++--- include/Json.h | 4 ++-- include/RWMutex.h | 2 +- include/TConsole.h | 2 +- include/Uuid.h | 1 - src/main.cpp | 9 ++++----- 7 files changed, 12 insertions(+), 15 deletions(-) diff --git a/include/Client.h b/include/Client.h index ea23e6b..9744621 100644 --- a/include/Client.h +++ b/include/Client.h @@ -101,8 +101,7 @@ public: // bytes sent on TCP std::atomic_size_t TcpSent = 0; - TimeType::time_point ConnectionTime{}; - + TimeType::time_point ConnectionTime {}; private: void InsertVehicle(int ID, const std::string& Data); diff --git a/include/CustomAssert.h b/include/CustomAssert.h index df3c4c6..e3b2a19 100644 --- a/include/CustomAssert.h +++ b/include/CustomAssert.h @@ -66,9 +66,9 @@ inline void _assert([[maybe_unused]] const char* file, [[maybe_unused]] const ch Sentry.LogAssert(#cond, _file_basename, _line, __func__); \ } \ } while (false) -#define beammp_assert_not_reachable() \ - do { \ +#define beammp_assert_not_reachable() \ + do { \ beammp_errorf("Assertion failed in '{}:{}': Unreachable code reached. This may result in a crash or undefined state of the program.", __func__, _line); \ - Sentry.LogAssert("code is unreachable", _file_basename, _line, __func__); \ + Sentry.LogAssert("code is unreachable", _file_basename, _line, __func__); \ } while (false) #endif // DEBUG diff --git a/include/Json.h b/include/Json.h index d319099..53ca0cc 100644 --- a/include/Json.h +++ b/include/Json.h @@ -3,7 +3,7 @@ // #pragma once -#include "rapidjson/stringbuffer.h" -#include "rapidjson/prettywriter.h" #include "rapidjson/document.h" +#include "rapidjson/prettywriter.h" +#include "rapidjson/stringbuffer.h" #include "rapidjson/writer.h" diff --git a/include/RWMutex.h b/include/RWMutex.h index ee94cf8..e3c484e 100644 --- a/include/RWMutex.h +++ b/include/RWMutex.h @@ -6,8 +6,8 @@ * and write locks and read locks are mutually exclusive. */ -#include #include +#include // Use ReadLock(m) and WriteLock(m) to lock it. using RWMutex = std::shared_mutex; diff --git a/include/TConsole.h b/include/TConsole.h index 25cd396..1ef6263 100644 --- a/include/TConsole.h +++ b/include/TConsole.h @@ -67,7 +67,7 @@ private: { "lua", [this](const auto& a, auto& b) { Autocomplete_Lua(a, b); } }, { "kick", [this](const auto& a, auto& b) { Autocomplete_Kick(a, b); } }, { "settings", [this](const auto& a, auto& b) { Autocomplete_Settings(a, b); } }, - }; + }; Commandline mCommandline; std::vector mCachedLuaHistory; diff --git a/include/Uuid.h b/include/Uuid.h index d61f526..c89ca58 100644 --- a/include/Uuid.h +++ b/include/Uuid.h @@ -7,4 +7,3 @@ namespace uuid { std::string GenerateUuid(); } - diff --git a/src/main.cpp b/src/main.cpp index d93f124..69788c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -112,11 +112,10 @@ int BeamMPServerMain(MainArguments Arguments) { } } - Application::SetSubsystemStatus("Main", Application::Status::Starting); SetupSignalHandlers(); - + beammp_infof("BeamMP Server v{} ({})", Application::ServerVersionString(), BEAMMP_GIT_HASH); TConfig Config(ConfigPath); @@ -130,17 +129,17 @@ int BeamMPServerMain(MainArguments Arguments) { Application::GracefullyShutdown(); return 1; } - + Application::Console().Internal().set_prompt("> "); Application::Console().StartLoggingToFile(); - + bool Shutdown = false; Application::RegisterShutdownHandler([&Shutdown] { beammp_info("If this takes too long, you can press Ctrl+C repeatedly to force a shutdown."); Application::SetSubsystemStatus("Main", Application::Status::ShuttingDown); Shutdown = true; }); - + TServer Server(Arguments.List); auto LuaEngine = std::make_shared(); LuaEngine->SetServer(&Server);