Added server has timed out logic to client. (>'')>

This commit is contained in:
stiffly
2016-01-20 16:27:53 +01:00
parent 4d01cdf895
commit 3376f4a16e
5 changed files with 32 additions and 19 deletions
+1 -2
View File
@@ -182,7 +182,6 @@ void Server::sendPing()
void Server::checkForTimeOuts()
{
int timeOutTimeMs = 5000;
int startPing = 1000 * m_StartPingTime
/ static_cast<double>(CLOCKS_PER_SEC);
@@ -190,7 +189,7 @@ void Server::checkForTimeOuts()
if (m_PlayerDefinitions[i].Endpoint.address() != boost::asio::ip::address()) {
int stopPing = 1000 * m_PlayerDefinitions[i].StopTime /
static_cast<double>(CLOCKS_PER_SEC);
if (startPing > stopPing + timeOutTimeMs) {
if (startPing > stopPing + TIMEOUTMS) {
LOG_INFO("Player %i timed out!", i);
disconnect(i);
}