fix the sound precache lookup code in net_packetlog.c

This commit is contained in:
Bill Currie 2001-05-28 22:16:27 +00:00
parent 6eadd402ab
commit 3c66182588
4 changed files with 16 additions and 7 deletions

View file

@ -132,7 +132,7 @@ qboolean Netchan_CanPacket (netchan_t *chan);
qboolean Netchan_CanReliable (netchan_t *chan);
#ifdef PACKET_LOGGING
extern int Net_Log_Init (void);
extern int Net_Log_Init (char **sound_precache);
extern void Log_Incoming_Packet (char *p, int len);
extern void Log_Outgoing_Packet (char *p, int len);
extern void Net_LogStop (void);

View file

@ -1127,7 +1127,14 @@ CL_Init (void)
PI_Init ();
#ifdef PACKET_LOGGING
Net_Log_Init ();
{
static char *sound_precache[MAX_MODELS];
int i;
for (i = 0; i < MAX_MODELS; i++)
sound_precache[i] = cl.sound_name[i];
Net_Log_Init (sound_precache);
}
#endif
CL_Input_Init ();
CL_Ents_Init ();

View file

@ -175,6 +175,8 @@ char *clc_string[] = {
QFile *Net_PacketLog;
char **Net_sound_precache;
/*
NET_LogPrintf
@ -491,9 +493,7 @@ Parse_Server_Packet ()
(float) MSG_ReadByte (net_message) / 64.0);
ii = MSG_ReadByte (net_message);
// FIXME: well, cl. for client :-)
// Net_LogPrintf ("%d (%s) ", ii, sv.sound_precache[ii]);
Net_LogPrintf ("%d (%s) ", ii);
Net_LogPrintf ("%d (%s) ", ii, Net_sound_precache[ii]);
Net_LogPrintf ("Pos: ");
for (ii = 0; ii < 3; ii++)
Net_LogPrintf ("%f ", MSG_ReadCoord (net_message));
@ -961,8 +961,10 @@ Parse_Client_Packet (void)
}
int
Net_Log_Init (void)
Net_Log_Init (char **sound_precache)
{
Net_sound_precache = sound_precache;
netlogger =
Cvar_Get ("net_logger", "1", CVAR_NONE, NULL, "Packet logging/parsing");

View file

@ -1890,7 +1890,7 @@ SV_InitNet (void)
Netchan_Init ();
#ifdef PACKET_LOGGING
Net_Log_Init();
Net_Log_Init(sv.sound_precache);
#endif
// heartbeats will always be sent to the id master