mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 16:06:44 +00:00
[Browser] Use constant instead magic value in PingRakNetServer
This commit is contained in:
parent
b7e45f269b
commit
9992058942
1 changed files with 2 additions and 1 deletions
|
@ -20,6 +20,7 @@ unsigned int PingRakNetServer(const char *addr, unsigned short port)
|
||||||
bool done = false;
|
bool done = false;
|
||||||
int attempt = 0;
|
int attempt = 0;
|
||||||
static const int timeout = 5;
|
static const int timeout = 5;
|
||||||
|
static const int attempts = 5;
|
||||||
RakNet::TimeMS time = PING_UNREACHABLE;
|
RakNet::TimeMS time = PING_UNREACHABLE;
|
||||||
|
|
||||||
RakNet::SocketDescriptor socketDescriptor{0, ""};
|
RakNet::SocketDescriptor socketDescriptor{0, ""};
|
||||||
|
@ -32,7 +33,7 @@ unsigned int PingRakNetServer(const char *addr, unsigned short port)
|
||||||
packet = peer->Receive();
|
packet = peer->Receive();
|
||||||
if (!packet)
|
if (!packet)
|
||||||
{
|
{
|
||||||
if (attempt > 5)
|
if (attempt > attempts)
|
||||||
done = true;
|
done = true;
|
||||||
attempt++;
|
attempt++;
|
||||||
RakSleep(timeout);
|
RakSleep(timeout);
|
||||||
|
|
Loading…
Reference in a new issue