summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-24 23:03:48 +0100
committermadmaxoft <github@xoft.cz>2014-01-24 23:03:48 +0100
commitd0da5d392f64c63fefde352a2a0b569317ca59cc (patch)
treefab51c06d218facd3be1c52201aa14ba96ee6d90 /src/main.cpp
parentFixed a possible deadlock on client disconnect. (diff)
downloadcuberite-d0da5d392f64c63fefde352a2a0b569317ca59cc.tar
cuberite-d0da5d392f64c63fefde352a2a0b569317ca59cc.tar.gz
cuberite-d0da5d392f64c63fefde352a2a0b569317ca59cc.tar.bz2
cuberite-d0da5d392f64c63fefde352a2a0b569317ca59cc.tar.lz
cuberite-d0da5d392f64c63fefde352a2a0b569317ca59cc.tar.xz
cuberite-d0da5d392f64c63fefde352a2a0b569317ca59cc.tar.zst
cuberite-d0da5d392f64c63fefde352a2a0b569317ca59cc.zip
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 340149e0b..68bf6683f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -19,6 +19,15 @@ bool g_SERVER_TERMINATED = false; // Set to true when the server terminates, so
+#ifdef _DEBUG
+/** If set to true, the protocols will log each player's communication to a separate logfile */
+bool g_ShouldLogComm;
+#endif
+
+
+
+
+
/// If defined, a thorough leak finder will be used (debug MSVC only); leaks will be output to the Output window
#define ENABLE_LEAK_FINDER
@@ -216,12 +225,26 @@ int main( int argc, char **argv )
#ifndef _DEBUG
std::signal(SIGSEGV, NonCtrlHandler);
std::signal(SIGTERM, NonCtrlHandler);
- std::signal(SIGINT, NonCtrlHandler);
+ std::signal(SIGINT, NonCtrlHandler);
#endif
// DEBUG: test the dumpfile creation:
// *((int *)0) = 0;
+ // Check if comm logging is to be enabled:
+ #ifdef _DEBUG
+ for (int i = 0; i < argc; i++)
+ {
+ if (
+ (_stricmp(argv[i], "/commlog") == 0) ||
+ (_stricmp(argv[i], "/logcomm") == 0)
+ )
+ {
+ g_ShouldLogComm = true;
+ }
+ }
+ #endif // _DEBUG
+
#if !defined(ANDROID_NDK)
try
#endif