Rename 'v_netadr_t' to 'netadr_t'

Name was used for compatibility reasons. No longer necessary.
This commit is contained in:
Kawe Mazidjatari 2023-01-29 15:12:27 +01:00
parent 0e033cb755
commit 6df498e5c8
9 changed files with 19 additions and 32 deletions

View File

@ -1,5 +1,5 @@
#pragma once
#include "tier1/NetAdr2.h"
#include "tier1/NetAdr.h"
#include "tier1/mempool.h"
#include "common/protocol.h"
#include "public/inetmsghandler.h"
@ -47,7 +47,7 @@ public:
_DWORD m_nChallengeRetryLimit;
_BYTE encrypted_connection_MAYBE;
_BYTE gap79[3];
v_netadr_t addr;
netadr_t addr;
bool m_bUnk_used_during_auth;
char m_bSendChallengeRequest;
_BYTE m_bDoNetParamsReconnect_MAYBE;
@ -85,7 +85,7 @@ public:
float m_flOldTickTime;
_BYTE m_bSignonChallengeReceived;
_DWORD challenge;
v_netadr_t challengeAddr;
netadr_t challengeAddr;
_BYTE byte33C;
_QWORD m_pServerClasses;
int m_nServerClasses;

View File

@ -12,7 +12,7 @@
#include "tier0/fasttimer.h"
#include "tier1/cmd.h"
#include "tier1/cvar.h"
#include "tier1/NetAdr2.h"
#include "tier1/NetAdr.h"
#include "tier2/socketcreator.h"
#include "vpc/keyvalues.h"
#include "datacache/mdlcache.h"

View File

