Initialize members net-sessions in the class

With this members of `CNetClientSession` and `CNetServerSession` get
initialized within the class instead of the constructor.
This commit is contained in:
phosit
2026-03-07 14:57:49 +01:00
parent 0c4bcd9139
commit 789d24aa1c
2 changed files with 12 additions and 14 deletions
+2 -4
View File
@@ -36,9 +36,7 @@ constexpr int NETCLIENT_POLL_TIMEOUT = 50;
constexpr int CHANNEL_COUNT = 1;
CNetClientSession::CNetClientSession(CNetClient& client) :
m_Client(client), m_FileTransferer(*this), m_Host(nullptr), m_Server(nullptr),
m_Stats(nullptr), m_IncomingMessages(16), m_OutgoingMessages(16),
m_LoopRunning(false), m_ShouldShutdown(false), m_MeanRTT(0), m_LastReceivedTime(0)
m_Client(client), m_FileTransferer(*this)
{
}
@@ -239,7 +237,7 @@ u32 CNetClientSession::GetMeanRTT() const
}
CNetServerSession::CNetServerSession(CNetServerWorker& server, ENetPeer* peer) :
m_Server(server), m_FileTransferer(*this), m_Peer(peer), m_HostID(0), m_GUID(), m_UserName()
m_Server(server), m_FileTransferer(*this), m_Peer(peer)
{
}