From 06698bea33102e9f62bd69d4b36adf482daebf38 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 15 Feb 2023 20:49:14 +0100 Subject: [PATCH] Implement 'CNetChan::GetTimeConnected' 'CNetChan::GetConnectTime' has been removed in favor of 'CNetChan::GetTimeConnected'. --- r5dev/engine/net_chan.cpp | 5 +++-- r5dev/engine/net_chan.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/r5dev/engine/net_chan.cpp b/r5dev/engine/net_chan.cpp index 4a423abf..420ec9c4 100644 --- a/r5dev/engine/net_chan.cpp +++ b/r5dev/engine/net_chan.cpp @@ -154,9 +154,10 @@ int CNetChan::GetSequenceNr(int flow) const // Purpose: gets the netchannel connect time // Output : double //----------------------------------------------------------------------------- -double CNetChan::GetConnectTime(void) const +double CNetChan::GetTimeConnected(void) const { - return this->connect_time; + double t = *g_pNetTime - connect_time; + return (t > 0.0) ? t : 0.0; } //----------------------------------------------------------------------------- diff --git a/r5dev/engine/net_chan.h b/r5dev/engine/net_chan.h index e4ea5a4f..6a1617f5 100644 --- a/r5dev/engine/net_chan.h +++ b/r5dev/engine/net_chan.h @@ -97,7 +97,7 @@ public: int GetSequenceNr(int flow) const; float GetTimeoutSeconds(void) const; - double GetConnectTime(void) const; + double GetTimeConnected(void) const; int GetSocket(void) const; bool IsOverflowed(void) const;