mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Send client's persona name to the master server
Will be used on the master server for additional checking.
This commit is contained in:
parent
7739e56b0d
commit
ab9d36e0d8
@ -119,7 +119,7 @@ bool CServer::AuthClient(user_creds_s* pChallenge)
|
||||
|
||||
if (sv_globalBanlist->GetBool())
|
||||
{
|
||||
std::thread th(SV_IsClientBanned, string(pszAddresBuffer), nNucleusID);
|
||||
std::thread th(SV_IsClientBanned, string(pszAddresBuffer), nNucleusID, string(pszPersonaName));
|
||||
th.detach();
|
||||
}
|
||||
|
||||
|
@ -15,11 +15,11 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: checks if particular client is banned on the comp server
|
||||
//-----------------------------------------------------------------------------
|
||||
void SV_IsClientBanned(const string& svIPAddr, const uint64_t nNucleusID)
|
||||
void SV_IsClientBanned(const string& svIPAddr, const uint64_t nNucleusID, const string& svPersonaName)
|
||||
{
|
||||
string svError;
|
||||
bool bCompBanned = g_pMasterServer->CheckForBan(svIPAddr, nNucleusID, svPersonaName, svError);
|
||||
|
||||
bool bCompBanned = g_pMasterServer->CheckForBan(svIPAddr, nNucleusID, svError);
|
||||
if (bCompBanned)
|
||||
{
|
||||
if (!ThreadInMainThread())
|
||||
@ -50,6 +50,7 @@ void SV_ProcessBulkCheck(const BannedVec_t& bannedVec)
|
||||
|
||||
void SV_CheckForBan(const BannedVec_t* pBannedVec /*= nullptr*/)
|
||||
{
|
||||
Assert(ThreadInMainThread());
|
||||
BannedVec_t bannedVec;
|
||||
|
||||
for (int c = 0; c < MAX_PLAYERS; c++) // Loop through all possible client instances.
|
||||
|
@ -27,7 +27,7 @@ inline bool* s_bIsDedicated = nullptr;
|
||||
void SV_InitGameDLL();
|
||||
void SV_ShutdownGameDLL();
|
||||
bool SV_ActivateServer();
|
||||
void SV_IsClientBanned(const string& svIPAddr, const uint64_t nNucleusID);
|
||||
void SV_IsClientBanned(const string& svIPAddr, const uint64_t nNucleusID, const string& svPersonaName);
|
||||
void SV_CheckForBan(const BannedVec_t* pBannedVec = nullptr);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -265,9 +265,11 @@ bool CPylon::GetBannedList(const BannedVec_t& inBannedVec, BannedVec_t& outBanne
|
||||
// &outReason - <- contains banned reason if any.
|
||||
// Output : True if banned, false if not banned.
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CPylon::CheckForBan(const string& ipAddress, const uint64_t nucleusId, string& outReason) const
|
||||
bool CPylon::CheckForBan(const string& ipAddress, const uint64_t nucleusId,
|
||||
const string& personaName, string& outReason) const
|
||||
{
|
||||
nlohmann::json requestJson = nlohmann::json::object();
|
||||
requestJson["name"] = personaName;
|
||||
requestJson["id"] = nucleusId;
|
||||
requestJson["ip"] = ipAddress;
|
||||
|
||||
|
@ -11,7 +11,7 @@ public:
|
||||
bool PostServerHost(string& outMessage, string& svOutToken, const NetGameServer_t& netGameServer) const;
|
||||
|
||||
bool GetBannedList(const BannedVec_t& inBannedVec, BannedVec_t& outBannedVec) const;
|
||||
bool CheckForBan(const string& ipAddress, const uint64_t nucleusId, string& outReason) const;
|
||||
bool CheckForBan(const string& ipAddress, const uint64_t nucleusId, const string& personaName, string& outReason) const;
|
||||
|
||||
void ExtractError(const nlohmann::json& resultBody, string& outMessage, CURLINFO status, const char* errorText = nullptr) const;
|
||||
void ExtractError(const string& response, string& outMessage, CURLINFO status, const char* messageText = nullptr) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user