fix formatting in all files

This commit is contained in:
Lion Kortlepel
2022-11-13 00:32:55 +01:00
parent 3f05b72cc2
commit b756ce3c3f
7 changed files with 12 additions and 15 deletions

View File

@@ -101,8 +101,7 @@ public:
// bytes sent on TCP // bytes sent on TCP
std::atomic_size_t TcpSent = 0; std::atomic_size_t TcpSent = 0;
TimeType::time_point ConnectionTime{}; TimeType::time_point ConnectionTime {};
private: private:
void InsertVehicle(int ID, const std::string& Data); void InsertVehicle(int ID, const std::string& Data);

View File

@@ -66,9 +66,9 @@ inline void _assert([[maybe_unused]] const char* file, [[maybe_unused]] const ch
Sentry.LogAssert(#cond, _file_basename, _line, __func__); \ Sentry.LogAssert(#cond, _file_basename, _line, __func__); \
} \ } \
} while (false) } while (false)
#define beammp_assert_not_reachable() \ #define beammp_assert_not_reachable() \
do { \ do { \
beammp_errorf("Assertion failed in '{}:{}': Unreachable code reached. This may result in a crash or undefined state of the program.", __func__, _line); \ 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) } while (false)
#endif // DEBUG #endif // DEBUG

View File

@@ -3,7 +3,7 @@
// //
#pragma once #pragma once
#include "rapidjson/stringbuffer.h"
#include "rapidjson/prettywriter.h"
#include "rapidjson/document.h" #include "rapidjson/document.h"
#include "rapidjson/prettywriter.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/writer.h" #include "rapidjson/writer.h"

View File

@@ -6,8 +6,8 @@
* and write locks and read locks are mutually exclusive. * and write locks and read locks are mutually exclusive.
*/ */
#include <shared_mutex>
#include <mutex> #include <mutex>
#include <shared_mutex>
// Use ReadLock(m) and WriteLock(m) to lock it. // Use ReadLock(m) and WriteLock(m) to lock it.
using RWMutex = std::shared_mutex; using RWMutex = std::shared_mutex;

View File

@@ -67,7 +67,7 @@ private:
{ "lua", [this](const auto& a, auto& b) { Autocomplete_Lua(a, b); } }, { "lua", [this](const auto& a, auto& b) { Autocomplete_Lua(a, b); } },
{ "kick", [this](const auto& a, auto& b) { Autocomplete_Kick(a, b); } }, { "kick", [this](const auto& a, auto& b) { Autocomplete_Kick(a, b); } },
{ "settings", [this](const auto& a, auto& b) { Autocomplete_Settings(a, b); } }, { "settings", [this](const auto& a, auto& b) { Autocomplete_Settings(a, b); } },
}; };
Commandline mCommandline; Commandline mCommandline;
std::vector<std::string> mCachedLuaHistory; std::vector<std::string> mCachedLuaHistory;

View File

@@ -7,4 +7,3 @@ namespace uuid {
std::string GenerateUuid(); std::string GenerateUuid();
} }

View File

@@ -112,11 +112,10 @@ int BeamMPServerMain(MainArguments Arguments) {
} }
} }
Application::SetSubsystemStatus("Main", Application::Status::Starting); Application::SetSubsystemStatus("Main", Application::Status::Starting);
SetupSignalHandlers(); SetupSignalHandlers();
beammp_infof("BeamMP Server v{} ({})", Application::ServerVersionString(), BEAMMP_GIT_HASH); beammp_infof("BeamMP Server v{} ({})", Application::ServerVersionString(), BEAMMP_GIT_HASH);
TConfig Config(ConfigPath); TConfig Config(ConfigPath);
@@ -130,17 +129,17 @@ int BeamMPServerMain(MainArguments Arguments) {
Application::GracefullyShutdown(); Application::GracefullyShutdown();
return 1; return 1;
} }
Application::Console().Internal().set_prompt("> "); Application::Console().Internal().set_prompt("> ");
Application::Console().StartLoggingToFile(); Application::Console().StartLoggingToFile();
bool Shutdown = false; bool Shutdown = false;
Application::RegisterShutdownHandler([&Shutdown] { Application::RegisterShutdownHandler([&Shutdown] {
beammp_info("If this takes too long, you can press Ctrl+C repeatedly to force a shutdown."); beammp_info("If this takes too long, you can press Ctrl+C repeatedly to force a shutdown.");
Application::SetSubsystemStatus("Main", Application::Status::ShuttingDown); Application::SetSubsystemStatus("Main", Application::Status::ShuttingDown);
Shutdown = true; Shutdown = true;
}); });
TServer Server(Arguments.List); TServer Server(Arguments.List);
auto LuaEngine = std::make_shared<TLuaEngine>(); auto LuaEngine = std::make_shared<TLuaEngine>();
LuaEngine->SetServer(&Server); LuaEngine->SetServer(&Server);