mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
bcdbedc0be
* Add RakNet source files to the VS project
23 lines
451 B
C++
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);
|
|
}
|