| 861 | } |
| 862 | |
| 863 | Net::Error NetConnection::sendPacket(BitStream *stream) |
| 864 | { |
| 865 | //Con::printf("NET %d: SEND - %d", getId(), mLastSendSeq); |
| 866 | // do nothing on send if this is a demo replay. |
| 867 | if(mDemoReadStream) |
| 868 | return Net::NoError; |
| 869 | |
| 870 | gNetBitsSent = stream->getPosition(); |
| 871 | |
| 872 | if(isLocalConnection()) |
| 873 | { |
| 874 | // short circuit connection to the other side. |
| 875 | // handle the packet, then force a notify. |
| 876 | stream->setBuffer(stream->getBuffer(), stream->getPosition(), stream->getPosition()); |
| 877 | mRemoteConnection->processRawPacket(stream); |
| 878 | |
| 879 | return Net::NoError; |
| 880 | } |
| 881 | else |
| 882 | { |
| 883 | return Net::sendto(getNetAddress(), stream->getBuffer(), stream->getPosition()); |
| 884 | } |
| 885 | } |
| 886 | |
| 887 | //-------------------------------------------------------------------- |
| 888 | //-------------------------------------------------------------------- |
no test coverage detected