| 190 | } |
| 191 | |
| 192 | bool TcpNetworkedPhysicsProcessor::receiveStatus(struct SharedMemoryStatus& serverStatusOut, char* bufferServerToClient, int bufferSizeInBytes) |
| 193 | { |
| 194 | bool hasStatus = m_data->checkData(); |
| 195 | |
| 196 | if (hasStatus) |
| 197 | { |
| 198 | if (gVerboseNetworkMessagesClient2) |
| 199 | { |
| 200 | printf("TcpNetworkedPhysicsProcessor::receiveStatus\n"); |
| 201 | } |
| 202 | |
| 203 | serverStatusOut = m_data->m_lastStatus; |
| 204 | int numStreamBytes = m_data->m_stream.size(); |
| 205 | |
| 206 | if (numStreamBytes < bufferSizeInBytes) |
| 207 | { |
| 208 | for (int i = 0; i < numStreamBytes; i++) |
| 209 | { |
| 210 | bufferServerToClient[i] = m_data->m_stream[i]; |
| 211 | } |
| 212 | } |
| 213 | else |
| 214 | { |
| 215 | printf("Error: steam buffer overflow\n"); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | return hasStatus; |
| 220 | } |
| 221 | |
| 222 | void TcpNetworkedPhysicsProcessor::renderScene(int renderFlags) |
| 223 | { |
no test coverage detected