adding even more log

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@13237 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hilnius 2013-07-15 12:56:19 +00:00
parent 12107053c0
commit e95bafca44

View File

@ -66,12 +66,14 @@ void SynchronizationProtocol::notifyEvent(Event* event)
NetworkString response;
response.ai8(event->data.gui8(talk_id)).ai32(token).ai8(0).ai32(sequence);
m_listener->sendMessage(this, peers[talk_id], response, false);
//Log::info("SynchronizationProtocol", "Answering sequence %u", sequence);
Log::verbose("SynchronizationProtocol", "Answering sequence %u", sequence);
if (event->data.size() == 12 && !m_listener->isServer()) // countdown time in the message
{
uint16_t time_to_start = event->data.gui16(10);
Log::info("SynchronizationProtocol", "Starting game in %u.", time_to_start);
}
else
Log::verbose("SynchronizationProtocol", "No countdown for now.");
}
else // response
{
@ -87,7 +89,7 @@ void SynchronizationProtocol::notifyEvent(Event* event)
m_successed_pings[peer_id]++;
m_average_ping[peer_id] = (int)((m_total_diff[peer_id]/m_successed_pings[peer_id])*1000.0);
//Log::verbose("SynchronizationProtocol", "Ping is %u", m_average_ping[peer_id]);
Log::verbose("SynchronizationProtocol", "Ping is %u", m_average_ping[peer_id]);
}
}
@ -115,8 +117,11 @@ void SynchronizationProtocol::update()
ns.ai8(i).addUInt32(peers[i]->getClientServerToken()).addUInt8(1).addUInt32(m_pings[i].size());
// now add the countdown if necessary
if (m_countdown_activated)
{
ns.ai16(m_countdown);
//Log::verbose("SynchronizationProtocol", "Added sequence number %u", m_pings[i].size());
Log::verbose("SynchronizationProtocol", "Countdown value : %u", m_countdown);
}
Log::verbose("SynchronizationProtocol", "Added sequence number %u for peer %d", m_pings[i].size(), i);
timer = current_time;
m_pings[i].insert(std::pair<int,double>(m_pings_count[i], timer));
m_listener->sendMessage(this, peers[i], ns, false);