Partial support for protocol 1020 and minimize lag

I am able to login in global Tibia however there are game protocol errors
* there is a new opcode 167, which I dont know what it is
* there are changes in opcode 147 which handles text messages that I don't know too

Connection writing was optimized, playing "lag" should improve by 10ms,
and improve much more in systems with low fps
This commit is contained in:
Eduardo Bart
2013-11-10 20:09:46 -02:00
parent 3cff331723
commit d32f71c2b9
4 changed files with 8 additions and 3 deletions

View File

@@ -147,6 +147,11 @@ void Application::poll()
#endif
g_dispatcher.poll();
// poll connection again to flush pending write
#ifdef FW_NET
Connection::poll();
#endif
}
void Application::exit()

View File

@@ -126,7 +126,7 @@ void Connection::write(uint8* buffer, size_t size)
m_outputStream = std::shared_ptr<asio::streambuf>(new asio::streambuf);
m_delayedWriteTimer.cancel();
m_delayedWriteTimer.expires_from_now(boost::posix_time::milliseconds(10));
m_delayedWriteTimer.expires_from_now(boost::posix_time::milliseconds(0));
m_delayedWriteTimer.async_wait(std::bind(&Connection::onCanWrite, asConnection(), std::placeholders::_1));
}