From: <hi...@us...> - 2013-07-13 23:31:59
|
Revision: 13210 http://sourceforge.net/p/supertuxkart/code/13210 Author: hilnius Date: 2013-07-13 23:31:56 +0000 (Sat, 13 Jul 2013) Log Message: ----------- correcting the synchronization protocol Modified Paths: -------------- main/branches/hilnius/src/network/network_manager.cpp main/branches/hilnius/src/network/protocols/synchronization_protocol.cpp Modified: main/branches/hilnius/src/network/network_manager.cpp =================================================================== --- main/branches/hilnius/src/network/network_manager.cpp 2013-07-13 23:16:40 UTC (rev 13209) +++ main/branches/hilnius/src/network/network_manager.cpp 2013-07-13 23:31:56 UTC (rev 13210) @@ -88,7 +88,7 @@ void NetworkManager::notifyEvent(Event* event) { - Log::info("NetworkManager", "EVENT received of type %d", (int)(event->type)); + Log::verbose("NetworkManager", "EVENT received of type %d", (int)(event->type)); STKPeer* peer = *event->peer; if (event->type == EVENT_TYPE_CONNECTED) { @@ -99,7 +99,7 @@ if (event->type == EVENT_TYPE_MESSAGE) { uint32_t addr = peer->getAddress(); - Log::info("NetworkManager", "Message, Sender : %i.%i.%i.%i, message = \"%s\"", + Log::verbose("NetworkManager", "Message, Sender : %i.%i.%i.%i, message = \"%s\"", ((addr>>24)&0xff), ((addr>>16)&0xff), ((addr>>8)&0xff), Modified: main/branches/hilnius/src/network/protocols/synchronization_protocol.cpp =================================================================== --- main/branches/hilnius/src/network/protocols/synchronization_protocol.cpp 2013-07-13 23:16:40 UTC (rev 13209) +++ main/branches/hilnius/src/network/protocols/synchronization_protocol.cpp 2013-07-13 23:31:56 UTC (rev 13210) @@ -89,13 +89,13 @@ void SynchronizationProtocol::update() { static double timer = Time::getRealTime(); - if (Time::getRealTime() > timer+100 && m_pings_count < 100) // max 100 pings (10 seconds) + if (Time::getRealTime() > timer+0.1 && m_pings_count < 100) // max 100 pings (10 seconds) { std::vector<STKPeer*> peers = NetworkManager::getInstance()->getPeers(); for (unsigned int i = 0; i < peers.size(); i++) { NetworkString ns; - ns.ai8(i).addUInt32(peers[i]->getClientServerToken()).addUInt8(1).addUInt32(m_pings_count); + ns.ai8(i).addUInt32(peers[i]->getClientServerToken()).addUInt8(1).addUInt32(m_pings[i].size()); timer = Time::getRealTime(); m_pings[i].push_back(std::pair<double, double>(timer, 0.0)); m_listener->sendMessage(this, peers[i], ns, false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |