mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 06:42:26 +00:00
Packet logging support for debugging and educational purposes.
This commit is contained in:
parent
8240b0f05b
commit
c3a0ab3aa1
4 changed files with 19 additions and 0 deletions
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -96,6 +96,11 @@ Sys_Quit
|
|||
void
|
||||
Sys_Quit (void)
|
||||
{
|
||||
|
||||
#ifdef PACKET_LOGGING
|
||||
Net_LogStop();
|
||||
#endif
|
||||
|
||||
exit (0); // appkit isn't running
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,9 @@ Sys_Quit
|
|||
void
|
||||
Sys_Quit (void)
|
||||
{
|
||||
#ifdef PACKET_LOGGING
|
||||
Net_LogStop();
|
||||
#endif
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue