SA-MP/raknet/PacketFileLogger.cpp

23 lines
451 B
C++
Raw Normal View History

#include "PacketFileLogger.h"
#include "GetTime.h"
PacketFileLogger::~PacketFileLogger()
{
fclose(packetLogFile);
}
void PacketFileLogger::OnAttach(RakPeerInterface *peer)
{
PacketLogger::OnAttach(peer);
// Open file for writing
char filename[256];
sprintf(filename, "PacketLog%i.csv", RakNet::GetTime());
packetLogFile = fopen(filename, "wt");
LogHeader();
}
void PacketFileLogger::WriteLog(const char *str)
{
fputs(str, packetLogFile);
}