network UDP: transmit structural DNA to deal with version/platform differences.

pybullet: allow to specify shared memory key and hostname/port for UDP.
This commit is contained in:
erwincoumans
2016-11-04 17:06:55 -07:00
parent 0ffd68ac32
commit 5d66ce20e0
5 changed files with 135 additions and 10 deletions

View File

@@ -2178,6 +2178,28 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
break;
}
case CMD_REQUEST_INTERNAL_DATA:
{
//todo: also check version etc?
SharedMemoryStatus& serverCmd = serverStatusOut;
serverCmd.m_type = CMD_REQUEST_INTERNAL_DATA_FAILED;
hasStatus = true;
int sz = btDefaultSerializer::getMemoryDnaSizeInBytes();
const char* memDna = btDefaultSerializer::getMemoryDna();
if (sz < bufferSizeInBytes)
{
for (int i = 0; i < bufferSizeInBytes; i++)
{
bufferServerToClient[i] = memDna[i];
}
serverCmd.m_type = CMD_REQUEST_INTERNAL_DATA_COMPLETED;
serverCmd.m_numDataStreamBytes = bufferSizeInBytes;
}
break;
};
case CMD_SEND_PHYSICS_SIMULATION_PARAMETERS:
{
if (clientCmd.m_updateFlags&SIM_PARAM_UPDATE_DELTA_TIME)