From a961276b6f3167b47004e1b6b0a4efab96fddec2 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 9 May 2012 19:14:36 +0000 Subject: (svn r24221) -Fix [FS#5166]: Lag counters were not properly reset when switching states making it possible to get disconnected for lagging when you weren't lagging --- src/network/network_server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/network') diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 8cd1a5921..cd4e5f564 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -450,6 +450,8 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendNeedGamePassword() if (this->status >= STATUS_AUTH_GAME) return this->CloseConnection(NETWORK_RECV_STATUS_MALFORMED_PACKET); this->status = STATUS_AUTH_GAME; + /* Reset 'lag' counters */ + this->last_frame = this->last_frame_server = _frame_counter; Packet *p = new Packet(PACKET_SERVER_NEED_GAME_PASSWORD); this->SendPacket(p); @@ -463,6 +465,8 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendNeedCompanyPassword() if (this->status >= STATUS_AUTH_COMPANY) return this->CloseConnection(NETWORK_RECV_STATUS_MALFORMED_PACKET); this->status = STATUS_AUTH_COMPANY; + /* Reset 'lag' counters */ + this->last_frame = this->last_frame_server = _frame_counter; Packet *p = new Packet(PACKET_SERVER_NEED_COMPANY_PASSWORD); p->Send_uint32(_settings_game.game_creation.generation_seed); @@ -481,6 +485,9 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendWelcome() if (this->status >= STATUS_AUTHORIZED) return this->CloseConnection(NETWORK_RECV_STATUS_MALFORMED_PACKET); this->status = STATUS_AUTHORIZED; + /* Reset 'lag' counters */ + this->last_frame = this->last_frame_server = _frame_counter; + _network_game_info.clients_on++; p = new Packet(PACKET_SERVER_WELCOME); -- cgit v1.2.3-70-g09d2