diff --git a/.editorconfig b/.editorconfig index bc423183f..59f4af9f5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,3 +9,4 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true indent_style = tab +indent_size = 4 diff --git a/NorthstarDLL/client/rejectconnectionfixes.cpp b/NorthstarDLL/client/rejectconnectionfixes.cpp index 5daeb3eeb..6adde8b6c 100644 --- a/NorthstarDLL/client/rejectconnectionfixes.cpp +++ b/NorthstarDLL/client/rejectconnectionfixes.cpp @@ -25,7 +25,7 @@ void,, (bool a1, const char* fmt, ...)) R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "disconnect", R2::cmd_source_t::kCommandSrcCode); } - return COM_ExplainDisconnection(a1, buf); + return COM_ExplainDisconnection(a1, "%s", buf); } ON_DLL_LOAD_CLIENT("engine.dll", RejectConnectionFixes, (CModule module)) diff --git a/NorthstarDLL/core/tier0.cpp b/NorthstarDLL/core/tier0.cpp index 3b9996a13..167093842 100644 --- a/NorthstarDLL/core/tier0.cpp +++ b/NorthstarDLL/core/tier0.cpp @@ -3,7 +3,7 @@ // use the Tier0 namespace for tier0 funcs namespace Tier0 { - IMemAlloc* g_pMemAllocSingleton; + IMemAlloc* g_pMemAllocSingleton = nullptr; ErrorType Error; CommandLineType CommandLine; diff --git a/NorthstarDLL/logging/logging.cpp b/NorthstarDLL/logging/logging.cpp index 2e8605d67..a68fe7046 100644 --- a/NorthstarDLL/logging/logging.cpp +++ b/NorthstarDLL/logging/logging.cpp @@ -52,7 +52,7 @@ void CreateLogFiles() stream << std::put_time(¤tTime, (GetNorthstarPrefix() + "/logs/nslog%Y-%m-%d %H-%M-%S.txt").c_str()); auto sink = std::make_shared(stream.str(), false); - sink->set_pattern("[%H:%M:%S] [%n] [%l] %v"); + sink->set_pattern("[%Y-%m-%d] [%H:%M:%S] [%n] [%l] %v"); for (auto& logger : loggers) { logger->sinks().push_back(sink); diff --git a/NorthstarDLL/server/auth/bansystem.cpp b/NorthstarDLL/server/auth/bansystem.cpp index 845a1bff1..9b9d24c43 100644 --- a/NorthstarDLL/server/auth/bansystem.cpp +++ b/NorthstarDLL/server/auth/bansystem.cpp @@ -3,6 +3,7 @@ #include "core/convar/concommand.h" #include "server/r2server.h" #include "engine/r2engine.h" +#include "client/r2client.h" #include "config/profile.h" #include @@ -172,6 +173,10 @@ void ServerBanSystem::UnbanUID(uint64_t uid) bool ServerBanSystem::IsUIDAllowed(uint64_t uid) { + uint64_t localPlayerUserID = strtoull(R2::g_pLocalPlayerUserID, nullptr, 10); + if (localPlayerUserID == uid) + return true; + ReloadBanlist(); // Reload to have up to date list on join return std::find(m_vBannedUids.begin(), m_vBannedUids.end(), uid) == m_vBannedUids.end(); }