aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NorthstarDedicatedTest/rcon_shared.cpp65
-rw-r--r--NorthstarDedicatedTest/sha256.cpp6
2 files changed, 56 insertions, 15 deletions
diff --git a/NorthstarDedicatedTest/rcon_shared.cpp b/NorthstarDedicatedTest/rcon_shared.cpp
index 2b8797d1..bfac496c 100644
--- a/NorthstarDedicatedTest/rcon_shared.cpp
+++ b/NorthstarDedicatedTest/rcon_shared.cpp
@@ -123,30 +123,71 @@ void InitializeRconSystems(HMODULE baseAddress)
{
// TODO: RconPasswordChanged_f
CVar_rcon_address = new ConVar(
- "rcon_address", "::", FCVAR_SERVER_CANNOT_QUERY | FCVAR_DONTRECORD | FCVAR_RELEASE, "Remote server access address.", false, 0.f,
- false, 0.f, nullptr);
+ "rcon_address",
+ "::",
+ FCVAR_SERVER_CANNOT_QUERY | FCVAR_DONTRECORD | FCVAR_RELEASE,
+ "Remote server access address.",
+ false,
+ 0.f,
+ false,
+ 0.f,
+ nullptr);
CVar_rcon_password = new ConVar(
- "rcon_password", "", FCVAR_SERVER_CANNOT_QUERY | FCVAR_DONTRECORD | FCVAR_RELEASE,
- "Remote server access password (rcon is disabled if empty).", false, 0.f, false, 0.f, nullptr);
+ "rcon_password",
+ "",
+ FCVAR_SERVER_CANNOT_QUERY | FCVAR_DONTRECORD | FCVAR_RELEASE,
+ "Remote server access password (rcon is disabled if empty).",
+ false,
+ 0.f,
+ false,
+ 0.f,
+ nullptr);
CVar_sv_rcon_debug =
new ConVar("sv_rcon_debug", "0", FCVAR_RELEASE, "Show rcon debug information ( !slower! ).", false, 0.f, false, 0.f, nullptr);
CVar_sv_rcon_maxfailures = new ConVar(
- "sv_rcon_maxfailures", "10", FCVAR_RELEASE, "Max number of times a user can fail rcon authentication before being banned.", false,
- 0.f, false, 0.f, nullptr);
+ "sv_rcon_maxfailures",
+ "10",
+ FCVAR_RELEASE,
+ "Max number of times a user can fail rcon authentication before being banned.",
+ false,
+ 0.f,
+ false,
+ 0.f,
+ nullptr);
CVar_sv_rcon_maxignores = new ConVar(
- "sv_rcon_maxignores", "15", FCVAR_RELEASE, "Max number of times a user can ignore the no-auth message before being banned.", false,
- 0.f, false, 0.f, nullptr);
+ "sv_rcon_maxignores",
+ "15",
+ FCVAR_RELEASE,
+ "Max number of times a user can ignore the no-auth message before being banned.",
+ false,
+ 0.f,
+ false,
+ 0.f,
+ nullptr);
CVar_sv_rcon_maxsockets = new ConVar(
- "sv_rcon_maxsockets", "32", FCVAR_RELEASE, "Max number of accepted sockets before the server starts closing redundant sockets.",
- false, 0.f, false, 0.f, nullptr);
+ "sv_rcon_maxsockets",
+ "32",
+ FCVAR_RELEASE,
+ "Max number of accepted sockets before the server starts closing redundant sockets.",
+ false,
+ 0.f,
+ false,
+ 0.f,
+ nullptr);
CVar_sv_rcon_sendlogs = new ConVar(
"sv_rcon_sendlogs", "0", FCVAR_RELEASE, "If enabled, sends conlogs to connected netconsoles.", false, 0.f, false, 0.f, nullptr);
CVar_sv_rcon_whitelist_address = new ConVar(
- "sv_rcon_whitelist_address", "", FCVAR_RELEASE,
+ "sv_rcon_whitelist_address",
+ "",
+ FCVAR_RELEASE,
"This address is not considered a 'redundant' socket and will never be banned for failed authentications. Example: "
"'::ffff:127.0.0.1'.",
- false, 0.f, false, 0.f, nullptr);
+ false,
+ 0.f,
+ false,
+ 0.f,
+ nullptr);
RegisterConCommand(
"rcon", _RCON_CmdQuery_f, "Forward RCON query to remote server. | Usage: rcon \"<query>\".", FCVAR_CLIENTDLL | FCVAR_RELEASE);
diff --git a/NorthstarDedicatedTest/sha256.cpp b/NorthstarDedicatedTest/sha256.cpp
index a5e0fa03..0232efb7 100644
--- a/NorthstarDedicatedTest/sha256.cpp
+++ b/NorthstarDedicatedTest/sha256.cpp
@@ -11,8 +11,8 @@ const unsigned int SHA256::sha256_k[64] = // UL = uint32
void SHA256::transform(const unsigned char* message, unsigned int block_nb)
{
- uint32 w[64]{};
- uint32 wv[8]{};
+ uint32 w[64] {};
+ uint32 wv[8] {};
uint32 t1, t2;
const unsigned char* sub_block;
int i;
@@ -119,7 +119,7 @@ std::string sha256(std::string input)
ctx.update(const_cast<unsigned char*>(reinterpret_cast<const unsigned char*>(input.c_str())), input.length());
ctx.final(digest);
- char buf[2 * SHA256::DIGEST_SIZE + 1]{};
+ char buf[2 * SHA256::DIGEST_SIZE + 1] {};
buf[2 * SHA256::DIGEST_SIZE] = 0;
for (int i = 0; i < SHA256::DIGEST_SIZE; i++)
{