Packet logging support for debugging and educational purposes.

This commit is contained in:
Dabb 2000-12-11 15:30:52 +00:00
parent 8240b0f05b
commit c3a0ab3aa1
4 changed files with 19 additions and 0 deletions

View file

@ -284,6 +284,9 @@ NET_GetPacket (void)
return false;
}
#ifdef PACKET_LOGGING
Log_Incoming_Packet(net_message_buffer,net_message.cursize);
#endif
return ret;
}
@ -297,6 +300,10 @@ NET_SendPacket (int length, void *data, netadr_t to)
NetadrToSockadr (&to, &addr);
#ifdef PACKET_LOGGING
Log_Outgoing_Packet(data,length);
#endif
ret =
sendto (net_socket, data, length, 0, (struct sockaddr *) &addr,
sizeof (addr));

View file

@ -1813,6 +1813,10 @@ SV_InitNet (void)
Netchan_Init ();
#ifdef PACKET_LOGGING
Net_Log_Init();
#endif
// heartbeats will allways be sent to the id master
svs.last_heartbeat = -99999; // send immediately
// NET_StringToAdr ("192.246.40.70:27000", &idmaster_adr);

View file

@ -96,6 +96,11 @@ Sys_Quit
void
Sys_Quit (void)
{
#ifdef PACKET_LOGGING
Net_LogStop();
#endif
exit (0); // appkit isn't running
}

View file

@ -138,6 +138,9 @@ Sys_Quit
void
Sys_Quit (void)
{
#ifdef PACKET_LOGGING
Net_LogStop();
#endif
exit (0);
}