mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 15:07:28 +00:00
Windows fixes
- "Fixed" segfault - Fixed logger not actually logging time
This commit is contained in:
parent
b580f19825
commit
393cce885b
@ -92,8 +92,8 @@ void dLogger::Log(const char * className, const char * format, ...) {
|
||||
|
||||
va_end(args);
|
||||
|
||||
if (m_logToConsole) std::cout << "[" << "timeStr" << "] [" << className << "]: " << message;
|
||||
mFile << "[" << "timeStr" << "] [" << className << "]: " << message;
|
||||
if (m_logToConsole) std::cout << "[" << timeStr << "] [" << className << "]: " << message;
|
||||
mFile << "[" << timeStr << "] [" << className << "]: " << message;
|
||||
#else
|
||||
time_t t = time(NULL);
|
||||
struct tm * time = localtime(&t);
|
||||
|
@ -154,6 +154,11 @@ void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, const LWOOB
|
||||
delete chatmode;
|
||||
delete name;
|
||||
|
||||
#ifdef _WIN32
|
||||
bitStream.Write<uint32_t>(data.GetNumberOfBytesUsed() + 1);
|
||||
bitStream.Write<uint8_t>(0);
|
||||
bitStream.Write((char*)data.GetData(), data.GetNumberOfBytesUsed());
|
||||
#else
|
||||
//Compress the data before sending:
|
||||
const int reservedSize = 5 * 1024 * 1024;
|
||||
uint8_t compressedData[reservedSize];
|
||||
@ -166,13 +171,7 @@ void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, const LWOOB
|
||||
|
||||
for (size_t i = 0; i < size; i++)
|
||||
bitStream.Write(compressedData[i]);
|
||||
|
||||
/*
|
||||
uint32_t dataSize = data.GetNumberOfBytesUsed();
|
||||
bitStream.Write(dataSize + 8); // The data size
|
||||
bitStream.Write(static_cast<uint8_t>(0)); // Data is not compressed
|
||||
bitStream.Write(data); // Write the data
|
||||
*/
|
||||
#endif
|
||||
|
||||
PacketUtils::SavePacket("chardata.bin", (const char *)bitStream.GetData(), static_cast<uint32_t>(bitStream.GetNumberOfBytesUsed()));
|
||||
SEND_PACKET
|
||||
|
Loading…
Reference in New Issue
Block a user