summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-25 15:37:00 +0100
committermadmaxoft <github@xoft.cz>2014-01-25 15:37:00 +0100
commita2dfb2853718cc8bf73b954e5b678c12d93c815c (patch)
treeb793ef13c8793cf4943659d75fcbe10cb4074daf /src/main.cpp
parentRemoved unnecessary define (diff)
parentComm logging is available in both Debug and Release modes. (diff)
downloadcuberite-a2dfb2853718cc8bf73b954e5b678c12d93c815c.tar
cuberite-a2dfb2853718cc8bf73b954e5b678c12d93c815c.tar.gz
cuberite-a2dfb2853718cc8bf73b954e5b678c12d93c815c.tar.bz2
cuberite-a2dfb2853718cc8bf73b954e5b678c12d93c815c.tar.lz
cuberite-a2dfb2853718cc8bf73b954e5b678c12d93c815c.tar.xz
cuberite-a2dfb2853718cc8bf73b954e5b678c12d93c815c.tar.zst
cuberite-a2dfb2853718cc8bf73b954e5b678c12d93c815c.zip
Diffstat (limited to '')
-rw-r--r--src/main.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 340149e0b..06b344c25 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -19,6 +19,13 @@ bool g_SERVER_TERMINATED = false; // Set to true when the server terminates, so
+/** If set to true, the protocols will log each player's communication to a separate logfile */
+bool g_ShouldLogComm;
+
+
+
+
+
/// 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 +223,24 @@ 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:
+ for (int i = 0; i < argc; i++)
+ {
+ if (
+ (NoCaseCompare(argv[i], "/commlog") == 0) ||
+ (NoCaseCompare(argv[i], "/logcomm") == 0)
+ )
+ {
+ g_ShouldLogComm = true;
+ }
+ }
+
#if !defined(ANDROID_NDK)
try
#endif