Fixed a bug in the packet handling of the client. This fixes the problem that games are not properly started, and that the player list is not properly updated.

This commit is contained in:
lotodore
2009-06-15 21:42:57 +00:00
parent 1acbeba426
commit 3d57f65e2b
3 changed files with 33 additions and 41 deletions
-24
View File
@@ -701,30 +701,6 @@ AbstractClientStateReceiving::~AbstractClientStateReceiving()
{
}
void
AbstractClientStateReceiving::HandleRead(const boost::system::error_code& ec, boost::shared_ptr<ClientThread> client, size_t bytesRead)
{
if (!ec)
{
ReceiveBuffer &buf = client->GetContext().GetSessionData()->GetReceiveBuffer();
buf.recvBufUsed += bytesRead;
client->GetReceiver().ScanPackets(buf);
while (!buf.receivedPackets.empty())
{
boost::shared_ptr<NetPacket> packet = buf.receivedPackets.front();
buf.receivedPackets.pop_front();
if (packet)
HandlePacket(client, packet);
}
}
else
{
if (ec != boost::asio::error::operation_aborted)
throw NetException(__FILE__, __LINE__, ERR_SOCK_CONN_RESET, 0);
}
}
void
AbstractClientStateReceiving::HandlePacket(boost::shared_ptr<ClientThread> client, boost::shared_ptr<NetPacket> tmpPacket)
{