Skip to content

Commit

Permalink
Use GetTickCount64_() instead of current unix timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
xLuxy committed Jul 8, 2019
1 parent 0c7d989 commit e733b37
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
8 changes: 1 addition & 7 deletions Client/mods/deathmatch/logic/CRemoteCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*****************************************************************************/

#include "StdInc.h"
#include <ctime>

using std::list;

Expand Down Expand Up @@ -236,12 +235,7 @@ CRemoteCall::~CRemoteCall()

void CRemoteCall::MakeCall()
{
time_t timer;

time(&timer);
localtime(&timer);

m_iStartTime = timer;
m_iStartTime = GetTickCount64_();

// GetDomainFromURL requires protocol://, but curl does not (defaults to http)
SString strDomain = g_pCore->GetWebCore()->GetDomainFromURL(m_strURL);
Expand Down
4 changes: 2 additions & 2 deletions Client/mods/deathmatch/logic/CRemoteCalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CRemoteCall
bool m_bIsFetch;
class CLuaMain* m_VM;
CLuaFunctionRef m_iFunction;
signed int m_iStartTime;
long long m_iStartTime;
SString m_strURL;
SString m_strQueueName;
CLuaArguments m_FetchArguments;
Expand All @@ -47,7 +47,7 @@ class CRemoteCall
const SDownloadStatus& GetDownloadStatus();

CLuaMain* GetVM() { return m_VM; };
signed int GetStartTime() { return m_iStartTime; };
long long GetStartTime() { return m_iStartTime; };
SString GetURL() { return m_strURL; };
SString GetQueueName() { return m_strQueueName; };
bool IsFetch() { return m_bIsFetch; }
Expand Down
8 changes: 1 addition & 7 deletions Server/mods/deathmatch/logic/CRemoteCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*****************************************************************************/

#include "StdInc.h"
#include <ctime>

extern CGame* g_pGame;

Expand Down Expand Up @@ -237,12 +236,7 @@ CRemoteCall::~CRemoteCall()

void CRemoteCall::MakeCall()
{
time_t timer;

time(&timer);
localtime(&timer);

m_iStartTime = timer;
m_iStartTime = GetTickCount64_();

m_downloadMode = g_pGame->GetRemoteCalls()->GetDownloadModeForQueueName(m_strQueueName);
CNetHTTPDownloadManagerInterface* pDownloadManager = g_pNetServer->GetHTTPDownloadManager(m_downloadMode);
Expand Down
6 changes: 3 additions & 3 deletions Server/mods/deathmatch/logic/CRemoteCalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CRemoteCall
bool m_bIsFetch;
class CLuaMain* m_VM;
CLuaFunctionRef m_iFunction;
signed int m_iStartTime;
long long m_iStartTime;
SString m_strURL;
SString m_strQueueName;
CLuaArguments m_FetchArguments;
Expand All @@ -49,7 +49,7 @@ class CRemoteCall
const SDownloadStatus& GetDownloadStatus();

CLuaMain* GetVM() { return m_VM; };
signed int GetStartTime() { return m_iStartTime; };
long long GetStartTime() { return m_iStartTime; };
SString GetURL() { return m_strURL; };
SString GetQueueName() { return m_strQueueName; };
CLuaArguments& GetFetchArguments() { return m_FetchArguments; };
Expand Down Expand Up @@ -94,4 +94,4 @@ class CRemoteCalls

EDownloadModeType GetDownloadModeForQueueName(const SString& strQueueName);
EDownloadModeType GetDownloadModeFromQueueIndex(uint uiIndex);
};
};

0 comments on commit e733b37

Please sign in to comment.