(svn r21254) -Change: show a different "lag" message when a client is lagging because of connection trouble or lagging because the client is just slow

This commit is contained in:
rubidium
2010-11-19 12:33:19 +00:00
parent 9ed0c28c11
commit d7eafddc18
3 changed files with 17 additions and 4 deletions

View File

@@ -30,6 +30,7 @@ NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s)
this->sock = s;
this->last_frame = _frame_counter;
this->last_frame_server = _frame_counter;
this->last_packet = _realtime_tick;
}
/**
@@ -70,6 +71,8 @@ NetworkRecvStatus NetworkGameSocketHandler::HandlePacket(Packet *p)
{
PacketGameType type = (PacketGameType)p->Recv_uint8();
this->last_packet = _realtime_tick;
switch (this->HasClientQuit() ? PACKET_END : type) {
GAME_COMMAND(PACKET_SERVER_FULL)
GAME_COMMAND(PACKET_SERVER_BANNED)

View File

@@ -473,6 +473,7 @@ public:
uint32 last_frame; ///< Last frame we have executed
uint32 last_frame_server; ///< Last frame the server has executed
CommandQueue incoming_queue; ///< The command-queue awaiting handling
uint last_packet; ///< Time we received the last frame.
NetworkRecvStatus CloseConnection(bool error = true);
virtual NetworkRecvStatus CloseConnection(NetworkRecvStatus status) = 0;