Network/ENetPeer: Fix enet stuff
This commit is contained in:
parent
f2487bbcba
commit
6dfc866a4d
|
|
@ -286,6 +286,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
UInt32 serviceTime = m_host->GetServiceTime();
|
UInt32 serviceTime = m_host->GetServiceTime();
|
||||||
|
|
||||||
|
auto insertPosition = m_outgoingReliableCommands.begin();
|
||||||
|
|
||||||
auto it = m_sentReliableCommands.begin();
|
auto it = m_sentReliableCommands.begin();
|
||||||
for (; it != m_sentReliableCommands.end();)
|
for (; it != m_sentReliableCommands.end();)
|
||||||
{
|
{
|
||||||
|
|
@ -317,17 +319,14 @@ namespace Nz
|
||||||
command.roundTripTimeout = m_roundTripTime + 4 * m_roundTripTimeVariance;
|
command.roundTripTimeout = m_roundTripTime + 4 * m_roundTripTimeVariance;
|
||||||
command.roundTripTimeoutLimit = m_timeoutLimit * command.roundTripTimeout;
|
command.roundTripTimeoutLimit = m_timeoutLimit * command.roundTripTimeout;
|
||||||
|
|
||||||
m_outgoingReliableCommands.emplace_front(std::move(command));
|
m_outgoingReliableCommands.insert(insertPosition, std::move(command));
|
||||||
it = m_sentReliableCommands.erase(it);
|
it = m_sentReliableCommands.erase(it);
|
||||||
|
|
||||||
// Okay this should just never procs, I don't see how it would be possible
|
if (it == m_sentReliableCommands.begin() && !m_sentReliableCommands.empty())
|
||||||
/*if (currentCommand == enet_list_begin(&peer->sentReliableCommands) &&
|
|
||||||
!enet_list_empty(&peer->sentReliableCommands))
|
|
||||||
{
|
{
|
||||||
outgoingCommand = (ENetOutgoingCommand *) currentCommand;
|
OutgoingCommand& outgoingCommand = *it;
|
||||||
|
m_nextTimeout = outgoingCommand.sentTime + outgoingCommand.roundTripTimeout;
|
||||||
peer->nextTimeout = outgoingCommand->sentTime + outgoingCommand->roundTripTimeout;
|
}
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue