fix problem with ULL for 32-bit, on 64-bit this wasn't a problem as the numbers were all treated as 8 bytes wide (on Linux anyway), but for 32-bit this truncated the numbers and caused weird problems;

pull/69/head
Bryan Biedenkapp 2 years ago
parent 7a7dff3388
commit 52e3677270

@ -27,7 +27,7 @@ using namespace network;
// Constants // Constants
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
#define MAX_SERVER_DIFF 250 // maximum difference in time between a server timestamp and local timestamp in milliseconds #define MAX_SERVER_DIFF 250ULL // maximum difference in time between a server timestamp and local timestamp in milliseconds
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Public Class Members // Public Class Members
@ -609,7 +609,7 @@ void Network::clock(uint32_t ms)
// check the ping RTT and report any over the maximum defined time // check the ping RTT and report any over the maximum defined time
uint64_t dt = (uint64_t)fabs(now - serverNow); uint64_t dt = (uint64_t)fabs(now - serverNow);
if (dt > MAX_SERVER_DIFF) if (dt > MAX_SERVER_DIFF)
LogWarning(LOG_NET, "PEER %u pong, time delay greater than %ums, now = %u, server = %u, dt = %u", m_peerId, MAX_SERVER_DIFF, now, serverNow, dt); LogWarning(LOG_NET, "PEER %u pong, time delay greater than %llums, now = %llu, server = %llu, dt = %llu", m_peerId, MAX_SERVER_DIFF, now, serverNow, dt);
} }
break; break;
default: default:

Loading…
Cancel
Save

Powered by TurnKey Linux.