From ff59db1b95050836fd47fe3fde9183fd272dd991 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 14 Jun 2022 21:53:03 +0200 Subject: [PATCH] Light improvements Update comments. Proper type for 'user_creds::m_nUserID'. Proper type for 'CClient::SetUserID'. Added 'CClient::SetHandle'. --- r5dev/engine/client/client.cpp | 14 +++++++++++--- r5dev/engine/client/client.h | 3 ++- r5dev/engine/server/server.h | 2 +- r5dev/public/include/bansystem.h | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/r5dev/engine/client/client.cpp b/r5dev/engine/client/client.cpp index 75a67408..d534ae3b 100644 --- a/r5dev/engine/client/client.cpp +++ b/r5dev/engine/client/client.cpp @@ -20,7 +20,7 @@ CClient* CClient::GetClient(int nIndex) const } //--------------------------------------------------------------------------------- -// Purpose: gets the userID of this client +// Purpose: gets the handle of this client //--------------------------------------------------------------------------------- uint16_t CClient::GetHandle(void) const { @@ -36,7 +36,7 @@ uint32_t CClient::GetUserID(void) const } //--------------------------------------------------------------------------------- -// Purpose: gets the userID of this client +// Purpose: gets the originID of this client //--------------------------------------------------------------------------------- uint64_t CClient::GetOriginID(void) const { @@ -83,10 +83,18 @@ const char* CClient::GetClientName(void) const return m_szClientName; } +//--------------------------------------------------------------------------------- +// Purpose: sets the handle of this client +//--------------------------------------------------------------------------------- +void CClient::SetHandle(uint16_t nHandle) +{ + m_nHandle = nHandle; +} + //--------------------------------------------------------------------------------- // Purpose: sets the userID of this client //--------------------------------------------------------------------------------- -void CClient::SetUserID(std::int32_t nUserID) +void CClient::SetUserID(uint32_t nUserID) { m_nUserID = nUserID; } diff --git a/r5dev/engine/client/client.h b/r5dev/engine/client/client.h index cb869a35..ca1f3752 100644 --- a/r5dev/engine/client/client.h +++ b/r5dev/engine/client/client.h @@ -24,7 +24,8 @@ public: CNetChan* GetNetChan(void) const; const char* GetServerName(void) const; const char* GetClientName(void) const; - void SetUserID(int32_t nUserID); + void SetHandle(uint16_t nHandle); + void SetUserID(uint32_t nUserID); void SetOriginID(uint64_t nOriginID); void SetSignonState(SIGNONSTATE nSignonState); void SetPersistenceState(PERSISTENCE nPersistenceState); diff --git a/r5dev/engine/server/server.h b/r5dev/engine/server/server.h index 26e84e99..1a4b7b9e 100644 --- a/r5dev/engine/server/server.h +++ b/r5dev/engine/server/server.h @@ -23,7 +23,7 @@ struct user_creds_s int32_t m_nchallenge; uint8_t gap2[8]; uint64_t m_nNucleusID; - int64_t m_nUserID; + uint8_t* m_nUserID; }; class CServer : public IServer diff --git a/r5dev/public/include/bansystem.h b/r5dev/public/include/bansystem.h index 73568337..86a5501a 100644 --- a/r5dev/public/include/bansystem.h +++ b/r5dev/public/include/bansystem.h @@ -13,7 +13,7 @@ public: void DeleteEntry(string svIpAddress, uint64_t nOriginID); void AddConnectionRefuse(string svError, uint64_t nOriginID); - void DeleteConnectionRefuse(uint64_t nUserID); + void DeleteConnectionRefuse(uint64_t nOriginID); void BanListCheck(void);