SA-MP/raknet/PacketFileLogger.cpp
RD42 bcdbedc0be Revert RakNet source files back to the original v2.518 state
* Add RakNet source files to the VS project
2024-08-16 23:33:48 +08:00

23 lines
451 B
C++

#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);
}