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