@ -50,7 +50,7 @@ bool NET_ReceiveDatagram(int iSocket, netpacket_s* pInpacket, bool bEncrypted)
// bEncrypt -
// Output : outgoing sequence number for this packet
//-----------------------------------------------------------------------------
int NET_SendDatagram(SOCKET s, void* pPayload, int iLenght, v_netadr_t* pAdr, bool bEncrypt)
int NET_SendDatagram(SOCKET s, void* pPayload, int iLenght, netadr_t* pAdr, bool bEncrypt)
{
int result = v_NET_SendDatagram(s, pPayload, iLenght, pAdr, net_encryptionEnable->GetBool());
if (result && net_tracePayload->GetBool())

View File

@ -31,14 +31,14 @@ inline CMemory p_NET_ReceiveDatagram;
inline auto v_NET_ReceiveDatagram = p_NET_ReceiveDatagram.RCast<bool (*)(int iSocket, netpacket_s* pInpacket, bool bRaw)>();
inline CMemory p_NET_SendDatagram;
inline auto v_NET_SendDatagram = p_NET_SendDatagram.RCast<int (*)(SOCKET s, void* pPayload, int iLenght, v_netadr_t* pAdr, bool bEncrypted)>();
inline auto v_NET_SendDatagram = p_NET_SendDatagram.RCast<int (*)(SOCKET s, void* pPayload, int iLenght, netadr_t* pAdr, bool bEncrypted)>();
inline CMemory p_NET_PrintFunc;
inline auto v_NET_PrintFunc = p_NET_PrintFunc.RCast<void(*)(const char* fmt)>();
///////////////////////////////////////////////////////////////////////////////
bool NET_ReceiveDatagram(int iSocket, netpacket_s* pInpacket, bool bRaw);
int NET_SendDatagram(SOCKET s, void* pPayload, int iLenght, v_netadr_t* pAdr, bool bEncrypted);
int NET_SendDatagram(SOCKET s, void* pPayload, int iLenght, netadr_t* pAdr, bool bEncrypted);
void NET_SetKey(string svNetKey);
void NET_GenerateKey();
void NET_PrintFunc(const char* fmt, ...);
@ -81,7 +81,7 @@ class VNet : public IDetour
v_NET_Shutdown = p_NET_Shutdown.RCast<void (*)(void*, const char*, uint8_t, bool)>(); /*48 89 6C 24 18 56 57 41 56 48 83 EC 30 83 B9 D0*/
v_NET_SetKey = p_NET_SetKey.RCast<void (*)(uintptr_t, const char*)>(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 20 48 8B F9 41 B8*/
v_NET_ReceiveDatagram = p_NET_ReceiveDatagram.RCast<bool (*)(int, netpacket_s*, bool)>(); /*E8 ?? ?? ?? ?? 84 C0 75 35 48 8B D3*/
v_NET_SendDatagram = p_NET_SendDatagram.RCast<int (*)(SOCKET, void*, int, v_netadr_t*, bool)>(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 81 EC ?? 05 00 00*/
v_NET_SendDatagram = p_NET_SendDatagram.RCast<int (*)(SOCKET, void*, int, netadr_t*, bool)>(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 81 EC ?? 05 00 00*/
v_NET_PrintFunc = p_NET_PrintFunc.RCast<void(*)(const char*)>(); /*48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 C3 48*/
}

View File

@ -30,20 +30,7 @@ const char* CNetChan::GetName(void) const
//-----------------------------------------------------------------------------
const char* CNetChan::GetAddress(void) const
{
// Select a static buffer
static char s[4][INET6_ADDRSTRLEN];
static int slot = 0;
int useSlot = (slot++) % 4;
// Render into it
if (!inet_ntop(AF_INET6, &this->remote_address.adr, s[useSlot], sizeof(s[0])))
{
Warning(eDLL_T::ENGINE, "%s - Address conversion failed: %s\n", __FUNCTION__, NET_ErrorString(WSAGetLastError()));
}
// Pray the caller uses it before it gets clobbered
return s[useSlot];
return this->remote_address.ToString();
}
//-----------------------------------------------------------------------------

View File

@ -8,7 +8,7 @@
#define NET_CHAN_H
#include "tier1/bitbuf.h"
#include "tier1/NetAdr2.h"
#include "tier1/NetAdr.h"
#include "tier1/utlmemory.h"
#include "tier1/utlvector.h"
#include "common/netmessages.h"
@ -167,7 +167,7 @@ private:
bool m_bPad;
char m_Name[NET_CHANNELNAME_MAXLEN];
uint8_t m_bRetrySendLong;
v_netadr_t remote_address;
netadr_t remote_address;
};
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) || defined (GAMEDLL_S2)
static_assert(sizeof(CNetChan) == 0x1AD0);

View File

@ -68,7 +68,7 @@ bool CServer::AuthClient(user_creds_s* pChallenge)
uint64_t nNucleusID = pChallenge->m_nNucleusID;
char pszAddresBuffer[INET6_ADDRSTRLEN]; // Render the client's address.
pChallenge->m_nAddr.GetAddress(pszAddresBuffer, sizeof(pszAddresBuffer));
pChallenge->m_nAddr.ToString(pszAddresBuffer, sizeof(pszAddresBuffer));
const bool bEnableLogging = sv_showconnecting->GetBool();
if (bEnableLogging)
@ -126,7 +126,7 @@ CClient* CServer::ConnectClient(CServer* pServer, user_creds_s* pChallenge)
// *pChallenge -
// *szMessage -
//---------------------------------------------------------------------------------
void CServer::RejectConnection(int iSocket, v_netadr_t* pNetAdr, const char* szMessage)
void CServer::RejectConnection(int iSocket, netadr_t* pNetAdr, const char* szMessage)
{
v_CServer_RejectConnection(this, iSocket, pNetAdr, szMessage);
}

View File

@ -1,5 +1,5 @@
#pragma once
#include "tier1/NetAdr2.h"
#include "tier1/NetAdr.h"
#include "networksystem/pylon.h"
#include "engine/client/client.h"
#include "engine/networkstringtable.h"
@ -18,7 +18,7 @@ enum class server_state_t
struct user_creds_s
{
v_netadr_t m_nAddr;
netadr_t m_nAddr;
int32_t m_nProtocolVer;
int32_t m_nChallenge;
uint32_t m_nReservation;
@ -41,7 +41,7 @@ public:
bool IsLoading(void) const { return m_State == server_state_t::ss_loading; }
bool IsDedicated(void) const { return g_bDedicated; }
bool AuthClient(user_creds_s* pChallenge);
void RejectConnection(int iSocket, v_netadr_t* pNetAdr, const char* szMessage);
void RejectConnection(int iSocket, netadr_t* pNetAdr, const char* szMessage);
static CClient* ConnectClient(CServer* pServer, user_creds_s* pChallenge);
static void FrameJob(double flFrameTime, bool bRunOverlays, bool bUniformSnapshotInterval);
#endif // !CLIENT_DLL
@ -91,7 +91,7 @@ inline CMemory p_CServer_Authenticate;
inline auto v_CServer_ConnectClient = p_CServer_Authenticate.RCast<CClient* (*)(CServer* pServer, user_creds_s* pCreds)>();
inline CMemory p_CServer_RejectConnection;
inline auto v_CServer_RejectConnection = p_CServer_RejectConnection.RCast<void* (*)(CServer* pServer, int iSocket, v_netadr_t* pNetAdr, const char* szMessage)>();
inline auto v_CServer_RejectConnection = p_CServer_RejectConnection.RCast<void* (*)(CServer* pServer, int iSocket, netadr_t* pNetAdr, const char* szMessage)>();
///////////////////////////////////////////////////////////////////////////////
class VServer : public IDetour
@ -120,7 +120,7 @@ class VServer : public IDetour
v_CServer_FrameJob = p_CServer_FrameJob.RCast<void (*)(double, bool, bool)>(); /*48 89 6C 24 ?? 56 41 54 41 56*/
v_CServer_ConnectClient = p_CServer_Authenticate.RCast<CClient* (*)(CServer*, user_creds_s*)>(); /*40 55 57 41 55 41 57 48 8D AC 24 ?? ?? ?? ??*/
v_CServer_RejectConnection = p_CServer_RejectConnection.RCast<void* (*)(CServer*, int, v_netadr_t*, const char*)>(); /*4C 89 4C 24 ?? 53 55 56 57 48 81 EC ?? ?? ?? ?? 49 8B D9*/
v_CServer_RejectConnection = p_CServer_RejectConnection.RCast<void* (*)(CServer*, int, netadr_t*, const char*)>(); /*4C 89 4C 24 ?? 53 55 56 57 48 81 EC ?? ?? ?? ?? 49 8B D9*/
#endif // !CLIENT_DLL
}
virtual void GetVar(void) const

View File

@ -53,7 +53,7 @@ struct CS_INetChannelHandler : INetChannelHandler
typedef struct netpacket_s netpacket_t;
typedef struct __declspec(align(8)) netpacket_s
{
v_netadr_t from;
netadr_t from;
int source;
double received;
uint8_t* pData;