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:
parent
4a93c84adb
commit
ac6534615c
@ -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:
|
||||
{
|
||||
|
@ -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:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user