diff --git a/r5dev/engine/client/clientstate.cpp b/r5dev/engine/client/clientstate.cpp index 496a8939..15072c71 100644 --- a/r5dev/engine/client/clientstate.cpp +++ b/r5dev/engine/client/clientstate.cpp @@ -22,6 +22,30 @@ bool CClientState::IsPaused() const return m_bPaused; } +//------------------------------------------------------------------------------ +// Purpose: returns true if client is fully connected and active +//------------------------------------------------------------------------------ +bool CClientState::IsActive(void) const +{ + return m_nSignonState == SIGNONSTATE::SIGNONSTATE_FULL; +}; + +//------------------------------------------------------------------------------ +// Purpose: returns true if client connected but not active +//------------------------------------------------------------------------------ +bool CClientState::IsConnected(void) const +{ + return m_nSignonState >= SIGNONSTATE::SIGNONSTATE_CONNECTED; +}; + +//------------------------------------------------------------------------------ +// Purpose: returns true if client is still connecting +//------------------------------------------------------------------------------ +bool CClientState::IsConnecting(void) const +{ + return m_nSignonState >= SIGNONSTATE::SIGNONSTATE_NONE; +} + //------------------------------------------------------------------------------ // Purpose: gets the client time // Technically doesn't belong here diff --git a/r5dev/engine/client/clientstate.h b/r5dev/engine/client/clientstate.h index 73f47999..f51b8881 100644 --- a/r5dev/engine/client/clientstate.h +++ b/r5dev/engine/client/clientstate.h @@ -25,6 +25,10 @@ class CClientState : CS_INetChannelHandler, IConnectionlessPacketHandler, IServe { public: bool IsPaused() const; + bool IsActive(void) const; + bool IsConnected(void) const; + bool IsConnecting(void) const; + float GetClientTime() const; int GetTick() const; diff --git a/r5dev/engine/host_state.cpp b/r5dev/engine/host_state.cpp index 4b90e17e..3aeea624 100644 --- a/r5dev/engine/host_state.cpp +++ b/r5dev/engine/host_state.cpp @@ -21,6 +21,7 @@ #else // #include "engine/client/cl_rcon.h" #include "engine/client/cl_main.h" +#include "engine/client/clientstate.h" #endif // DEDICATED #include "engine/net.h" #include "engine/gl_screen.h" @@ -120,6 +121,18 @@ FORCEINLINE void CHostState::FrameUpdate(CHostState* pHostState, double flCurren bResetIdleName = true; } +#if !defined (DEDICATED) && !defined (CLIENT_DLL) + // Parallel processing of 'C_BaseAnimating::SetupBones()' is not supported + // on listen servers running the local client. + if (g_pServer->IsActive()) + { + if (cl_threaded_bone_setup->GetBool()) + { + cl_threaded_bone_setup->SetValue(false); + } + } +#endif // !DEDICATED && !CLIENT_DLL + CHostState_State_Run(&g_pHostState->m_iCurrentState, flCurrentTime, flFrameTime); break; } @@ -445,12 +458,12 @@ FORCEINLINE void CHostState::ResetLevelName(void) /////////////////////////////////////////////////////////////////////////////// void CHostState_Attach() { - DetourAttach((LPVOID*)&CHostState_FrameUpdate, &CHostState::FrameUpdate); + DetourAttach(&CHostState_FrameUpdate, &CHostState::FrameUpdate); } void CHostState_Detach() { - DetourDetach((LPVOID*)&CHostState_FrameUpdate, &CHostState::FrameUpdate); + DetourDetach(&CHostState_FrameUpdate, &CHostState::FrameUpdate); } /////////////////////////////////////////////////////////////////////////////// diff --git a/r5dev/engine/server/server.h b/r5dev/engine/server/server.h index 2b62ebfe..9fcf3d72 100644 --- a/r5dev/engine/server/server.h +++ b/r5dev/engine/server/server.h @@ -65,7 +65,6 @@ private: bool m_bUpdateFrame; // perform snapshot update bool m_bUseReputation; // use of player reputation on the server bool m_bSimulating; // are we simulating or not - int m_nPad; // padding bf_write m_Signon; // signon bitbuf CUtlMemory m_SignonBuffer; // signon memory int m_nServerClasses; // number of unique server classes diff --git a/r5dev/resource/cfg/autoexec_client.cfg b/r5dev/resource/cfg/autoexec_client.cfg index 28801e02..d9533c49 100644 --- a/r5dev/resource/cfg/autoexec_client.cfg +++ b/r5dev/resource/cfg/autoexec_client.cfg @@ -5,7 +5,6 @@ //// CLIENT //// ////////////////////////// cl_noTimeoutLocalHost "0" // Do not time-out on local connections. -cl_threaded_bone_setup "0" // Has to be disabled on the client to prevent deadlock. ////////////////////////// //// DEBUG TEXT //// diff --git a/r5dev/resource/cfg/autoexec_client_dev.cfg b/r5dev/resource/cfg/autoexec_client_dev.cfg index be9fa874..0a44ffd3 100644 --- a/r5dev/resource/cfg/autoexec_client_dev.cfg +++ b/r5dev/resource/cfg/autoexec_client_dev.cfg @@ -5,7 +5,6 @@ //// CLIENT //// ////////////////////////// cl_noTimeoutLocalHost "1" // Do not time-out on local connections. -cl_threaded_bone_setup "0" // Has to be disabled on the client to prevent deadlock. cl_quota_stringCmdsPerSecond "256" // Max string commands submissions on the client. ////////////////////////// @@ -37,13 +36,13 @@ cl_showsimstats "1" // Shows detailed simula cl_simstats_invert_x "1" // Inverts the X offset for simulation debug overlay. cl_simstats_invert_y "1" // Inverts the Y offset for simulation debug overlay. cl_simstats_offset_x "650" // Simulation stats 'X' offset. -cl_simstats_offset_y "120" // Simulation stats 'Y' offset. +cl_simstats_offset_y "130" // Simulation stats 'Y' offset. cl_showgpustats "1" // Shows detailed GPU memory stats. cl_gpustats_invert_x "1" // Inverts the X offset for texture streaming debug overlay. cl_gpustats_invert_y "1" // Inverts the Y offset for texture streaming debug overlay. cl_gpustats_offset_x "650" // GPU stats 'X' offset. -cl_gpustats_offset_y "105" // GPU stats 'Y' offset. +cl_gpustats_offset_y "115" // GPU stats 'Y' offset. phys_showObjectCount "1" // Shows physics object count. rui_defaultDebugFontFace "ArameMono" // Sets the RUI debug font face.