diff --git a/flightrec/decoder/pub/decoder.bat b/flightrec/decoder/pub/decoder.bat index 1026be9..813a720 100644 --- a/flightrec/decoder/pub/decoder.bat +++ b/flightrec/decoder/pub/decoder.bat @@ -41,9 +41,6 @@ set CMD_LINE_ARGS=%* goto mainEnd :fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd diff --git a/rehlds/engine/unicode_strtools.cpp b/rehlds/engine/unicode_strtools.cpp index a37a43f..b2c7416 100644 --- a/rehlds/engine/unicode_strtools.cpp +++ b/rehlds/engine/unicode_strtools.cpp @@ -363,7 +363,7 @@ int Q_UnicodeConvertT(const T_IN* pIn, T_OUT *pOut, int nOutBytes, enum EStringC if (nMaxOut <= 0) return 0; - while (pIn) + while (*pIn) { bool bErr; uchar32 uVal; diff --git a/rehlds/testsuite/player.cpp b/rehlds/testsuite/player.cpp index 7e86ab6..5caf865 100644 --- a/rehlds/testsuite/player.cpp +++ b/rehlds/testsuite/player.cpp @@ -52,6 +52,7 @@ CPlayingEngExtInterceptor::CPlayingEngExtInterceptor(const char* fname, bool str printf("Playing testsuite\nrecorders's cmdline: %s\n", cmdLine); m_StartTick = ::GetTickCount(); + m_NumFrames = 0; } void* CPlayingEngExtInterceptor::allocFuncCall() @@ -148,9 +149,13 @@ IEngExtCall* CPlayingEngExtInterceptor::getNextCall(bool peek, bool processCallb if (cmd->getOpcode() == ECF_NONE) { DWORD endTick = ::GetTickCount(); - FILE* fl = fopen("rehlds_demo_stats.log", "w"); + FILE* fl = fopen("rehlds_demo_stats.xml", "w"); if (fl) { - fprintf(fl, "Finished playing demo; duration=%umsec", (endTick - m_StartTick)); + fprintf(fl, "\n"); + fprintf(fl, "\n"); + fprintf(fl, " %u\n", (endTick - m_StartTick)); + fprintf(fl, " %u\n", m_NumFrames); + fprintf(fl, "\n"); fclose(fl); } TerminateProcess(GetCurrentProcess(), 777); @@ -451,6 +456,10 @@ int CPlayingEngExtInterceptor::recvfrom(SOCKET s, char* buf, int len, int flags, freeFuncCall(playCall); freeFuncCall(playEndCall); + if (res == -1) { + m_NumFrames++; + } + return res; } diff --git a/rehlds/testsuite/player.h b/rehlds/testsuite/player.h index b78c628..200d037 100644 --- a/rehlds/testsuite/player.h +++ b/rehlds/testsuite/player.h @@ -136,6 +136,7 @@ private: int m_PrevHeartBeat; DWORD m_StartTick; + int m_NumFrames; hostent_data_t m_CurrentHostentData; struct hostent m_CurrentHostent;