fixing a ENet connection issue

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/networking@13125 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hilnius 2013-07-08 15:47:28 +00:00
parent 4a93c84adb
commit ac6534615c
2 changed files with 12 additions and 0 deletions

View File

@ -89,6 +89,12 @@ void ConnectToPeer::update()
}
break;
case CONNECTING: // waiting the peer to connect
static double timer = 0;
if (Time::getRealTime() > timer+5.0) // every 5 seconds
{
timer = Time::getRealTime();
NetworkManager::getInstance()->connect(m_peer_address);
}
break;
case CONNECTED:
{

View File

@ -121,6 +121,12 @@ void ConnectToServer::update()
}
break;
case CONNECTING: // waiting the server to answer our connection
static double timer = 0;
if (Time::getRealTime() > timer+5.0) // every 5 seconds
{
timer = Time::getRealTime();
NetworkManager::getInstance()->connect(m_server_address);
}
break;
case CONNECTED:
{