Network/ENetHost: Fix service time precision
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Bitset.hpp>
|
||||
#include <Nazara/Core/Clock.hpp>
|
||||
#include <Nazara/Core/MemoryPool.hpp>
|
||||
#include <Nazara/Network/ENetCompressor.hpp>
|
||||
#include <Nazara/Network/ENetPeer.hpp>
|
||||
@@ -95,6 +96,8 @@ namespace Nz
|
||||
|
||||
void ThrottleBandwidth();
|
||||
|
||||
inline void UpdateServiceTime();
|
||||
|
||||
static std::size_t GetCommandSize(UInt8 commandNumber);
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
@@ -73,6 +73,12 @@ namespace Nz
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
inline void ENetHost::UpdateServiceTime()
|
||||
{
|
||||
// Compute service time as microseconds for extra precision
|
||||
m_serviceTime = static_cast<UInt32>(GetElapsedMicroseconds() / 1000);
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Network/DebugOff.hpp>
|
||||
|
||||
Reference in New Issue
Block a user