mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 16:51:08 +00:00
add a net_packetlog_zap command (those files can get big:)
This commit is contained in:
parent
4babd979d6
commit
a488af9bf5
1 changed files with 23 additions and 2 deletions
|
@ -39,12 +39,14 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include "QF/cmd.h"
|
||||||
#include "QF/msg.h"
|
#include "QF/msg.h"
|
||||||
|
#include "QF/va.h"
|
||||||
|
#include "QF/vfs.h"
|
||||||
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include "QF/vfs.h"
|
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "QF/va.h"
|
|
||||||
|
|
||||||
cvar_t *net_packetlog;
|
cvar_t *net_packetlog;
|
||||||
cvar_t *net_loglevel;
|
cvar_t *net_loglevel;
|
||||||
|
@ -967,6 +969,22 @@ Net_PacketLog_f (cvar_t *var)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Net_PacketLog_Zap_f (void)
|
||||||
|
{
|
||||||
|
if (Net_PacketLog && Net_PacketLog != &_stdout) {
|
||||||
|
Con_Printf ("truncating packet logfile: %s\n", "qfpacket.log");
|
||||||
|
Qseek (Net_PacketLog, 0, 0);
|
||||||
|
Qwrite (Net_PacketLog, 0, 0);
|
||||||
|
} else {
|
||||||
|
char e_path[MAX_OSPATH];
|
||||||
|
|
||||||
|
Qexpand_squiggle (fs_userpath->string, e_path);
|
||||||
|
Con_Printf ("Deleting packet logfile: %s\n", "qfpacket.log");
|
||||||
|
unlink (va ("%s/%s", e_path, "qfpacket.log"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Net_Log_Init (char **sound_precache)
|
Net_Log_Init (char **sound_precache)
|
||||||
{
|
{
|
||||||
|
@ -984,5 +1002,8 @@ Net_Log_Init (char **sound_precache)
|
||||||
net_loglevel =
|
net_loglevel =
|
||||||
Cvar_Get ("net_loglevel", "2", CVAR_NONE, NULL,
|
Cvar_Get ("net_loglevel", "2", CVAR_NONE, NULL,
|
||||||
"Packet logging/parsing");
|
"Packet logging/parsing");
|
||||||
|
|
||||||
|
Cmd_AddCommand ("net_packetlog_zap", Net_PacketLog_Zap_f,
|
||||||
|
"clear the packet log file");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue