Network: Include extra info in PACKET_CLIENT_ERROR packets

Log more details in server when PACKET_CLIENT_ERROR received
This commit is contained in:
Jonathan G Rennison
2021-05-14 20:27:13 +01:00
parent e04218b528
commit f3e0507c54
5 changed files with 15 additions and 5 deletions

View File

@@ -25,7 +25,7 @@
* @param s The socket to connect with.
*/
NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s) : info(nullptr), client_id(INVALID_CLIENT_ID),
last_frame(_frame_counter), last_frame_server(_frame_counter)
last_frame(_frame_counter), last_frame_server(_frame_counter), last_pkt_type(PACKET_END)
{
this->sock = s;
this->last_packet = std::chrono::steady_clock::now();
@@ -67,6 +67,7 @@ NetworkRecvStatus NetworkGameSocketHandler::HandlePacket(Packet *p)
PacketGameType type = (PacketGameType)p->Recv_uint8();
this->last_packet = std::chrono::steady_clock::now();
this->last_pkt_type = type;
DEBUG(net, 3, "[tcp/game] received packet type %d from client %d, %s", type, this->client_id, this->GetDebugInfo().c_str());