aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/Console_Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.Client/Common/Console_Utils.cpp')
-rw-r--r--Minecraft.Client/Common/Console_Utils.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/Minecraft.Client/Common/Console_Utils.cpp b/Minecraft.Client/Common/Console_Utils.cpp
index cb0f1b58..9a64dbea 100644
--- a/Minecraft.Client/Common/Console_Utils.cpp
+++ b/Minecraft.Client/Common/Console_Utils.cpp
@@ -1,21 +1,32 @@
#include "stdafx.h"
+#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
+#include "..\..\Minecraft.Server\ServerLogManager.h"
+#endif
//--------------------------------------------------------------------------------------
// Name: DebugSpewV()
// Desc: Internal helper function
//--------------------------------------------------------------------------------------
#ifndef _CONTENT_PACKAGE
-static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList )
+static VOID DebugSpewV( const CHAR* strFormat, va_list pArgList )
{
#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
- assert(0);
+ assert(0);
#else
- CHAR str[2048];
- // Use the secure CRT to avoid buffer overruns. Specify a count of
- // _TRUNCATE so that too long strings will be silently truncated
- // rather than triggering an error.
- _vsnprintf_s( str, _TRUNCATE, strFormat, pArgList );
- OutputDebugStringA( str );
+#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
+ // Dedicated server routes legacy debug spew through ServerLogger to preserve CLI prompt handling.
+ if (ServerRuntime::ServerLogManager::ShouldForwardClientDebugLogs())
+ {
+ ServerRuntime::ServerLogManager::ForwardClientDebugSpewLogV(strFormat, pArgList);
+ return;
+ }
+#endif
+ CHAR str[2048];
+ // Use the secure CRT to avoid buffer overruns. Specify a count of
+ // _TRUNCATE so that too long strings will be silently truncated
+ // rather than triggering an error.
+ _vsnprintf_s( str, _TRUNCATE, strFormat, pArgList );
+ OutputDebugStringA( str );
#endif
}
#endif
@@ -31,10 +42,9 @@ VOID CDECL DebugPrintf( const CHAR* strFormat, ... )
#endif
{
#ifndef _CONTENT_PACKAGE
- va_list pArgList;
- va_start( pArgList, strFormat );
- DebugSpewV( strFormat, pArgList );
- va_end( pArgList );
+ va_list pArgList;
+ va_start( pArgList, strFormat );
+ DebugSpewV( strFormat, pArgList );
+ va_end( pArgList );
#endif
}
-