mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 23:11:38 +00:00
[qw] Fix incorrect "server to client" log messages
It's not very helpful thinking all the packets are incoming to the client.
This commit is contained in:
parent
eba614336d
commit
748f578856
5 changed files with 15 additions and 15 deletions
|
@ -64,12 +64,10 @@ extern struct msg_s *net_message;
|
|||
|
||||
extern struct cvar_s *qport;
|
||||
|
||||
int Net_Log_Init (const char **sound_precache);
|
||||
int Net_Log_Init (const char **sound_precache, int server);
|
||||
void Net_LogPrintf (const char *fmt, ...) __attribute__ ((format (PRINTF, 1, 2)));
|
||||
void Log_Incoming_Packet (const byte *p, int len, int has_sequence,
|
||||
int is_server);
|
||||
void Log_Outgoing_Packet (const byte *p, int len, int has_sequence,
|
||||
int is_server);
|
||||
void Log_Incoming_Packet (const byte *p, int len, int has_sequence);
|
||||
void Log_Outgoing_Packet (const byte *p, int len, int has_sequence);
|
||||
void Net_LogStop (void *data);
|
||||
void Analyze_Client_Packet (const byte * data, int len, int has_sequence);
|
||||
void Analyze_Server_Packet (const byte * data, int len, int has_sequence);
|
||||
|
|
|
@ -422,7 +422,7 @@ CL_GetMessage (void)
|
|||
|
||||
if (net_packetlog->int_val)
|
||||
Log_Incoming_Packet (net_message->message->data,
|
||||
net_message->message->cursize, 1, 0);
|
||||
net_message->message->cursize, 1);
|
||||
|
||||
|
||||
if (cls.demorecording)
|
||||
|
|
|
@ -1027,7 +1027,7 @@ CL_ReadPackets (void)
|
|||
|
||||
if (cls.demoplayback && net_packetlog->int_val)
|
||||
Log_Incoming_Packet (net_message->message->data,
|
||||
net_message->message->cursize, 0, 0);
|
||||
net_message->message->cursize, 0);
|
||||
|
||||
// remote command packet
|
||||
if (*(int *) net_message->message->data == -1) {
|
||||
|
@ -1863,7 +1863,7 @@ Host_Init (void)
|
|||
|
||||
for (i = 0; i < MAX_MODELS; i++)
|
||||
sound_precache[i] = cl.sound_name[i];
|
||||
Net_Log_Init (sound_precache);
|
||||
Net_Log_Init (sound_precache, 0);
|
||||
}
|
||||
CL_HTTP_Init ();
|
||||
|
||||
|
|
|
@ -166,6 +166,7 @@ static QFile *Net_PacketLog;
|
|||
static const char **Net_sound_precache;
|
||||
static sizebuf_t _packet;
|
||||
static qmsg_t packet = {0, 0, &_packet};
|
||||
static int is_server = 0;
|
||||
|
||||
static int
|
||||
Net_LogStart (const char *fname)
|
||||
|
@ -224,7 +225,7 @@ ascii_dump_buf (unsigned char *buf, int len)
|
|||
}
|
||||
*/
|
||||
void
|
||||
Log_Incoming_Packet (const byte *p, int len, int has_sequence, int is_server)
|
||||
Log_Incoming_Packet (const byte *p, int len, int has_sequence)
|
||||
{
|
||||
if (!net_loglevel->int_val)
|
||||
return;
|
||||
|
@ -248,7 +249,7 @@ Log_Incoming_Packet (const byte *p, int len, int has_sequence, int is_server)
|
|||
}
|
||||
|
||||
void
|
||||
Log_Outgoing_Packet (const byte *p, int len, int has_sequence, int is_server)
|
||||
Log_Outgoing_Packet (const byte *p, int len, int has_sequence)
|
||||
{
|
||||
if (!net_loglevel->int_val)
|
||||
return;
|
||||
|
@ -952,7 +953,7 @@ Analyze_Client_Packet (const byte * data, int len, int has_sequence)
|
|||
static void
|
||||
net_packet_log_f (int length, const void *data, netadr_t to)
|
||||
{
|
||||
Log_Outgoing_Packet (data, length, 1, 1);
|
||||
Log_Outgoing_Packet (data, length, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -981,8 +982,9 @@ Net_PacketLog_Zap_f (void)
|
|||
}
|
||||
|
||||
int
|
||||
Net_Log_Init (const char **sound_precache)
|
||||
Net_Log_Init (const char **sound_precache, int server)
|
||||
{
|
||||
is_server = server;
|
||||
Net_sound_precache = sound_precache;
|
||||
|
||||
_stdout = Qdopen (1, "wt"); // create a QFile of stdout
|
||||
|
|
|
@ -1747,7 +1747,7 @@ void
|
|||
SV_OutOfBand (netadr_t adr, unsigned length, byte *data)
|
||||
{
|
||||
if (net_packetlog->int_val) {
|
||||
Log_Outgoing_Packet (data, length, 0, 1);
|
||||
Log_Outgoing_Packet (data, length, 0);
|
||||
}
|
||||
Netchan_OutOfBand (adr, length, data);
|
||||
}
|
||||
|
@ -1781,7 +1781,7 @@ SV_ReadPackets (void)
|
|||
while (NET_GetPacket ()) {
|
||||
if (net_packetlog->int_val)
|
||||
Log_Incoming_Packet (net_message->message->data,
|
||||
net_message->message->cursize, 1, 1);
|
||||
net_message->message->cursize, 1);
|
||||
if (SV_FilterIP (net_from.ip, &until)) {
|
||||
SV_SendBan (until); // tell them we aren't listening...
|
||||
continue;
|
||||
|
@ -2465,7 +2465,7 @@ SV_InitNet (void)
|
|||
Netchan_Init ();
|
||||
net_realtime = &realtime;
|
||||
|
||||
Net_Log_Init (sv.sound_precache);
|
||||
Net_Log_Init (sv.sound_precache, 1);
|
||||
|
||||
svs.last_heartbeat = -99999; // send immediately
|
||||
sv_net_initialized = 1;
|
||||
|
|
Loading…
Reference in a new issue