Added server has timed out logic to client. (>'')>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user