diff options
author | madmaxoft <github@xoft.cz> | 2013-09-08 11:27:49 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-09-08 11:27:49 +0200 |
commit | 36a6df8a3458d32168e260293b029ecf815e7dca (patch) | |
tree | 08cd98c3a27d523de6363e44c4e685f49585b987 /Tools/ProtoProxy/Connection.cpp | |
parent | ProtoProxy: The MOTD is modified to indicate ProtoProxy presence. (diff) | |
download | cuberite-36a6df8a3458d32168e260293b029ecf815e7dca.tar cuberite-36a6df8a3458d32168e260293b029ecf815e7dca.tar.gz cuberite-36a6df8a3458d32168e260293b029ecf815e7dca.tar.bz2 cuberite-36a6df8a3458d32168e260293b029ecf815e7dca.tar.lz cuberite-36a6df8a3458d32168e260293b029ecf815e7dca.tar.xz cuberite-36a6df8a3458d32168e260293b029ecf815e7dca.tar.zst cuberite-36a6df8a3458d32168e260293b029ecf815e7dca.zip |
Diffstat (limited to '')
-rw-r--r-- | Tools/ProtoProxy/Connection.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp index 55ba74a87..e985c2ff6 100644 --- a/Tools/ProtoProxy/Connection.cpp +++ b/Tools/ProtoProxy/Connection.cpp @@ -8,6 +8,9 @@ #include "Server.h" #include <iostream> +#ifdef _WIN32 + #include <direct.h> // For _mkdir() +#endif @@ -261,7 +264,14 @@ cConnection::cConnection(SOCKET a_ClientSocket, cServer & a_Server) : m_ServerBuffer(1024 KiB), m_HasClientPinged(false) { - Printf(m_LogNameBase, "Log_%d", (int)time(NULL)); + // Create the Logs subfolder, if not already created: + #if defined(_WIN32) + _mkdir("Logs"); + #else + mkdir("Logs", 0777); + #endif + + Printf(m_LogNameBase, "Logs/Log_%d", (int)time(NULL)); AString fnam(m_LogNameBase); fnam.append(".log"); m_LogFile = fopen(fnam.c_str(), "w"); |