Skip to content

Commit

Permalink
Merge branch 'main' into origin-auth-dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ASpoonPlaysGames authored Oct 7, 2023
2 parents 69151fd + 9d8bedf commit d534257
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
2 changes: 1 addition & 1 deletion NorthstarDLL/client/rejectconnectionfixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion NorthstarDLL/core/tier0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// use the Tier0 namespace for tier0 funcs
namespace Tier0
{
IMemAlloc* g_pMemAllocSingleton;
IMemAlloc* g_pMemAllocSingleton = nullptr;

ErrorType Error;
CommandLineType CommandLine;
Expand Down
2 changes: 1 addition & 1 deletion NorthstarDLL/logging/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void CreateLogFiles()

stream << std::put_time(&currentTime, (GetNorthstarPrefix() + "/logs/nslog%Y-%m-%d %H-%M-%S.txt").c_str());
auto sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(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);
Expand Down
5 changes: 5 additions & 0 deletions NorthstarDLL/server/auth/bansystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <filesystem>
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit d534257

Please sign in to comment.