TraversalClient: Use u32 instead of enet_uint32
Lessens the dependence on the enet library (and we really don't need to rely on a third-party library for a 32-bit integer type)
This commit is contained in:
parent
f1e92a1eae
commit
c23a998f9d
|
@ -243,7 +243,7 @@ void TraversalClient::ResendPacket(OutgoingTraversalPacketInfo* info)
|
||||||
|
|
||||||
void TraversalClient::HandleResends()
|
void TraversalClient::HandleResends()
|
||||||
{
|
{
|
||||||
enet_uint32 now = enet_time_get();
|
const u32 now = enet_time_get();
|
||||||
for (auto& tpi : m_OutgoingTraversalPackets)
|
for (auto& tpi : m_OutgoingTraversalPackets)
|
||||||
{
|
{
|
||||||
if (now - tpi.sendTime >= (u32)(300 * tpi.tries))
|
if (now - tpi.sendTime >= (u32)(300 * tpi.tries))
|
||||||
|
@ -265,7 +265,7 @@ void TraversalClient::HandleResends()
|
||||||
|
|
||||||
void TraversalClient::HandlePing()
|
void TraversalClient::HandlePing()
|
||||||
{
|
{
|
||||||
enet_uint32 now = enet_time_get();
|
const u32 now = enet_time_get();
|
||||||
if (m_State == Connected && now - m_PingTime >= 500)
|
if (m_State == Connected && now - m_PingTime >= 500)
|
||||||
{
|
{
|
||||||
TraversalPacket ping = {};
|
TraversalPacket ping = {};
|
||||||
|
|
|
@ -59,7 +59,7 @@ private:
|
||||||
{
|
{
|
||||||
TraversalPacket packet;
|
TraversalPacket packet;
|
||||||
int tries;
|
int tries;
|
||||||
enet_uint32 sendTime;
|
u32 sendTime;
|
||||||
};
|
};
|
||||||
void HandleServerPacket(TraversalPacket* packet);
|
void HandleServerPacket(TraversalPacket* packet);
|
||||||
// called from NetHost
|
// called from NetHost
|
||||||
|
@ -80,7 +80,7 @@ private:
|
||||||
ENetAddress m_ServerAddress{};
|
ENetAddress m_ServerAddress{};
|
||||||
std::string m_Server;
|
std::string m_Server;
|
||||||
u16 m_port;
|
u16 m_port;
|
||||||
enet_uint32 m_PingTime = 0;
|
u32 m_PingTime = 0;
|
||||||
};
|
};
|
||||||
extern std::unique_ptr<TraversalClient> g_TraversalClient;
|
extern std::unique_ptr<TraversalClient> g_TraversalClient;
|
||||||
// the NetHost connected to the TraversalClient.
|
// the NetHost connected to the TraversalClient.
|
||||||
|
|
Loading…
Reference in New Issue