Jessica92
New Member
- Joined
- Mar 24, 2018
- Messages
- 6
- Reaction score
- 2
I've just started to learn OTC and I'm now stuck at something new.
I'm using TFS 1.1 sources for an 8.0-8.1 OT.
I've managed to make the OTC to show ping (even thou it wasn't in 8.0~).
I've added the codes in the TFS sources for ping, taken from the official 10.97 sources.
protocolgame.cpp (TFS)
My issue now is that the ping in OTC is obviously wrong, showing 5-50 ms ping, on a local server.
I get a terminal error in OTC. ERROR: got an invalid ping from server
And every 1-2 minutes I'm getting kicked from the game.
I've tried to follow the codes to understand them, however I'm failing at that.
game.cpp (OTC)
So please, why is the problem occurring and how do I prevent it?
got any clues on this are? @gugu15 @margoh
I'm using TFS 1.1 sources for an 8.0-8.1 OT.
I've managed to make the OTC to show ping (even thou it wasn't in 8.0~).
I've added the codes in the TFS sources for ping, taken from the official 10.97 sources.
protocolgame.cpp (TFS)
C++:
case 0x1D: addGameTask(&Game::playerReceivePingBack, player->getID()); break;
case 0x1E: addGameTask(&Game::playerReceivePing, player->getID()); break;
My issue now is that the ping in OTC is obviously wrong, showing 5-50 ms ping, on a local server.
I get a terminal error in OTC. ERROR: got an invalid ping from server
And every 1-2 minutes I'm getting kicked from the game.
I've tried to follow the codes to understand them, however I'm failing at that.
game.cpp (OTC)
C++:
void Game::processPingBack()
{
m_pingReceived++;
if(m_pingReceived == m_pingSent)
m_ping = m_pingTimer.elapsed_millis();
else
g_logger.error("got an invalid ping from server");
g_lua.callGlobalField("g_game", "onPingBack", m_ping);
m_pingEvent = g_dispatcher.scheduleEvent([this] {
g_game.ping();
}, m_pingDelay);
}
So please, why is the problem occurring and how do I prevent it?
got any clues on this are? @gugu15 @margoh
Last edited: