From 59af89235bfb9189dec1fcee40a9231d03690d27 Mon Sep 17 00:00:00 2001 From: "mtilden@gmail.com" Date: Tue, 27 Dec 2011 18:39:06 +0000 Subject: - Added basic ping handling. Not sure what's up with the MC client, though. It doesn't seem to end up giving good results like the KA packet return is hanging and waiting for other things to process instead of being handled on its own to give a true result. Feel free to update if there's any way to deliver truer results. git-svn-id: http://mc-server.googlecode.com/svn/trunk@133 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlayer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/cPlayer.cpp') diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp index dcc9de177..4e743a2fe 100644 --- a/source/cPlayer.cpp +++ b/source/cPlayer.cpp @@ -239,14 +239,14 @@ void cPlayer::Tick(float a_Dt) } cTimer t1; - // Send Player List (Once per m_LastPlayerListTime/1000 second(s)) - if (m_LastPlayerListTime + cPlayer::E_PLAYER_LIST_TIME <= t1.GetNowTime()) { + // Send Player List (Once per m_LastPlayerListTime/1000 ms) + if (m_LastPlayerListTime + cPlayer::PLAYER_LIST_TIME_MS <= t1.GetNowTime()) { cWorld::PlayerList PlayerList = cRoot::Get()->GetWorld()->GetAllPlayers(); for( cWorld::PlayerList::iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr ) { if ((*itr) && (*itr)->GetClientHandle() && !((*itr)->GetClientHandle()->IsDestroyed())) { - cPacket_PlayerListItem PlayerList(GetColor() + GetName(), true, (*itr)->GetClientHandle()->GetPing()); - (*itr)->GetClientHandle()->Send( PlayerList ); + cPacket_PlayerListItem PlayerListItem(GetColor() + GetName(), true, (*itr)->GetClientHandle()->GetPing()); + (*itr)->GetClientHandle()->Send( PlayerListItem ); } } m_LastPlayerListTime = t1.GetNowTime(); -- cgit v1.2.3