From a848c1d6e929ae0fed395e13b937548cc107f833 Mon Sep 17 00:00:00 2001 From: Jiaxi Date: Sun, 14 Jun 2020 21:26:54 -0400 Subject: [PATCH 1/3] Check for availability of soft body --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 16836ddd2..1ced08f42 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -11791,6 +11791,8 @@ bool PhysicsServerCommandProcessor::processCreateUserConstraintCommand(const str delete userConstraintPtr->m_rbConstraint; m_data->m_userConstraints.remove(userConstraintUidRemove); } +#ifndef SKIP_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD + if (userConstraintPtr->m_sbHandle >= 0) { InternalBodyHandle* sbodyHandle = m_data->m_bodyHandles.getHandle(clientCmd.m_userConstraintArguments.m_parentBodyIndex); @@ -11809,6 +11811,7 @@ bool PhysicsServerCommandProcessor::processCreateUserConstraintCommand(const str } } } +#endif serverCmd.m_userConstraintResultArgs.m_userConstraintUniqueId = userConstraintUidRemove; serverCmd.m_type = CMD_REMOVE_USER_CONSTRAINT_COMPLETED; } From f034e64cc6008d5c8be1897e0b0ff6b36afc52d1 Mon Sep 17 00:00:00 2001 From: Jiaxi Date: Sun, 14 Jun 2020 21:42:32 -0400 Subject: [PATCH 2/3] Check for availability of soft body --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 1ced08f42..8807bbed7 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -11012,6 +11012,7 @@ bool PhysicsServerCommandProcessor::processApplyExternalForceCommand(const struc } } +#ifndef SKIP_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD if (body && body->m_softBody) { btSoftBody* sb = body->m_softBody; @@ -11034,6 +11035,8 @@ bool PhysicsServerCommandProcessor::processApplyExternalForceCommand(const struc } } } +#endif + } SharedMemoryStatus& serverCmd = serverStatusOut; From daaea3a4fb1dc602a1595c517e76c9468be1c398 Mon Sep 17 00:00:00 2001 From: Jiaxi Date: Sun, 14 Jun 2020 21:57:43 -0400 Subject: [PATCH 3/3] Fix potentially send data to invalid port --- examples/SharedMemory/PhysicsClientTCP.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/SharedMemory/PhysicsClientTCP.cpp b/examples/SharedMemory/PhysicsClientTCP.cpp index 6a722cafb..3a8f3fdd1 100644 --- a/examples/SharedMemory/PhysicsClientTCP.cpp +++ b/examples/SharedMemory/PhysicsClientTCP.cpp @@ -64,9 +64,10 @@ struct TcpNetworkedInternalData { m_tcpSocket.SetSendTimeout(m_timeOutInSeconds, 0); m_tcpSocket.SetReceiveTimeout(m_timeOutInSeconds, 0); + int key = SHARED_MEMORY_MAGIC_NUMBER; + m_tcpSocket.Send((uint8*)&key, 4); } - int key = SHARED_MEMORY_MAGIC_NUMBER; - m_tcpSocket.Send((uint8*)&key, 4); + return m_isConnected; }